stackone_client 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stack_one/accounts.rb +549 -46
- data/lib/stack_one/ats.rb +8352 -753
- data/lib/stack_one/connect_sessions.rb +231 -26
- data/lib/stack_one/connectors.rb +219 -18
- data/lib/stack_one/crm.rb +1153 -98
- data/lib/stack_one/hris.rb +7091 -621
- data/lib/stack_one/iam.rb +1261 -72
- data/lib/stack_one/lms.rb +3134 -282
- data/lib/stack_one/marketing.rb +3045 -290
- data/lib/stack_one/models/operations/ats_create_application_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_candidate_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_candidate_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_job_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_create_offer_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_delete_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_download_application_document_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_queryparam_filter.rb +24 -0
- data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_get_application_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_document_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_offer_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_scheduled_interview_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_application_scorecard_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_assessments_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_assessments_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_assessments_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_background_check_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_background_check_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_queryparam_filter.rb +24 -0
- data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_get_candidate_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_candidate_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_candidate_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_department_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_interview_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_interview_stage_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_job_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_job_posting_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_job_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_list_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_location_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_offer_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_rejected_reason_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_get_user_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_documents_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_notes_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_application_scorecards_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_applications_offers_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_applications_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_applications_scheduled_interviews_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_assessments_packages_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_background_check_packages_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_background_check_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_candidate_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_candidate_notes_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_candidates_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_departments_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_interview_stages_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_interviews_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_job_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_job_postings_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_jobs_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_lists_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_locations_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_offers_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_rejected_reasons_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_list_users_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_move_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_order_assessments_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_order_background_check_request_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_reject_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_application_note_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_application_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_assessments_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_background_check_package_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_background_check_result_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_candidate_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_update_job_response.rb +38 -2
- data/lib/stack_one/models/operations/ats_upload_application_document_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_create_contact_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_account_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_contact_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_contact_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_get_list_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_accounts_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_contact_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_contacts_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_list_lists_response.rb +38 -2
- data/lib/stack_one/models/operations/crm_update_contact_response.rb +38 -2
- data/lib/stack_one/models/operations/filter.rb +56 -5
- data/lib/stack_one/models/operations/hris_batch_upload_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_skill_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_employee_work_eligibility_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_create_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_download_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_benefit_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_company_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_cost_center_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_department_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_custom_field_definition_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_document_category_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_skill_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employee_time_off_balance_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employees_time_off_request_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_get_employees_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employees_work_eligibility_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_job_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_location_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_team_group_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_entries_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_off_policy_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_off_request_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_get_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_get_time_off_type_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_invite_employee_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_benefits_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_companies_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_cost_center_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_department_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_categories_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_custom_field_definitions_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_documents_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_employments_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_skills_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_balances_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_queryparam_filter.rb +24 -0
- data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_request.rb +55 -0
- data/lib/stack_one/models/operations/hris_list_employee_time_off_policies_response.rb +72 -0
- data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employee_work_eligibility_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employees_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_employments_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_jobs_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_locations_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_team_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_entries_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_off_policies_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_off_requests_request.rb +5 -2
- data/lib/stack_one/models/operations/hris_list_time_off_requests_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_list_time_off_types_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_update_employee_employment_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_update_employee_response.rb +40 -4
- data/lib/stack_one/models/operations/hris_update_employee_time_off_request_request.rb +33 -0
- data/lib/stack_one/models/operations/hris_update_employee_time_off_request_response.rb +72 -0
- data/lib/stack_one/models/operations/hris_update_employee_work_eligibility_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_update_time_off_request_response.rb +38 -2
- data/lib/stack_one/models/operations/hris_upload_employee_document_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_delete_user_request.rb +27 -0
- data/lib/stack_one/models/operations/iam_delete_user_response.rb +72 -0
- data/lib/stack_one/models/operations/iam_get_group_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_get_policy_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_get_role_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_get_user_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_groups_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_policies_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_roles_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_list_users_response.rb +38 -2
- data/lib/stack_one/models/operations/iam_update_user_request.rb +30 -0
- data/lib/stack_one/models/operations/iam_update_user_response.rb +72 -0
- data/lib/stack_one/models/operations/include.rb +18 -0
- data/lib/stack_one/models/operations/lms_batch_upsert_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_batch_upsert_course_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_create_collection_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_create_user_assignment_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_create_user_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_delete_user_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_assignment_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_category_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_course_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_skill_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_user_assignment_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_user_completion_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_get_user_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_assignments_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_categories_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_completions_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_courses_queryparam_filter.rb +6 -3
- data/lib/stack_one/models/operations/lms_list_courses_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_list_courses_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_skills_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_user_assignments_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_user_completions_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_list_users_queryparam_filter.rb +5 -2
- data/lib/stack_one/models/operations/lms_list_users_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_update_collection_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_upsert_content_response.rb +38 -2
- data/lib/stack_one/models/operations/lms_upsert_course_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_content_block_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_email_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_in_app_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_omni_channel_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_push_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_create_sms_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_campaign_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_content_block_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_email_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_in_app_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_omni_channel_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_push_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_get_sms_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_campaigns_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_content_blocks_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_email_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_in_app_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_omni_channel_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_push_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_list_sms_templates_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_content_block_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_email_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_in_app_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_omni_channel_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_push_template_response.rb +38 -2
- data/lib/stack_one/models/operations/marketing_update_sms_template_response.rb +38 -2
- data/lib/stack_one/models/operations/order_by.rb +21 -0
- data/lib/stack_one/models/operations/order_direction.rb +18 -0
- data/lib/stack_one/models/operations/queryparam_filter.rb +47 -5
- data/lib/stack_one/models/operations/queryparam_include.rb +17 -0
- data/lib/stack_one/models/operations/queryparam_order_by.rb +21 -0
- data/lib/stack_one/models/operations/queryparam_order_direction.rb +18 -0
- data/lib/stack_one/models/operations/stackone_authenticate_connect_session_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_create_connect_session_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_delete_account_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_account_meta_info_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_account_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_connector_meta_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_get_log_request.rb +27 -0
- data/lib/stack_one/models/operations/stackone_get_log_response.rb +69 -0
- data/lib/stack_one/models/operations/stackone_list_connectors_meta_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_list_linked_accounts_response.rb +35 -2
- data/lib/stack_one/models/operations/stackone_list_logs_request.rb +39 -0
- data/lib/stack_one/models/operations/stackone_list_logs_response.rb +69 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_include.rb +18 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_order_by.rb +21 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_order_direction.rb +18 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_request_logs_order_by.rb +21 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_queryparam_request_logs_order_direction.rb +18 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_request.rb +39 -0
- data/lib/stack_one/models/operations/stackone_list_step_logs_response.rb +69 -0
- data/lib/stack_one/models/operations/stackone_proxy_request_response.rb +38 -2
- data/lib/stack_one/models/operations/stackone_update_account_response.rb +35 -2
- data/lib/stack_one/models/operations.rb +30 -2
- data/lib/stack_one/models/shared/atscreatejobrequestdto.rb +5 -2
- data/lib/stack_one/models/shared/atsupdatejobrequestdto.rb +5 -2
- data/lib/stack_one/models/shared/badgatewayresponse.rb +30 -0
- data/lib/stack_one/models/shared/badrequestresponse.rb +36 -0
- data/lib/stack_one/models/shared/badrequestresponse_headers.rb +20 -0
- data/lib/stack_one/models/shared/conflictresponse.rb +30 -0
- data/lib/stack_one/models/shared/connectsession.rb +5 -2
- data/lib/stack_one/models/shared/connectsessiontokenauthlink.rb +5 -2
- data/lib/stack_one/models/shared/custommappingerror.rb +30 -0
- data/lib/stack_one/models/shared/data.rb +30 -0
- data/lib/stack_one/models/shared/forbiddenresponse.rb +30 -0
- data/lib/stack_one/models/shared/headers.rb +1 -1
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto.rb +2 -0
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto_type.rb +2 -0
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto_value.rb +1 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto.rb +45 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto_status.rb +27 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto_value.rb +20 -0
- data/lib/stack_one/models/shared/internalservererrorresponse.rb +30 -0
- data/lib/stack_one/models/shared/job.rb +5 -2
- data/lib/stack_one/models/shared/notfoundresponse.rb +30 -0
- data/lib/stack_one/models/shared/notimplementedresponse.rb +30 -0
- data/lib/stack_one/models/shared/policy.rb +4 -4
- data/lib/stack_one/models/shared/preconditionfailedresponse.rb +30 -0
- data/lib/stack_one/models/shared/providererror.rb +33 -0
- data/lib/stack_one/models/shared/providererrorapimodel.rb +3 -3
- data/lib/stack_one/models/shared/providererrorapimodel_headers.rb +20 -0
- data/lib/stack_one/models/shared/providererrorapimodel_raw.rb +20 -0
- data/lib/stack_one/models/shared/raw.rb +1 -1
- data/lib/stack_one/models/shared/rawresponse.rb +2 -2
- data/lib/stack_one/models/shared/request.rb +36 -0
- data/lib/stack_one/models/shared/requesttimedoutresponse.rb +30 -0
- data/lib/stack_one/models/shared/response.rb +36 -0
- data/lib/stack_one/models/shared/steplogsapimodel.rb +84 -0
- data/lib/stack_one/models/shared/steplogspaginated.rb +27 -0
- data/lib/stack_one/models/shared/timeoff.rb +7 -2
- data/lib/stack_one/models/shared/timeoff_duration_unit.rb +27 -0
- data/lib/stack_one/models/shared/timeoff_schemas_policy_type_value.rb +26 -0
- data/lib/stack_one/models/shared/timeoff_schemas_policy_value.rb +23 -0
- data/lib/stack_one/models/shared/timeoff_schemas_type.rb +27 -0
- data/lib/stack_one/models/shared/timeoff_type.rb +2 -0
- data/lib/stack_one/models/shared/timeoff_value.rb +1 -0
- data/lib/stack_one/models/shared/timeoffbalances.rb +2 -2
- data/lib/stack_one/models/shared/timeoffbalances_policy.rb +48 -0
- data/lib/stack_one/models/shared/toomanyrequestsresponse.rb +30 -0
- data/lib/stack_one/models/shared/unauthorizedresponse.rb +30 -0
- data/lib/stack_one/models/shared/unifiedlogresult.rb +24 -0
- data/lib/stack_one/models/shared/unifiedlogs.rb +96 -0
- data/lib/stack_one/models/shared/unifiedlogs_request.rb +36 -0
- data/lib/stack_one/models/shared/unifiedlogs_response.rb +36 -0
- data/lib/stack_one/models/shared/unifiedlogs_url.rb +33 -0
- data/lib/stack_one/models/shared/unifiedlogspaginated.rb +27 -0
- data/lib/stack_one/models/shared/unprocessableentityresponse.rb +30 -0
- data/lib/stack_one/models/shared/url.rb +33 -0
- data/lib/stack_one/models/shared.rb +41 -42
- data/lib/stack_one/proxy.rb +122 -14
- data/lib/stack_one/request_logs.rb +496 -0
- data/lib/stack_one/sdk_hooks/hooks.rb +101 -0
- data/lib/stack_one/sdk_hooks/types.rb +152 -0
- data/lib/stack_one/sdkconfiguration.rb +11 -4
- data/lib/stack_one/stackone.rb +24 -9
- data/lib/stack_one/utils/utils.rb +10 -0
- data/lib/stackone_client.rb +1 -0
- metadata +70 -40
- data/lib/stack_one/models/shared/updateemployeeapimodel.rb +0 -142
- data/lib/stack_one/models/shared/updateemployeeapimodel_avatar.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_country.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment.rb +0 -56
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment_contract_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment_status.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_ethnicity.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_gender.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_home_location.rb +0 -51
- data/lib/stack_one/models/shared/updateemployeeapimodel_marital_status.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_national_identity_number.rb +0 -32
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_frequency.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_period.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_preferred_language.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_country.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_contract_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_contract_type_value.rb +0 -20
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_type_value.rb +0 -33
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_pay_period_value.rb +0 -29
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type_value.rb +0 -33
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_value.rb +0 -31
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_ethnicity_value.rb +0 -26
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_gender_value.rb +0 -23
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_home_location_value.rb +0 -265
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_marital_status_value.rb +0 -26
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_national_identity_number_type_value.rb +0 -159
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_national_identity_number_value.rb +0 -265
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_preferred_language_value.rb +0 -115
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_state.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_value.rb +0 -23
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_country.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_value.rb +0 -265
- data/lib/stack_one/models/shared/updateemployeeapimodel_state.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_type.rb +0 -27
- data/lib/stack_one/models/shared/updateemployeeapimodel_value.rb +0 -20
- data/lib/stack_one/models/shared/updateemployeeapimodel_work_location.rb +0 -51
data/lib/stack_one/lms.rb
CHANGED
@@ -7,6 +7,7 @@ require 'faraday'
|
|
7
7
|
require 'faraday/multipart'
|
8
8
|
require 'faraday/retry'
|
9
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
10
11
|
require_relative 'utils/retries'
|
11
12
|
|
12
13
|
module StackOne
|
@@ -21,8 +22,8 @@ module StackOne
|
|
21
22
|
end
|
22
23
|
|
23
24
|
|
24
|
-
sig { params(lms_batch_upsert_content_request_dto: ::StackOne::Shared::LmsBatchUpsertContentRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsBatchUpsertContentResponse) }
|
25
|
-
def batch_upsert_content(lms_batch_upsert_content_request_dto, x_account_id, retries = nil)
|
25
|
+
sig { params(lms_batch_upsert_content_request_dto: ::StackOne::Shared::LmsBatchUpsertContentRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsBatchUpsertContentResponse) }
|
26
|
+
def batch_upsert_content(lms_batch_upsert_content_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
26
27
|
# batch_upsert_content - Batch Upsert Content
|
27
28
|
request = ::StackOne::Operations::LmsBatchUpsertContentRequest.new(
|
28
29
|
|
@@ -36,6 +37,14 @@ module StackOne
|
|
36
37
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_batch_upsert_content_request_dto, :json)
|
37
38
|
headers['content-type'] = req_content_type
|
38
39
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
40
|
+
|
41
|
+
if form
|
42
|
+
body = Utils.encode_form(form)
|
43
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
44
|
+
body = URI.encode_www_form(data)
|
45
|
+
else
|
46
|
+
body = data
|
47
|
+
end
|
39
48
|
headers['Accept'] = 'application/json'
|
40
49
|
headers['user-agent'] = @sdk_configuration.user_agent
|
41
50
|
retries ||= @sdk_configuration.retry_config
|
@@ -52,19 +61,61 @@ module StackOne
|
|
52
61
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
53
62
|
retry_options[:retry_statuses] = [429, 408]
|
54
63
|
|
64
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
65
|
+
|
66
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
67
|
+
timeout ||= @sdk_configuration.timeout
|
68
|
+
|
55
69
|
connection = @sdk_configuration.client.dup
|
56
70
|
connection.request :retry, retry_options
|
57
71
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
72
|
+
hook_ctx = SDKHooks::HookContext.new(
|
73
|
+
base_url: base_url,
|
74
|
+
oauth2_scopes: nil,
|
75
|
+
operation_id: 'lms_batch_upsert_content',
|
76
|
+
security_source: @sdk_configuration.security_source
|
77
|
+
)
|
78
|
+
|
79
|
+
error = T.let(nil, T.nilable(StandardError))
|
80
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
81
|
+
|
82
|
+
begin
|
83
|
+
r = connection.post(url) do |req|
|
84
|
+
req.body = body
|
85
|
+
req.headers.merge!(headers)
|
86
|
+
req.options.timeout = timeout unless timeout.nil?
|
87
|
+
Utils.configure_request_security(req, security)
|
88
|
+
|
89
|
+
@sdk_configuration.hooks.before_request(
|
90
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
91
|
+
hook_ctx: hook_ctx
|
92
|
+
),
|
93
|
+
request: req
|
94
|
+
)
|
95
|
+
end
|
96
|
+
rescue StandardError => e
|
97
|
+
error = e
|
98
|
+
ensure
|
99
|
+
if r.nil? || Utils.error_status?(r.status)
|
100
|
+
r = @sdk_configuration.hooks.after_error(
|
101
|
+
error: error,
|
102
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
103
|
+
hook_ctx: hook_ctx
|
104
|
+
),
|
105
|
+
response: r
|
106
|
+
)
|
66
107
|
else
|
67
|
-
|
108
|
+
r = @sdk_configuration.hooks.after_success(
|
109
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
110
|
+
hook_ctx: hook_ctx
|
111
|
+
),
|
112
|
+
response: r
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
if r.nil?
|
117
|
+
raise error if !error.nil?
|
118
|
+
raise 'no response'
|
68
119
|
end
|
69
120
|
end
|
70
121
|
|
@@ -78,18 +129,75 @@ module StackOne
|
|
78
129
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BatchResultApiModel)
|
79
130
|
res.batch_result_api_model = out
|
80
131
|
end
|
132
|
+
elsif r.status == 400
|
133
|
+
if Utils.match_content_type(content_type, 'application/json')
|
134
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
135
|
+
res.bad_request_response = out
|
136
|
+
end
|
137
|
+
elsif r.status == 401
|
138
|
+
if Utils.match_content_type(content_type, 'application/json')
|
139
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
140
|
+
res.unauthorized_response = out
|
141
|
+
end
|
142
|
+
elsif r.status == 403
|
143
|
+
if Utils.match_content_type(content_type, 'application/json')
|
144
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
145
|
+
res.forbidden_response = out
|
146
|
+
end
|
147
|
+
elsif r.status == 404
|
148
|
+
if Utils.match_content_type(content_type, 'application/json')
|
149
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
150
|
+
res.not_found_response = out
|
151
|
+
end
|
81
152
|
elsif r.status == 408
|
82
153
|
res.headers = r.headers
|
83
|
-
|
84
|
-
|
154
|
+
if Utils.match_content_type(content_type, 'application/json')
|
155
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
156
|
+
res.request_timed_out_response = out
|
157
|
+
end
|
158
|
+
elsif r.status == 409
|
159
|
+
if Utils.match_content_type(content_type, 'application/json')
|
160
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
161
|
+
res.conflict_response = out
|
162
|
+
end
|
163
|
+
elsif r.status == 412
|
164
|
+
if Utils.match_content_type(content_type, 'application/json')
|
165
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
166
|
+
res.precondition_failed_response = out
|
167
|
+
end
|
168
|
+
elsif r.status == 422
|
169
|
+
if Utils.match_content_type(content_type, 'application/json')
|
170
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
171
|
+
res.unprocessable_entity_response = out
|
172
|
+
end
|
173
|
+
elsif r.status == 429
|
174
|
+
if Utils.match_content_type(content_type, 'application/json')
|
175
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
176
|
+
res.too_many_requests_response = out
|
177
|
+
end
|
178
|
+
elsif r.status == 500
|
179
|
+
if Utils.match_content_type(content_type, 'application/json')
|
180
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
181
|
+
res.internal_server_error_response = out
|
182
|
+
end
|
183
|
+
elsif r.status == 501
|
184
|
+
if Utils.match_content_type(content_type, 'application/json')
|
185
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
186
|
+
res.not_implemented_response = out
|
187
|
+
end
|
188
|
+
elsif r.status == 502
|
189
|
+
if Utils.match_content_type(content_type, 'application/json')
|
190
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
191
|
+
res.bad_gateway_response = out
|
192
|
+
end
|
85
193
|
end
|
86
194
|
|
87
195
|
res
|
88
196
|
end
|
89
197
|
|
90
198
|
|
91
|
-
sig { params(lms_batch_upsert_course_request_dto: ::StackOne::Shared::LmsBatchUpsertCourseRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsBatchUpsertCourseResponse) }
|
92
|
-
def batch_upsert_course(lms_batch_upsert_course_request_dto, x_account_id, retries = nil)
|
199
|
+
sig { params(lms_batch_upsert_course_request_dto: ::StackOne::Shared::LmsBatchUpsertCourseRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsBatchUpsertCourseResponse) }
|
200
|
+
def batch_upsert_course(lms_batch_upsert_course_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
93
201
|
# batch_upsert_course - Batch Upsert Course
|
94
202
|
request = ::StackOne::Operations::LmsBatchUpsertCourseRequest.new(
|
95
203
|
|
@@ -103,6 +211,14 @@ module StackOne
|
|
103
211
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_batch_upsert_course_request_dto, :json)
|
104
212
|
headers['content-type'] = req_content_type
|
105
213
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
214
|
+
|
215
|
+
if form
|
216
|
+
body = Utils.encode_form(form)
|
217
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
218
|
+
body = URI.encode_www_form(data)
|
219
|
+
else
|
220
|
+
body = data
|
221
|
+
end
|
106
222
|
headers['Accept'] = 'application/json'
|
107
223
|
headers['user-agent'] = @sdk_configuration.user_agent
|
108
224
|
retries ||= @sdk_configuration.retry_config
|
@@ -119,19 +235,61 @@ module StackOne
|
|
119
235
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
120
236
|
retry_options[:retry_statuses] = [429, 408]
|
121
237
|
|
238
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
239
|
+
|
240
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
241
|
+
timeout ||= @sdk_configuration.timeout
|
242
|
+
|
122
243
|
connection = @sdk_configuration.client.dup
|
123
244
|
connection.request :retry, retry_options
|
124
245
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
246
|
+
hook_ctx = SDKHooks::HookContext.new(
|
247
|
+
base_url: base_url,
|
248
|
+
oauth2_scopes: nil,
|
249
|
+
operation_id: 'lms_batch_upsert_course',
|
250
|
+
security_source: @sdk_configuration.security_source
|
251
|
+
)
|
252
|
+
|
253
|
+
error = T.let(nil, T.nilable(StandardError))
|
254
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
255
|
+
|
256
|
+
begin
|
257
|
+
r = connection.post(url) do |req|
|
258
|
+
req.body = body
|
259
|
+
req.headers.merge!(headers)
|
260
|
+
req.options.timeout = timeout unless timeout.nil?
|
261
|
+
Utils.configure_request_security(req, security)
|
262
|
+
|
263
|
+
@sdk_configuration.hooks.before_request(
|
264
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
265
|
+
hook_ctx: hook_ctx
|
266
|
+
),
|
267
|
+
request: req
|
268
|
+
)
|
269
|
+
end
|
270
|
+
rescue StandardError => e
|
271
|
+
error = e
|
272
|
+
ensure
|
273
|
+
if r.nil? || Utils.error_status?(r.status)
|
274
|
+
r = @sdk_configuration.hooks.after_error(
|
275
|
+
error: error,
|
276
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
277
|
+
hook_ctx: hook_ctx
|
278
|
+
),
|
279
|
+
response: r
|
280
|
+
)
|
133
281
|
else
|
134
|
-
|
282
|
+
r = @sdk_configuration.hooks.after_success(
|
283
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
284
|
+
hook_ctx: hook_ctx
|
285
|
+
),
|
286
|
+
response: r
|
287
|
+
)
|
288
|
+
end
|
289
|
+
|
290
|
+
if r.nil?
|
291
|
+
raise error if !error.nil?
|
292
|
+
raise 'no response'
|
135
293
|
end
|
136
294
|
end
|
137
295
|
|
@@ -145,18 +303,75 @@ module StackOne
|
|
145
303
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BatchResultApiModel)
|
146
304
|
res.batch_result_api_model = out
|
147
305
|
end
|
306
|
+
elsif r.status == 400
|
307
|
+
if Utils.match_content_type(content_type, 'application/json')
|
308
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
309
|
+
res.bad_request_response = out
|
310
|
+
end
|
311
|
+
elsif r.status == 401
|
312
|
+
if Utils.match_content_type(content_type, 'application/json')
|
313
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
314
|
+
res.unauthorized_response = out
|
315
|
+
end
|
316
|
+
elsif r.status == 403
|
317
|
+
if Utils.match_content_type(content_type, 'application/json')
|
318
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
319
|
+
res.forbidden_response = out
|
320
|
+
end
|
321
|
+
elsif r.status == 404
|
322
|
+
if Utils.match_content_type(content_type, 'application/json')
|
323
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
324
|
+
res.not_found_response = out
|
325
|
+
end
|
148
326
|
elsif r.status == 408
|
149
327
|
res.headers = r.headers
|
150
|
-
|
151
|
-
|
328
|
+
if Utils.match_content_type(content_type, 'application/json')
|
329
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
330
|
+
res.request_timed_out_response = out
|
331
|
+
end
|
332
|
+
elsif r.status == 409
|
333
|
+
if Utils.match_content_type(content_type, 'application/json')
|
334
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
335
|
+
res.conflict_response = out
|
336
|
+
end
|
337
|
+
elsif r.status == 412
|
338
|
+
if Utils.match_content_type(content_type, 'application/json')
|
339
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
340
|
+
res.precondition_failed_response = out
|
341
|
+
end
|
342
|
+
elsif r.status == 422
|
343
|
+
if Utils.match_content_type(content_type, 'application/json')
|
344
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
345
|
+
res.unprocessable_entity_response = out
|
346
|
+
end
|
347
|
+
elsif r.status == 429
|
348
|
+
if Utils.match_content_type(content_type, 'application/json')
|
349
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
350
|
+
res.too_many_requests_response = out
|
351
|
+
end
|
352
|
+
elsif r.status == 500
|
353
|
+
if Utils.match_content_type(content_type, 'application/json')
|
354
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
355
|
+
res.internal_server_error_response = out
|
356
|
+
end
|
357
|
+
elsif r.status == 501
|
358
|
+
if Utils.match_content_type(content_type, 'application/json')
|
359
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
360
|
+
res.not_implemented_response = out
|
361
|
+
end
|
362
|
+
elsif r.status == 502
|
363
|
+
if Utils.match_content_type(content_type, 'application/json')
|
364
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
365
|
+
res.bad_gateway_response = out
|
366
|
+
end
|
152
367
|
end
|
153
368
|
|
154
369
|
res
|
155
370
|
end
|
156
371
|
|
157
372
|
|
158
|
-
sig { params(lms_create_collection_request_dto: ::StackOne::Shared::LmsCreateCollectionRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsCreateCollectionResponse) }
|
159
|
-
def create_collection(lms_create_collection_request_dto, x_account_id, retries = nil)
|
373
|
+
sig { params(lms_create_collection_request_dto: ::StackOne::Shared::LmsCreateCollectionRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsCreateCollectionResponse) }
|
374
|
+
def create_collection(lms_create_collection_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
160
375
|
# create_collection - Create Collection
|
161
376
|
request = ::StackOne::Operations::LmsCreateCollectionRequest.new(
|
162
377
|
|
@@ -170,6 +385,14 @@ module StackOne
|
|
170
385
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_collection_request_dto, :json)
|
171
386
|
headers['content-type'] = req_content_type
|
172
387
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
388
|
+
|
389
|
+
if form
|
390
|
+
body = Utils.encode_form(form)
|
391
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
392
|
+
body = URI.encode_www_form(data)
|
393
|
+
else
|
394
|
+
body = data
|
395
|
+
end
|
173
396
|
headers['Accept'] = 'application/json'
|
174
397
|
headers['user-agent'] = @sdk_configuration.user_agent
|
175
398
|
retries ||= @sdk_configuration.retry_config
|
@@ -186,19 +409,61 @@ module StackOne
|
|
186
409
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
187
410
|
retry_options[:retry_statuses] = [429, 408]
|
188
411
|
|
412
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
413
|
+
|
414
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
415
|
+
timeout ||= @sdk_configuration.timeout
|
416
|
+
|
189
417
|
connection = @sdk_configuration.client.dup
|
190
418
|
connection.request :retry, retry_options
|
191
419
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
420
|
+
hook_ctx = SDKHooks::HookContext.new(
|
421
|
+
base_url: base_url,
|
422
|
+
oauth2_scopes: nil,
|
423
|
+
operation_id: 'lms_create_collection',
|
424
|
+
security_source: @sdk_configuration.security_source
|
425
|
+
)
|
426
|
+
|
427
|
+
error = T.let(nil, T.nilable(StandardError))
|
428
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
429
|
+
|
430
|
+
begin
|
431
|
+
r = connection.post(url) do |req|
|
432
|
+
req.body = body
|
433
|
+
req.headers.merge!(headers)
|
434
|
+
req.options.timeout = timeout unless timeout.nil?
|
435
|
+
Utils.configure_request_security(req, security)
|
436
|
+
|
437
|
+
@sdk_configuration.hooks.before_request(
|
438
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
439
|
+
hook_ctx: hook_ctx
|
440
|
+
),
|
441
|
+
request: req
|
442
|
+
)
|
443
|
+
end
|
444
|
+
rescue StandardError => e
|
445
|
+
error = e
|
446
|
+
ensure
|
447
|
+
if r.nil? || Utils.error_status?(r.status)
|
448
|
+
r = @sdk_configuration.hooks.after_error(
|
449
|
+
error: error,
|
450
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
451
|
+
hook_ctx: hook_ctx
|
452
|
+
),
|
453
|
+
response: r
|
454
|
+
)
|
200
455
|
else
|
201
|
-
|
456
|
+
r = @sdk_configuration.hooks.after_success(
|
457
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
458
|
+
hook_ctx: hook_ctx
|
459
|
+
),
|
460
|
+
response: r
|
461
|
+
)
|
462
|
+
end
|
463
|
+
|
464
|
+
if r.nil?
|
465
|
+
raise error if !error.nil?
|
466
|
+
raise 'no response'
|
202
467
|
end
|
203
468
|
end
|
204
469
|
|
@@ -212,18 +477,75 @@ module StackOne
|
|
212
477
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
213
478
|
res.create_result = out
|
214
479
|
end
|
480
|
+
elsif r.status == 400
|
481
|
+
if Utils.match_content_type(content_type, 'application/json')
|
482
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
483
|
+
res.bad_request_response = out
|
484
|
+
end
|
485
|
+
elsif r.status == 401
|
486
|
+
if Utils.match_content_type(content_type, 'application/json')
|
487
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
488
|
+
res.unauthorized_response = out
|
489
|
+
end
|
490
|
+
elsif r.status == 403
|
491
|
+
if Utils.match_content_type(content_type, 'application/json')
|
492
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
493
|
+
res.forbidden_response = out
|
494
|
+
end
|
495
|
+
elsif r.status == 404
|
496
|
+
if Utils.match_content_type(content_type, 'application/json')
|
497
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
498
|
+
res.not_found_response = out
|
499
|
+
end
|
215
500
|
elsif r.status == 408
|
216
501
|
res.headers = r.headers
|
217
|
-
|
218
|
-
|
502
|
+
if Utils.match_content_type(content_type, 'application/json')
|
503
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
504
|
+
res.request_timed_out_response = out
|
505
|
+
end
|
506
|
+
elsif r.status == 409
|
507
|
+
if Utils.match_content_type(content_type, 'application/json')
|
508
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
509
|
+
res.conflict_response = out
|
510
|
+
end
|
511
|
+
elsif r.status == 412
|
512
|
+
if Utils.match_content_type(content_type, 'application/json')
|
513
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
514
|
+
res.precondition_failed_response = out
|
515
|
+
end
|
516
|
+
elsif r.status == 422
|
517
|
+
if Utils.match_content_type(content_type, 'application/json')
|
518
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
519
|
+
res.unprocessable_entity_response = out
|
520
|
+
end
|
521
|
+
elsif r.status == 429
|
522
|
+
if Utils.match_content_type(content_type, 'application/json')
|
523
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
524
|
+
res.too_many_requests_response = out
|
525
|
+
end
|
526
|
+
elsif r.status == 500
|
527
|
+
if Utils.match_content_type(content_type, 'application/json')
|
528
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
529
|
+
res.internal_server_error_response = out
|
530
|
+
end
|
531
|
+
elsif r.status == 501
|
532
|
+
if Utils.match_content_type(content_type, 'application/json')
|
533
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
534
|
+
res.not_implemented_response = out
|
535
|
+
end
|
536
|
+
elsif r.status == 502
|
537
|
+
if Utils.match_content_type(content_type, 'application/json')
|
538
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
539
|
+
res.bad_gateway_response = out
|
540
|
+
end
|
219
541
|
end
|
220
542
|
|
221
543
|
res
|
222
544
|
end
|
223
545
|
|
224
546
|
|
225
|
-
sig { params(lms_create_assignment_request_dto: ::StackOne::Shared::LmsCreateAssignmentRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsCreateUserAssignmentResponse) }
|
226
|
-
def create_user_assignment(lms_create_assignment_request_dto, id, x_account_id, retries = nil)
|
547
|
+
sig { params(lms_create_assignment_request_dto: ::StackOne::Shared::LmsCreateAssignmentRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsCreateUserAssignmentResponse) }
|
548
|
+
def create_user_assignment(lms_create_assignment_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
227
549
|
# create_user_assignment - Create User Assignment
|
228
550
|
request = ::StackOne::Operations::LmsCreateUserAssignmentRequest.new(
|
229
551
|
|
@@ -243,6 +565,14 @@ module StackOne
|
|
243
565
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_assignment_request_dto, :json)
|
244
566
|
headers['content-type'] = req_content_type
|
245
567
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
568
|
+
|
569
|
+
if form
|
570
|
+
body = Utils.encode_form(form)
|
571
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
572
|
+
body = URI.encode_www_form(data)
|
573
|
+
else
|
574
|
+
body = data
|
575
|
+
end
|
246
576
|
headers['Accept'] = 'application/json'
|
247
577
|
headers['user-agent'] = @sdk_configuration.user_agent
|
248
578
|
retries ||= @sdk_configuration.retry_config
|
@@ -259,19 +589,61 @@ module StackOne
|
|
259
589
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
260
590
|
retry_options[:retry_statuses] = [429, 408]
|
261
591
|
|
592
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
593
|
+
|
594
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
595
|
+
timeout ||= @sdk_configuration.timeout
|
596
|
+
|
262
597
|
connection = @sdk_configuration.client.dup
|
263
598
|
connection.request :retry, retry_options
|
264
599
|
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
600
|
+
hook_ctx = SDKHooks::HookContext.new(
|
601
|
+
base_url: base_url,
|
602
|
+
oauth2_scopes: nil,
|
603
|
+
operation_id: 'lms_create_user_assignment',
|
604
|
+
security_source: @sdk_configuration.security_source
|
605
|
+
)
|
606
|
+
|
607
|
+
error = T.let(nil, T.nilable(StandardError))
|
608
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
609
|
+
|
610
|
+
begin
|
611
|
+
r = connection.post(url) do |req|
|
612
|
+
req.body = body
|
613
|
+
req.headers.merge!(headers)
|
614
|
+
req.options.timeout = timeout unless timeout.nil?
|
615
|
+
Utils.configure_request_security(req, security)
|
616
|
+
|
617
|
+
@sdk_configuration.hooks.before_request(
|
618
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
619
|
+
hook_ctx: hook_ctx
|
620
|
+
),
|
621
|
+
request: req
|
622
|
+
)
|
623
|
+
end
|
624
|
+
rescue StandardError => e
|
625
|
+
error = e
|
626
|
+
ensure
|
627
|
+
if r.nil? || Utils.error_status?(r.status)
|
628
|
+
r = @sdk_configuration.hooks.after_error(
|
629
|
+
error: error,
|
630
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
631
|
+
hook_ctx: hook_ctx
|
632
|
+
),
|
633
|
+
response: r
|
634
|
+
)
|
273
635
|
else
|
274
|
-
|
636
|
+
r = @sdk_configuration.hooks.after_success(
|
637
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
638
|
+
hook_ctx: hook_ctx
|
639
|
+
),
|
640
|
+
response: r
|
641
|
+
)
|
642
|
+
end
|
643
|
+
|
644
|
+
if r.nil?
|
645
|
+
raise error if !error.nil?
|
646
|
+
raise 'no response'
|
275
647
|
end
|
276
648
|
end
|
277
649
|
|
@@ -285,18 +657,75 @@ module StackOne
|
|
285
657
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
286
658
|
res.create_result = out
|
287
659
|
end
|
660
|
+
elsif r.status == 400
|
661
|
+
if Utils.match_content_type(content_type, 'application/json')
|
662
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
663
|
+
res.bad_request_response = out
|
664
|
+
end
|
665
|
+
elsif r.status == 401
|
666
|
+
if Utils.match_content_type(content_type, 'application/json')
|
667
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
668
|
+
res.unauthorized_response = out
|
669
|
+
end
|
670
|
+
elsif r.status == 403
|
671
|
+
if Utils.match_content_type(content_type, 'application/json')
|
672
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
673
|
+
res.forbidden_response = out
|
674
|
+
end
|
675
|
+
elsif r.status == 404
|
676
|
+
if Utils.match_content_type(content_type, 'application/json')
|
677
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
678
|
+
res.not_found_response = out
|
679
|
+
end
|
288
680
|
elsif r.status == 408
|
289
681
|
res.headers = r.headers
|
290
|
-
|
291
|
-
|
682
|
+
if Utils.match_content_type(content_type, 'application/json')
|
683
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
684
|
+
res.request_timed_out_response = out
|
685
|
+
end
|
686
|
+
elsif r.status == 409
|
687
|
+
if Utils.match_content_type(content_type, 'application/json')
|
688
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
689
|
+
res.conflict_response = out
|
690
|
+
end
|
691
|
+
elsif r.status == 412
|
692
|
+
if Utils.match_content_type(content_type, 'application/json')
|
693
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
694
|
+
res.precondition_failed_response = out
|
695
|
+
end
|
696
|
+
elsif r.status == 422
|
697
|
+
if Utils.match_content_type(content_type, 'application/json')
|
698
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
699
|
+
res.unprocessable_entity_response = out
|
700
|
+
end
|
701
|
+
elsif r.status == 429
|
702
|
+
if Utils.match_content_type(content_type, 'application/json')
|
703
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
704
|
+
res.too_many_requests_response = out
|
705
|
+
end
|
706
|
+
elsif r.status == 500
|
707
|
+
if Utils.match_content_type(content_type, 'application/json')
|
708
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
709
|
+
res.internal_server_error_response = out
|
710
|
+
end
|
711
|
+
elsif r.status == 501
|
712
|
+
if Utils.match_content_type(content_type, 'application/json')
|
713
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
714
|
+
res.not_implemented_response = out
|
715
|
+
end
|
716
|
+
elsif r.status == 502
|
717
|
+
if Utils.match_content_type(content_type, 'application/json')
|
718
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
719
|
+
res.bad_gateway_response = out
|
720
|
+
end
|
292
721
|
end
|
293
722
|
|
294
723
|
res
|
295
724
|
end
|
296
725
|
|
297
726
|
|
298
|
-
sig { params(lms_create_completion_request_dto: ::StackOne::Shared::LmsCreateCompletionRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsCreateUserCompletionResponse) }
|
299
|
-
def create_user_completion(lms_create_completion_request_dto, id, x_account_id, retries = nil)
|
727
|
+
sig { params(lms_create_completion_request_dto: ::StackOne::Shared::LmsCreateCompletionRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsCreateUserCompletionResponse) }
|
728
|
+
def create_user_completion(lms_create_completion_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
300
729
|
# create_user_completion - Create User Completion
|
301
730
|
request = ::StackOne::Operations::LmsCreateUserCompletionRequest.new(
|
302
731
|
|
@@ -316,6 +745,14 @@ module StackOne
|
|
316
745
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_completion_request_dto, :json)
|
317
746
|
headers['content-type'] = req_content_type
|
318
747
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
748
|
+
|
749
|
+
if form
|
750
|
+
body = Utils.encode_form(form)
|
751
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
752
|
+
body = URI.encode_www_form(data)
|
753
|
+
else
|
754
|
+
body = data
|
755
|
+
end
|
319
756
|
headers['Accept'] = 'application/json'
|
320
757
|
headers['user-agent'] = @sdk_configuration.user_agent
|
321
758
|
retries ||= @sdk_configuration.retry_config
|
@@ -332,19 +769,61 @@ module StackOne
|
|
332
769
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
333
770
|
retry_options[:retry_statuses] = [429, 408]
|
334
771
|
|
772
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
773
|
+
|
774
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
775
|
+
timeout ||= @sdk_configuration.timeout
|
776
|
+
|
335
777
|
connection = @sdk_configuration.client.dup
|
336
778
|
connection.request :retry, retry_options
|
337
779
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
780
|
+
hook_ctx = SDKHooks::HookContext.new(
|
781
|
+
base_url: base_url,
|
782
|
+
oauth2_scopes: nil,
|
783
|
+
operation_id: 'lms_create_user_completion',
|
784
|
+
security_source: @sdk_configuration.security_source
|
785
|
+
)
|
786
|
+
|
787
|
+
error = T.let(nil, T.nilable(StandardError))
|
788
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
789
|
+
|
790
|
+
begin
|
791
|
+
r = connection.post(url) do |req|
|
792
|
+
req.body = body
|
793
|
+
req.headers.merge!(headers)
|
794
|
+
req.options.timeout = timeout unless timeout.nil?
|
795
|
+
Utils.configure_request_security(req, security)
|
796
|
+
|
797
|
+
@sdk_configuration.hooks.before_request(
|
798
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
799
|
+
hook_ctx: hook_ctx
|
800
|
+
),
|
801
|
+
request: req
|
802
|
+
)
|
803
|
+
end
|
804
|
+
rescue StandardError => e
|
805
|
+
error = e
|
806
|
+
ensure
|
807
|
+
if r.nil? || Utils.error_status?(r.status)
|
808
|
+
r = @sdk_configuration.hooks.after_error(
|
809
|
+
error: error,
|
810
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
811
|
+
hook_ctx: hook_ctx
|
812
|
+
),
|
813
|
+
response: r
|
814
|
+
)
|
346
815
|
else
|
347
|
-
|
816
|
+
r = @sdk_configuration.hooks.after_success(
|
817
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
818
|
+
hook_ctx: hook_ctx
|
819
|
+
),
|
820
|
+
response: r
|
821
|
+
)
|
822
|
+
end
|
823
|
+
|
824
|
+
if r.nil?
|
825
|
+
raise error if !error.nil?
|
826
|
+
raise 'no response'
|
348
827
|
end
|
349
828
|
end
|
350
829
|
|
@@ -358,18 +837,75 @@ module StackOne
|
|
358
837
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CreateResult)
|
359
838
|
res.create_result = out
|
360
839
|
end
|
840
|
+
elsif r.status == 400
|
841
|
+
if Utils.match_content_type(content_type, 'application/json')
|
842
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
843
|
+
res.bad_request_response = out
|
844
|
+
end
|
845
|
+
elsif r.status == 401
|
846
|
+
if Utils.match_content_type(content_type, 'application/json')
|
847
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
848
|
+
res.unauthorized_response = out
|
849
|
+
end
|
850
|
+
elsif r.status == 403
|
851
|
+
if Utils.match_content_type(content_type, 'application/json')
|
852
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
853
|
+
res.forbidden_response = out
|
854
|
+
end
|
855
|
+
elsif r.status == 404
|
856
|
+
if Utils.match_content_type(content_type, 'application/json')
|
857
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
858
|
+
res.not_found_response = out
|
859
|
+
end
|
361
860
|
elsif r.status == 408
|
362
861
|
res.headers = r.headers
|
363
|
-
|
364
|
-
|
862
|
+
if Utils.match_content_type(content_type, 'application/json')
|
863
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
864
|
+
res.request_timed_out_response = out
|
865
|
+
end
|
866
|
+
elsif r.status == 409
|
867
|
+
if Utils.match_content_type(content_type, 'application/json')
|
868
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
869
|
+
res.conflict_response = out
|
870
|
+
end
|
871
|
+
elsif r.status == 412
|
872
|
+
if Utils.match_content_type(content_type, 'application/json')
|
873
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
874
|
+
res.precondition_failed_response = out
|
875
|
+
end
|
876
|
+
elsif r.status == 422
|
877
|
+
if Utils.match_content_type(content_type, 'application/json')
|
878
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
879
|
+
res.unprocessable_entity_response = out
|
880
|
+
end
|
881
|
+
elsif r.status == 429
|
882
|
+
if Utils.match_content_type(content_type, 'application/json')
|
883
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
884
|
+
res.too_many_requests_response = out
|
885
|
+
end
|
886
|
+
elsif r.status == 500
|
887
|
+
if Utils.match_content_type(content_type, 'application/json')
|
888
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
889
|
+
res.internal_server_error_response = out
|
890
|
+
end
|
891
|
+
elsif r.status == 501
|
892
|
+
if Utils.match_content_type(content_type, 'application/json')
|
893
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
894
|
+
res.not_implemented_response = out
|
895
|
+
end
|
896
|
+
elsif r.status == 502
|
897
|
+
if Utils.match_content_type(content_type, 'application/json')
|
898
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
899
|
+
res.bad_gateway_response = out
|
900
|
+
end
|
365
901
|
end
|
366
902
|
|
367
903
|
res
|
368
904
|
end
|
369
905
|
|
370
906
|
|
371
|
-
sig { params(id: ::String, sub_resource_id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsDeleteUserCompletionResponse) }
|
372
|
-
def delete_user_completion(id, sub_resource_id, x_account_id, retries = nil)
|
907
|
+
sig { params(id: ::String, sub_resource_id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsDeleteUserCompletionResponse) }
|
908
|
+
def delete_user_completion(id, sub_resource_id, x_account_id, retries = nil, timeout_ms = nil)
|
373
909
|
# delete_user_completion - Delete User Completion
|
374
910
|
request = ::StackOne::Operations::LmsDeleteUserCompletionRequest.new(
|
375
911
|
|
@@ -402,13 +938,61 @@ module StackOne
|
|
402
938
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
403
939
|
retry_options[:retry_statuses] = [429, 408]
|
404
940
|
|
941
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
942
|
+
|
943
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
944
|
+
timeout ||= @sdk_configuration.timeout
|
945
|
+
|
405
946
|
connection = @sdk_configuration.client.dup
|
406
947
|
connection.request :retry, retry_options
|
407
948
|
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
949
|
+
hook_ctx = SDKHooks::HookContext.new(
|
950
|
+
base_url: base_url,
|
951
|
+
oauth2_scopes: nil,
|
952
|
+
operation_id: 'lms_delete_user_completion',
|
953
|
+
security_source: @sdk_configuration.security_source
|
954
|
+
)
|
955
|
+
|
956
|
+
error = T.let(nil, T.nilable(StandardError))
|
957
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
958
|
+
|
959
|
+
begin
|
960
|
+
r = connection.delete(url) do |req|
|
961
|
+
req.headers.merge!(headers)
|
962
|
+
req.options.timeout = timeout unless timeout.nil?
|
963
|
+
Utils.configure_request_security(req, security)
|
964
|
+
|
965
|
+
@sdk_configuration.hooks.before_request(
|
966
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
967
|
+
hook_ctx: hook_ctx
|
968
|
+
),
|
969
|
+
request: req
|
970
|
+
)
|
971
|
+
end
|
972
|
+
rescue StandardError => e
|
973
|
+
error = e
|
974
|
+
ensure
|
975
|
+
if r.nil? || Utils.error_status?(r.status)
|
976
|
+
r = @sdk_configuration.hooks.after_error(
|
977
|
+
error: error,
|
978
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
979
|
+
hook_ctx: hook_ctx
|
980
|
+
),
|
981
|
+
response: r
|
982
|
+
)
|
983
|
+
else
|
984
|
+
r = @sdk_configuration.hooks.after_success(
|
985
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
986
|
+
hook_ctx: hook_ctx
|
987
|
+
),
|
988
|
+
response: r
|
989
|
+
)
|
990
|
+
end
|
991
|
+
|
992
|
+
if r.nil?
|
993
|
+
raise error if !error.nil?
|
994
|
+
raise 'no response'
|
995
|
+
end
|
412
996
|
end
|
413
997
|
|
414
998
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -422,18 +1006,75 @@ module StackOne
|
|
422
1006
|
res.delete_result = out
|
423
1007
|
end
|
424
1008
|
elsif r.status == 204
|
1009
|
+
elsif r.status == 400
|
1010
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1011
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1012
|
+
res.bad_request_response = out
|
1013
|
+
end
|
1014
|
+
elsif r.status == 401
|
1015
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1016
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1017
|
+
res.unauthorized_response = out
|
1018
|
+
end
|
1019
|
+
elsif r.status == 403
|
1020
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1021
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1022
|
+
res.forbidden_response = out
|
1023
|
+
end
|
1024
|
+
elsif r.status == 404
|
1025
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1026
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1027
|
+
res.not_found_response = out
|
1028
|
+
end
|
425
1029
|
elsif r.status == 408
|
426
1030
|
res.headers = r.headers
|
427
|
-
|
428
|
-
|
1031
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1032
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1033
|
+
res.request_timed_out_response = out
|
1034
|
+
end
|
1035
|
+
elsif r.status == 409
|
1036
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1037
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1038
|
+
res.conflict_response = out
|
1039
|
+
end
|
1040
|
+
elsif r.status == 412
|
1041
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1042
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1043
|
+
res.precondition_failed_response = out
|
1044
|
+
end
|
1045
|
+
elsif r.status == 422
|
1046
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1047
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1048
|
+
res.unprocessable_entity_response = out
|
1049
|
+
end
|
1050
|
+
elsif r.status == 429
|
1051
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1052
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1053
|
+
res.too_many_requests_response = out
|
1054
|
+
end
|
1055
|
+
elsif r.status == 500
|
1056
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1057
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1058
|
+
res.internal_server_error_response = out
|
1059
|
+
end
|
1060
|
+
elsif r.status == 501
|
1061
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1062
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1063
|
+
res.not_implemented_response = out
|
1064
|
+
end
|
1065
|
+
elsif r.status == 502
|
1066
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1067
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1068
|
+
res.bad_gateway_response = out
|
1069
|
+
end
|
429
1070
|
end
|
430
1071
|
|
431
1072
|
res
|
432
1073
|
end
|
433
1074
|
|
434
1075
|
|
435
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetAssignmentRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetAssignmentResponse) }
|
436
|
-
def get_assignment(request, retries = nil)
|
1076
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetAssignmentResponse) }
|
1077
|
+
def get_assignment(request, retries = nil, timeout_ms = nil)
|
437
1078
|
# get_assignment - Get Assignment
|
438
1079
|
url, params = @sdk_configuration.get_server_details
|
439
1080
|
base_url = Utils.template_url(url, params)
|
@@ -461,14 +1102,62 @@ module StackOne
|
|
461
1102
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
462
1103
|
retry_options[:retry_statuses] = [429, 408]
|
463
1104
|
|
1105
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1106
|
+
|
1107
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1108
|
+
timeout ||= @sdk_configuration.timeout
|
1109
|
+
|
464
1110
|
connection = @sdk_configuration.client.dup
|
465
1111
|
connection.request :retry, retry_options
|
466
1112
|
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
1113
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1114
|
+
base_url: base_url,
|
1115
|
+
oauth2_scopes: nil,
|
1116
|
+
operation_id: 'lms_get_assignment',
|
1117
|
+
security_source: @sdk_configuration.security_source
|
1118
|
+
)
|
1119
|
+
|
1120
|
+
error = T.let(nil, T.nilable(StandardError))
|
1121
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1122
|
+
|
1123
|
+
begin
|
1124
|
+
r = connection.get(url) do |req|
|
1125
|
+
req.headers.merge!(headers)
|
1126
|
+
req.options.timeout = timeout unless timeout.nil?
|
1127
|
+
req.params = query_params
|
1128
|
+
Utils.configure_request_security(req, security)
|
1129
|
+
|
1130
|
+
@sdk_configuration.hooks.before_request(
|
1131
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1132
|
+
hook_ctx: hook_ctx
|
1133
|
+
),
|
1134
|
+
request: req
|
1135
|
+
)
|
1136
|
+
end
|
1137
|
+
rescue StandardError => e
|
1138
|
+
error = e
|
1139
|
+
ensure
|
1140
|
+
if r.nil? || Utils.error_status?(r.status)
|
1141
|
+
r = @sdk_configuration.hooks.after_error(
|
1142
|
+
error: error,
|
1143
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1144
|
+
hook_ctx: hook_ctx
|
1145
|
+
),
|
1146
|
+
response: r
|
1147
|
+
)
|
1148
|
+
else
|
1149
|
+
r = @sdk_configuration.hooks.after_success(
|
1150
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1151
|
+
hook_ctx: hook_ctx
|
1152
|
+
),
|
1153
|
+
response: r
|
1154
|
+
)
|
1155
|
+
end
|
1156
|
+
|
1157
|
+
if r.nil?
|
1158
|
+
raise error if !error.nil?
|
1159
|
+
raise 'no response'
|
1160
|
+
end
|
472
1161
|
end
|
473
1162
|
|
474
1163
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -481,18 +1170,75 @@ module StackOne
|
|
481
1170
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::AssignmentResult)
|
482
1171
|
res.assignment_result = out
|
483
1172
|
end
|
1173
|
+
elsif r.status == 400
|
1174
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1175
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1176
|
+
res.bad_request_response = out
|
1177
|
+
end
|
1178
|
+
elsif r.status == 401
|
1179
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1180
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1181
|
+
res.unauthorized_response = out
|
1182
|
+
end
|
1183
|
+
elsif r.status == 403
|
1184
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1185
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1186
|
+
res.forbidden_response = out
|
1187
|
+
end
|
1188
|
+
elsif r.status == 404
|
1189
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1190
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1191
|
+
res.not_found_response = out
|
1192
|
+
end
|
484
1193
|
elsif r.status == 408
|
485
1194
|
res.headers = r.headers
|
486
|
-
|
487
|
-
|
1195
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1196
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1197
|
+
res.request_timed_out_response = out
|
1198
|
+
end
|
1199
|
+
elsif r.status == 409
|
1200
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1201
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1202
|
+
res.conflict_response = out
|
1203
|
+
end
|
1204
|
+
elsif r.status == 412
|
1205
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1206
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1207
|
+
res.precondition_failed_response = out
|
1208
|
+
end
|
1209
|
+
elsif r.status == 422
|
1210
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1211
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1212
|
+
res.unprocessable_entity_response = out
|
1213
|
+
end
|
1214
|
+
elsif r.status == 429
|
1215
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1216
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1217
|
+
res.too_many_requests_response = out
|
1218
|
+
end
|
1219
|
+
elsif r.status == 500
|
1220
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1221
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1222
|
+
res.internal_server_error_response = out
|
1223
|
+
end
|
1224
|
+
elsif r.status == 501
|
1225
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1226
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1227
|
+
res.not_implemented_response = out
|
1228
|
+
end
|
1229
|
+
elsif r.status == 502
|
1230
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1231
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1232
|
+
res.bad_gateway_response = out
|
1233
|
+
end
|
488
1234
|
end
|
489
1235
|
|
490
1236
|
res
|
491
1237
|
end
|
492
1238
|
|
493
1239
|
|
494
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCategoryRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetCategoryResponse) }
|
495
|
-
def get_category(request, retries = nil)
|
1240
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCategoryRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetCategoryResponse) }
|
1241
|
+
def get_category(request, retries = nil, timeout_ms = nil)
|
496
1242
|
# get_category - Get Category
|
497
1243
|
url, params = @sdk_configuration.get_server_details
|
498
1244
|
base_url = Utils.template_url(url, params)
|
@@ -520,14 +1266,62 @@ module StackOne
|
|
520
1266
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
521
1267
|
retry_options[:retry_statuses] = [429, 408]
|
522
1268
|
|
1269
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1270
|
+
|
1271
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1272
|
+
timeout ||= @sdk_configuration.timeout
|
1273
|
+
|
523
1274
|
connection = @sdk_configuration.client.dup
|
524
1275
|
connection.request :retry, retry_options
|
525
1276
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
1277
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1278
|
+
base_url: base_url,
|
1279
|
+
oauth2_scopes: nil,
|
1280
|
+
operation_id: 'lms_get_category',
|
1281
|
+
security_source: @sdk_configuration.security_source
|
1282
|
+
)
|
1283
|
+
|
1284
|
+
error = T.let(nil, T.nilable(StandardError))
|
1285
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1286
|
+
|
1287
|
+
begin
|
1288
|
+
r = connection.get(url) do |req|
|
1289
|
+
req.headers.merge!(headers)
|
1290
|
+
req.options.timeout = timeout unless timeout.nil?
|
1291
|
+
req.params = query_params
|
1292
|
+
Utils.configure_request_security(req, security)
|
1293
|
+
|
1294
|
+
@sdk_configuration.hooks.before_request(
|
1295
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1296
|
+
hook_ctx: hook_ctx
|
1297
|
+
),
|
1298
|
+
request: req
|
1299
|
+
)
|
1300
|
+
end
|
1301
|
+
rescue StandardError => e
|
1302
|
+
error = e
|
1303
|
+
ensure
|
1304
|
+
if r.nil? || Utils.error_status?(r.status)
|
1305
|
+
r = @sdk_configuration.hooks.after_error(
|
1306
|
+
error: error,
|
1307
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1308
|
+
hook_ctx: hook_ctx
|
1309
|
+
),
|
1310
|
+
response: r
|
1311
|
+
)
|
1312
|
+
else
|
1313
|
+
r = @sdk_configuration.hooks.after_success(
|
1314
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1315
|
+
hook_ctx: hook_ctx
|
1316
|
+
),
|
1317
|
+
response: r
|
1318
|
+
)
|
1319
|
+
end
|
1320
|
+
|
1321
|
+
if r.nil?
|
1322
|
+
raise error if !error.nil?
|
1323
|
+
raise 'no response'
|
1324
|
+
end
|
531
1325
|
end
|
532
1326
|
|
533
1327
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -540,20 +1334,77 @@ module StackOne
|
|
540
1334
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CategoryResult)
|
541
1335
|
res.category_result = out
|
542
1336
|
end
|
1337
|
+
elsif r.status == 400
|
1338
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1339
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1340
|
+
res.bad_request_response = out
|
1341
|
+
end
|
1342
|
+
elsif r.status == 401
|
1343
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1344
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1345
|
+
res.unauthorized_response = out
|
1346
|
+
end
|
1347
|
+
elsif r.status == 403
|
1348
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1349
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1350
|
+
res.forbidden_response = out
|
1351
|
+
end
|
1352
|
+
elsif r.status == 404
|
1353
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1354
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1355
|
+
res.not_found_response = out
|
1356
|
+
end
|
543
1357
|
elsif r.status == 408
|
544
1358
|
res.headers = r.headers
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
1359
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1360
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1361
|
+
res.request_timed_out_response = out
|
1362
|
+
end
|
1363
|
+
elsif r.status == 409
|
1364
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1365
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1366
|
+
res.conflict_response = out
|
1367
|
+
end
|
1368
|
+
elsif r.status == 412
|
1369
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1370
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1371
|
+
res.precondition_failed_response = out
|
1372
|
+
end
|
1373
|
+
elsif r.status == 422
|
1374
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1375
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1376
|
+
res.unprocessable_entity_response = out
|
1377
|
+
end
|
1378
|
+
elsif r.status == 429
|
1379
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1380
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1381
|
+
res.too_many_requests_response = out
|
1382
|
+
end
|
1383
|
+
elsif r.status == 500
|
1384
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1385
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1386
|
+
res.internal_server_error_response = out
|
1387
|
+
end
|
1388
|
+
elsif r.status == 501
|
1389
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1390
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1391
|
+
res.not_implemented_response = out
|
1392
|
+
end
|
1393
|
+
elsif r.status == 502
|
1394
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1395
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1396
|
+
res.bad_gateway_response = out
|
1397
|
+
end
|
1398
|
+
end
|
1399
|
+
|
1400
|
+
res
|
1401
|
+
end
|
1402
|
+
|
1403
|
+
|
1404
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCompletionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetCompletionResponse) }
|
1405
|
+
def get_completion(request, retries = nil, timeout_ms = nil)
|
1406
|
+
# get_completion - Get Completion
|
1407
|
+
url, params = @sdk_configuration.get_server_details
|
557
1408
|
base_url = Utils.template_url(url, params)
|
558
1409
|
url = Utils.generate_url(
|
559
1410
|
::StackOne::Operations::LmsGetCompletionRequest,
|
@@ -579,14 +1430,62 @@ module StackOne
|
|
579
1430
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
580
1431
|
retry_options[:retry_statuses] = [429, 408]
|
581
1432
|
|
1433
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1434
|
+
|
1435
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1436
|
+
timeout ||= @sdk_configuration.timeout
|
1437
|
+
|
582
1438
|
connection = @sdk_configuration.client.dup
|
583
1439
|
connection.request :retry, retry_options
|
584
1440
|
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
1441
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1442
|
+
base_url: base_url,
|
1443
|
+
oauth2_scopes: nil,
|
1444
|
+
operation_id: 'lms_get_completion',
|
1445
|
+
security_source: @sdk_configuration.security_source
|
1446
|
+
)
|
1447
|
+
|
1448
|
+
error = T.let(nil, T.nilable(StandardError))
|
1449
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1450
|
+
|
1451
|
+
begin
|
1452
|
+
r = connection.get(url) do |req|
|
1453
|
+
req.headers.merge!(headers)
|
1454
|
+
req.options.timeout = timeout unless timeout.nil?
|
1455
|
+
req.params = query_params
|
1456
|
+
Utils.configure_request_security(req, security)
|
1457
|
+
|
1458
|
+
@sdk_configuration.hooks.before_request(
|
1459
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1460
|
+
hook_ctx: hook_ctx
|
1461
|
+
),
|
1462
|
+
request: req
|
1463
|
+
)
|
1464
|
+
end
|
1465
|
+
rescue StandardError => e
|
1466
|
+
error = e
|
1467
|
+
ensure
|
1468
|
+
if r.nil? || Utils.error_status?(r.status)
|
1469
|
+
r = @sdk_configuration.hooks.after_error(
|
1470
|
+
error: error,
|
1471
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1472
|
+
hook_ctx: hook_ctx
|
1473
|
+
),
|
1474
|
+
response: r
|
1475
|
+
)
|
1476
|
+
else
|
1477
|
+
r = @sdk_configuration.hooks.after_success(
|
1478
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1479
|
+
hook_ctx: hook_ctx
|
1480
|
+
),
|
1481
|
+
response: r
|
1482
|
+
)
|
1483
|
+
end
|
1484
|
+
|
1485
|
+
if r.nil?
|
1486
|
+
raise error if !error.nil?
|
1487
|
+
raise 'no response'
|
1488
|
+
end
|
590
1489
|
end
|
591
1490
|
|
592
1491
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -599,18 +1498,75 @@ module StackOne
|
|
599
1498
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CompletionResult)
|
600
1499
|
res.completion_result = out
|
601
1500
|
end
|
1501
|
+
elsif r.status == 400
|
1502
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1503
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1504
|
+
res.bad_request_response = out
|
1505
|
+
end
|
1506
|
+
elsif r.status == 401
|
1507
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1508
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1509
|
+
res.unauthorized_response = out
|
1510
|
+
end
|
1511
|
+
elsif r.status == 403
|
1512
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1513
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1514
|
+
res.forbidden_response = out
|
1515
|
+
end
|
1516
|
+
elsif r.status == 404
|
1517
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1518
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1519
|
+
res.not_found_response = out
|
1520
|
+
end
|
602
1521
|
elsif r.status == 408
|
603
1522
|
res.headers = r.headers
|
604
|
-
|
605
|
-
|
1523
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1524
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1525
|
+
res.request_timed_out_response = out
|
1526
|
+
end
|
1527
|
+
elsif r.status == 409
|
1528
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1529
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1530
|
+
res.conflict_response = out
|
1531
|
+
end
|
1532
|
+
elsif r.status == 412
|
1533
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1534
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1535
|
+
res.precondition_failed_response = out
|
1536
|
+
end
|
1537
|
+
elsif r.status == 422
|
1538
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1539
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1540
|
+
res.unprocessable_entity_response = out
|
1541
|
+
end
|
1542
|
+
elsif r.status == 429
|
1543
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1544
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1545
|
+
res.too_many_requests_response = out
|
1546
|
+
end
|
1547
|
+
elsif r.status == 500
|
1548
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1549
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1550
|
+
res.internal_server_error_response = out
|
1551
|
+
end
|
1552
|
+
elsif r.status == 501
|
1553
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1554
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1555
|
+
res.not_implemented_response = out
|
1556
|
+
end
|
1557
|
+
elsif r.status == 502
|
1558
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1559
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1560
|
+
res.bad_gateway_response = out
|
1561
|
+
end
|
606
1562
|
end
|
607
1563
|
|
608
1564
|
res
|
609
1565
|
end
|
610
1566
|
|
611
1567
|
|
612
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetContentRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetContentResponse) }
|
613
|
-
def get_content(request, retries = nil)
|
1568
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetContentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetContentResponse) }
|
1569
|
+
def get_content(request, retries = nil, timeout_ms = nil)
|
614
1570
|
# get_content - Get Content
|
615
1571
|
url, params = @sdk_configuration.get_server_details
|
616
1572
|
base_url = Utils.template_url(url, params)
|
@@ -638,14 +1594,62 @@ module StackOne
|
|
638
1594
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
639
1595
|
retry_options[:retry_statuses] = [429, 408]
|
640
1596
|
|
1597
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1598
|
+
|
1599
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1600
|
+
timeout ||= @sdk_configuration.timeout
|
1601
|
+
|
641
1602
|
connection = @sdk_configuration.client.dup
|
642
1603
|
connection.request :retry, retry_options
|
643
1604
|
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
1605
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1606
|
+
base_url: base_url,
|
1607
|
+
oauth2_scopes: nil,
|
1608
|
+
operation_id: 'lms_get_content',
|
1609
|
+
security_source: @sdk_configuration.security_source
|
1610
|
+
)
|
1611
|
+
|
1612
|
+
error = T.let(nil, T.nilable(StandardError))
|
1613
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1614
|
+
|
1615
|
+
begin
|
1616
|
+
r = connection.get(url) do |req|
|
1617
|
+
req.headers.merge!(headers)
|
1618
|
+
req.options.timeout = timeout unless timeout.nil?
|
1619
|
+
req.params = query_params
|
1620
|
+
Utils.configure_request_security(req, security)
|
1621
|
+
|
1622
|
+
@sdk_configuration.hooks.before_request(
|
1623
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1624
|
+
hook_ctx: hook_ctx
|
1625
|
+
),
|
1626
|
+
request: req
|
1627
|
+
)
|
1628
|
+
end
|
1629
|
+
rescue StandardError => e
|
1630
|
+
error = e
|
1631
|
+
ensure
|
1632
|
+
if r.nil? || Utils.error_status?(r.status)
|
1633
|
+
r = @sdk_configuration.hooks.after_error(
|
1634
|
+
error: error,
|
1635
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1636
|
+
hook_ctx: hook_ctx
|
1637
|
+
),
|
1638
|
+
response: r
|
1639
|
+
)
|
1640
|
+
else
|
1641
|
+
r = @sdk_configuration.hooks.after_success(
|
1642
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1643
|
+
hook_ctx: hook_ctx
|
1644
|
+
),
|
1645
|
+
response: r
|
1646
|
+
)
|
1647
|
+
end
|
1648
|
+
|
1649
|
+
if r.nil?
|
1650
|
+
raise error if !error.nil?
|
1651
|
+
raise 'no response'
|
1652
|
+
end
|
649
1653
|
end
|
650
1654
|
|
651
1655
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -658,18 +1662,75 @@ module StackOne
|
|
658
1662
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContentResult)
|
659
1663
|
res.content_result = out
|
660
1664
|
end
|
1665
|
+
elsif r.status == 400
|
1666
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1667
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1668
|
+
res.bad_request_response = out
|
1669
|
+
end
|
1670
|
+
elsif r.status == 401
|
1671
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1672
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1673
|
+
res.unauthorized_response = out
|
1674
|
+
end
|
1675
|
+
elsif r.status == 403
|
1676
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1677
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1678
|
+
res.forbidden_response = out
|
1679
|
+
end
|
1680
|
+
elsif r.status == 404
|
1681
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1682
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1683
|
+
res.not_found_response = out
|
1684
|
+
end
|
661
1685
|
elsif r.status == 408
|
662
1686
|
res.headers = r.headers
|
663
|
-
|
664
|
-
|
1687
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1688
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1689
|
+
res.request_timed_out_response = out
|
1690
|
+
end
|
1691
|
+
elsif r.status == 409
|
1692
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1693
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1694
|
+
res.conflict_response = out
|
1695
|
+
end
|
1696
|
+
elsif r.status == 412
|
1697
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1698
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1699
|
+
res.precondition_failed_response = out
|
1700
|
+
end
|
1701
|
+
elsif r.status == 422
|
1702
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1703
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1704
|
+
res.unprocessable_entity_response = out
|
1705
|
+
end
|
1706
|
+
elsif r.status == 429
|
1707
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1708
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1709
|
+
res.too_many_requests_response = out
|
1710
|
+
end
|
1711
|
+
elsif r.status == 500
|
1712
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1713
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1714
|
+
res.internal_server_error_response = out
|
1715
|
+
end
|
1716
|
+
elsif r.status == 501
|
1717
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1718
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1719
|
+
res.not_implemented_response = out
|
1720
|
+
end
|
1721
|
+
elsif r.status == 502
|
1722
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1723
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1724
|
+
res.bad_gateway_response = out
|
1725
|
+
end
|
665
1726
|
end
|
666
1727
|
|
667
1728
|
res
|
668
1729
|
end
|
669
1730
|
|
670
1731
|
|
671
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCourseRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetCourseResponse) }
|
672
|
-
def get_course(request, retries = nil)
|
1732
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCourseRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetCourseResponse) }
|
1733
|
+
def get_course(request, retries = nil, timeout_ms = nil)
|
673
1734
|
# get_course - Get Course
|
674
1735
|
url, params = @sdk_configuration.get_server_details
|
675
1736
|
base_url = Utils.template_url(url, params)
|
@@ -697,14 +1758,62 @@ module StackOne
|
|
697
1758
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
698
1759
|
retry_options[:retry_statuses] = [429, 408]
|
699
1760
|
|
1761
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1762
|
+
|
1763
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1764
|
+
timeout ||= @sdk_configuration.timeout
|
1765
|
+
|
700
1766
|
connection = @sdk_configuration.client.dup
|
701
1767
|
connection.request :retry, retry_options
|
702
1768
|
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
1769
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1770
|
+
base_url: base_url,
|
1771
|
+
oauth2_scopes: nil,
|
1772
|
+
operation_id: 'lms_get_course',
|
1773
|
+
security_source: @sdk_configuration.security_source
|
1774
|
+
)
|
1775
|
+
|
1776
|
+
error = T.let(nil, T.nilable(StandardError))
|
1777
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1778
|
+
|
1779
|
+
begin
|
1780
|
+
r = connection.get(url) do |req|
|
1781
|
+
req.headers.merge!(headers)
|
1782
|
+
req.options.timeout = timeout unless timeout.nil?
|
1783
|
+
req.params = query_params
|
1784
|
+
Utils.configure_request_security(req, security)
|
1785
|
+
|
1786
|
+
@sdk_configuration.hooks.before_request(
|
1787
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1788
|
+
hook_ctx: hook_ctx
|
1789
|
+
),
|
1790
|
+
request: req
|
1791
|
+
)
|
1792
|
+
end
|
1793
|
+
rescue StandardError => e
|
1794
|
+
error = e
|
1795
|
+
ensure
|
1796
|
+
if r.nil? || Utils.error_status?(r.status)
|
1797
|
+
r = @sdk_configuration.hooks.after_error(
|
1798
|
+
error: error,
|
1799
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1800
|
+
hook_ctx: hook_ctx
|
1801
|
+
),
|
1802
|
+
response: r
|
1803
|
+
)
|
1804
|
+
else
|
1805
|
+
r = @sdk_configuration.hooks.after_success(
|
1806
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1807
|
+
hook_ctx: hook_ctx
|
1808
|
+
),
|
1809
|
+
response: r
|
1810
|
+
)
|
1811
|
+
end
|
1812
|
+
|
1813
|
+
if r.nil?
|
1814
|
+
raise error if !error.nil?
|
1815
|
+
raise 'no response'
|
1816
|
+
end
|
708
1817
|
end
|
709
1818
|
|
710
1819
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -717,18 +1826,75 @@ module StackOne
|
|
717
1826
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CourseResult)
|
718
1827
|
res.course_result = out
|
719
1828
|
end
|
1829
|
+
elsif r.status == 400
|
1830
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1831
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1832
|
+
res.bad_request_response = out
|
1833
|
+
end
|
1834
|
+
elsif r.status == 401
|
1835
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1836
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
1837
|
+
res.unauthorized_response = out
|
1838
|
+
end
|
1839
|
+
elsif r.status == 403
|
1840
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1841
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
1842
|
+
res.forbidden_response = out
|
1843
|
+
end
|
1844
|
+
elsif r.status == 404
|
1845
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1846
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
1847
|
+
res.not_found_response = out
|
1848
|
+
end
|
720
1849
|
elsif r.status == 408
|
721
1850
|
res.headers = r.headers
|
722
|
-
|
723
|
-
|
1851
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1852
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
1853
|
+
res.request_timed_out_response = out
|
1854
|
+
end
|
1855
|
+
elsif r.status == 409
|
1856
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1857
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
1858
|
+
res.conflict_response = out
|
1859
|
+
end
|
1860
|
+
elsif r.status == 412
|
1861
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1862
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
1863
|
+
res.precondition_failed_response = out
|
1864
|
+
end
|
1865
|
+
elsif r.status == 422
|
1866
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1867
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
1868
|
+
res.unprocessable_entity_response = out
|
1869
|
+
end
|
1870
|
+
elsif r.status == 429
|
1871
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1872
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
1873
|
+
res.too_many_requests_response = out
|
1874
|
+
end
|
1875
|
+
elsif r.status == 500
|
1876
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1877
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
1878
|
+
res.internal_server_error_response = out
|
1879
|
+
end
|
1880
|
+
elsif r.status == 501
|
1881
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1882
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
1883
|
+
res.not_implemented_response = out
|
1884
|
+
end
|
1885
|
+
elsif r.status == 502
|
1886
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1887
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
1888
|
+
res.bad_gateway_response = out
|
1889
|
+
end
|
724
1890
|
end
|
725
1891
|
|
726
1892
|
res
|
727
1893
|
end
|
728
1894
|
|
729
1895
|
|
730
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetSkillRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetSkillResponse) }
|
731
|
-
def get_skill(request, retries = nil)
|
1896
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetSkillRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetSkillResponse) }
|
1897
|
+
def get_skill(request, retries = nil, timeout_ms = nil)
|
732
1898
|
# get_skill - Get Skill
|
733
1899
|
url, params = @sdk_configuration.get_server_details
|
734
1900
|
base_url = Utils.template_url(url, params)
|
@@ -756,14 +1922,62 @@ module StackOne
|
|
756
1922
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
757
1923
|
retry_options[:retry_statuses] = [429, 408]
|
758
1924
|
|
1925
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1926
|
+
|
1927
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1928
|
+
timeout ||= @sdk_configuration.timeout
|
1929
|
+
|
759
1930
|
connection = @sdk_configuration.client.dup
|
760
1931
|
connection.request :retry, retry_options
|
761
1932
|
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
1933
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1934
|
+
base_url: base_url,
|
1935
|
+
oauth2_scopes: nil,
|
1936
|
+
operation_id: 'lms_get_skill',
|
1937
|
+
security_source: @sdk_configuration.security_source
|
1938
|
+
)
|
1939
|
+
|
1940
|
+
error = T.let(nil, T.nilable(StandardError))
|
1941
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1942
|
+
|
1943
|
+
begin
|
1944
|
+
r = connection.get(url) do |req|
|
1945
|
+
req.headers.merge!(headers)
|
1946
|
+
req.options.timeout = timeout unless timeout.nil?
|
1947
|
+
req.params = query_params
|
1948
|
+
Utils.configure_request_security(req, security)
|
1949
|
+
|
1950
|
+
@sdk_configuration.hooks.before_request(
|
1951
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1952
|
+
hook_ctx: hook_ctx
|
1953
|
+
),
|
1954
|
+
request: req
|
1955
|
+
)
|
1956
|
+
end
|
1957
|
+
rescue StandardError => e
|
1958
|
+
error = e
|
1959
|
+
ensure
|
1960
|
+
if r.nil? || Utils.error_status?(r.status)
|
1961
|
+
r = @sdk_configuration.hooks.after_error(
|
1962
|
+
error: error,
|
1963
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1964
|
+
hook_ctx: hook_ctx
|
1965
|
+
),
|
1966
|
+
response: r
|
1967
|
+
)
|
1968
|
+
else
|
1969
|
+
r = @sdk_configuration.hooks.after_success(
|
1970
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1971
|
+
hook_ctx: hook_ctx
|
1972
|
+
),
|
1973
|
+
response: r
|
1974
|
+
)
|
1975
|
+
end
|
1976
|
+
|
1977
|
+
if r.nil?
|
1978
|
+
raise error if !error.nil?
|
1979
|
+
raise 'no response'
|
1980
|
+
end
|
767
1981
|
end
|
768
1982
|
|
769
1983
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -776,18 +1990,75 @@ module StackOne
|
|
776
1990
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::SkillResult)
|
777
1991
|
res.skill_result = out
|
778
1992
|
end
|
1993
|
+
elsif r.status == 400
|
1994
|
+
if Utils.match_content_type(content_type, 'application/json')
|
1995
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
1996
|
+
res.bad_request_response = out
|
1997
|
+
end
|
1998
|
+
elsif r.status == 401
|
1999
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2000
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2001
|
+
res.unauthorized_response = out
|
2002
|
+
end
|
2003
|
+
elsif r.status == 403
|
2004
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2005
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2006
|
+
res.forbidden_response = out
|
2007
|
+
end
|
2008
|
+
elsif r.status == 404
|
2009
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2010
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2011
|
+
res.not_found_response = out
|
2012
|
+
end
|
779
2013
|
elsif r.status == 408
|
780
2014
|
res.headers = r.headers
|
781
|
-
|
782
|
-
|
2015
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2016
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2017
|
+
res.request_timed_out_response = out
|
2018
|
+
end
|
2019
|
+
elsif r.status == 409
|
2020
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2021
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2022
|
+
res.conflict_response = out
|
2023
|
+
end
|
2024
|
+
elsif r.status == 412
|
2025
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2026
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2027
|
+
res.precondition_failed_response = out
|
2028
|
+
end
|
2029
|
+
elsif r.status == 422
|
2030
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2031
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2032
|
+
res.unprocessable_entity_response = out
|
2033
|
+
end
|
2034
|
+
elsif r.status == 429
|
2035
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2036
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2037
|
+
res.too_many_requests_response = out
|
2038
|
+
end
|
2039
|
+
elsif r.status == 500
|
2040
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2041
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2042
|
+
res.internal_server_error_response = out
|
2043
|
+
end
|
2044
|
+
elsif r.status == 501
|
2045
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2046
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2047
|
+
res.not_implemented_response = out
|
2048
|
+
end
|
2049
|
+
elsif r.status == 502
|
2050
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2051
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2052
|
+
res.bad_gateway_response = out
|
2053
|
+
end
|
783
2054
|
end
|
784
2055
|
|
785
2056
|
res
|
786
2057
|
end
|
787
2058
|
|
788
2059
|
|
789
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetUserResponse) }
|
790
|
-
def get_user(request, retries = nil)
|
2060
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetUserResponse) }
|
2061
|
+
def get_user(request, retries = nil, timeout_ms = nil)
|
791
2062
|
# get_user - Get User
|
792
2063
|
url, params = @sdk_configuration.get_server_details
|
793
2064
|
base_url = Utils.template_url(url, params)
|
@@ -815,14 +2086,62 @@ module StackOne
|
|
815
2086
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
816
2087
|
retry_options[:retry_statuses] = [429, 408]
|
817
2088
|
|
2089
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2090
|
+
|
2091
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2092
|
+
timeout ||= @sdk_configuration.timeout
|
2093
|
+
|
818
2094
|
connection = @sdk_configuration.client.dup
|
819
2095
|
connection.request :retry, retry_options
|
820
2096
|
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
2097
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2098
|
+
base_url: base_url,
|
2099
|
+
oauth2_scopes: nil,
|
2100
|
+
operation_id: 'lms_get_user',
|
2101
|
+
security_source: @sdk_configuration.security_source
|
2102
|
+
)
|
2103
|
+
|
2104
|
+
error = T.let(nil, T.nilable(StandardError))
|
2105
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2106
|
+
|
2107
|
+
begin
|
2108
|
+
r = connection.get(url) do |req|
|
2109
|
+
req.headers.merge!(headers)
|
2110
|
+
req.options.timeout = timeout unless timeout.nil?
|
2111
|
+
req.params = query_params
|
2112
|
+
Utils.configure_request_security(req, security)
|
2113
|
+
|
2114
|
+
@sdk_configuration.hooks.before_request(
|
2115
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2116
|
+
hook_ctx: hook_ctx
|
2117
|
+
),
|
2118
|
+
request: req
|
2119
|
+
)
|
2120
|
+
end
|
2121
|
+
rescue StandardError => e
|
2122
|
+
error = e
|
2123
|
+
ensure
|
2124
|
+
if r.nil? || Utils.error_status?(r.status)
|
2125
|
+
r = @sdk_configuration.hooks.after_error(
|
2126
|
+
error: error,
|
2127
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2128
|
+
hook_ctx: hook_ctx
|
2129
|
+
),
|
2130
|
+
response: r
|
2131
|
+
)
|
2132
|
+
else
|
2133
|
+
r = @sdk_configuration.hooks.after_success(
|
2134
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2135
|
+
hook_ctx: hook_ctx
|
2136
|
+
),
|
2137
|
+
response: r
|
2138
|
+
)
|
2139
|
+
end
|
2140
|
+
|
2141
|
+
if r.nil?
|
2142
|
+
raise error if !error.nil?
|
2143
|
+
raise 'no response'
|
2144
|
+
end
|
826
2145
|
end
|
827
2146
|
|
828
2147
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -835,18 +2154,75 @@ module StackOne
|
|
835
2154
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UserResult)
|
836
2155
|
res.user_result = out
|
837
2156
|
end
|
2157
|
+
elsif r.status == 400
|
2158
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2159
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2160
|
+
res.bad_request_response = out
|
2161
|
+
end
|
2162
|
+
elsif r.status == 401
|
2163
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2164
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2165
|
+
res.unauthorized_response = out
|
2166
|
+
end
|
2167
|
+
elsif r.status == 403
|
2168
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2169
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2170
|
+
res.forbidden_response = out
|
2171
|
+
end
|
2172
|
+
elsif r.status == 404
|
2173
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2174
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2175
|
+
res.not_found_response = out
|
2176
|
+
end
|
838
2177
|
elsif r.status == 408
|
839
2178
|
res.headers = r.headers
|
840
|
-
|
841
|
-
|
2179
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2180
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2181
|
+
res.request_timed_out_response = out
|
2182
|
+
end
|
2183
|
+
elsif r.status == 409
|
2184
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2185
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2186
|
+
res.conflict_response = out
|
2187
|
+
end
|
2188
|
+
elsif r.status == 412
|
2189
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2190
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2191
|
+
res.precondition_failed_response = out
|
2192
|
+
end
|
2193
|
+
elsif r.status == 422
|
2194
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2195
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2196
|
+
res.unprocessable_entity_response = out
|
2197
|
+
end
|
2198
|
+
elsif r.status == 429
|
2199
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2200
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2201
|
+
res.too_many_requests_response = out
|
2202
|
+
end
|
2203
|
+
elsif r.status == 500
|
2204
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2205
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2206
|
+
res.internal_server_error_response = out
|
2207
|
+
end
|
2208
|
+
elsif r.status == 501
|
2209
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2210
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2211
|
+
res.not_implemented_response = out
|
2212
|
+
end
|
2213
|
+
elsif r.status == 502
|
2214
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2215
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2216
|
+
res.bad_gateway_response = out
|
2217
|
+
end
|
842
2218
|
end
|
843
2219
|
|
844
2220
|
res
|
845
2221
|
end
|
846
2222
|
|
847
2223
|
|
848
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserAssignmentRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetUserAssignmentResponse) }
|
849
|
-
def get_user_assignment(request, retries = nil)
|
2224
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetUserAssignmentResponse) }
|
2225
|
+
def get_user_assignment(request, retries = nil, timeout_ms = nil)
|
850
2226
|
# get_user_assignment - Get User Assignment
|
851
2227
|
url, params = @sdk_configuration.get_server_details
|
852
2228
|
base_url = Utils.template_url(url, params)
|
@@ -874,14 +2250,62 @@ module StackOne
|
|
874
2250
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
875
2251
|
retry_options[:retry_statuses] = [429, 408]
|
876
2252
|
|
2253
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2254
|
+
|
2255
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2256
|
+
timeout ||= @sdk_configuration.timeout
|
2257
|
+
|
877
2258
|
connection = @sdk_configuration.client.dup
|
878
2259
|
connection.request :retry, retry_options
|
879
2260
|
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
2261
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2262
|
+
base_url: base_url,
|
2263
|
+
oauth2_scopes: nil,
|
2264
|
+
operation_id: 'lms_get_user_assignment',
|
2265
|
+
security_source: @sdk_configuration.security_source
|
2266
|
+
)
|
2267
|
+
|
2268
|
+
error = T.let(nil, T.nilable(StandardError))
|
2269
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2270
|
+
|
2271
|
+
begin
|
2272
|
+
r = connection.get(url) do |req|
|
2273
|
+
req.headers.merge!(headers)
|
2274
|
+
req.options.timeout = timeout unless timeout.nil?
|
2275
|
+
req.params = query_params
|
2276
|
+
Utils.configure_request_security(req, security)
|
2277
|
+
|
2278
|
+
@sdk_configuration.hooks.before_request(
|
2279
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2280
|
+
hook_ctx: hook_ctx
|
2281
|
+
),
|
2282
|
+
request: req
|
2283
|
+
)
|
2284
|
+
end
|
2285
|
+
rescue StandardError => e
|
2286
|
+
error = e
|
2287
|
+
ensure
|
2288
|
+
if r.nil? || Utils.error_status?(r.status)
|
2289
|
+
r = @sdk_configuration.hooks.after_error(
|
2290
|
+
error: error,
|
2291
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2292
|
+
hook_ctx: hook_ctx
|
2293
|
+
),
|
2294
|
+
response: r
|
2295
|
+
)
|
2296
|
+
else
|
2297
|
+
r = @sdk_configuration.hooks.after_success(
|
2298
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2299
|
+
hook_ctx: hook_ctx
|
2300
|
+
),
|
2301
|
+
response: r
|
2302
|
+
)
|
2303
|
+
end
|
2304
|
+
|
2305
|
+
if r.nil?
|
2306
|
+
raise error if !error.nil?
|
2307
|
+
raise 'no response'
|
2308
|
+
end
|
885
2309
|
end
|
886
2310
|
|
887
2311
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -894,18 +2318,75 @@ module StackOne
|
|
894
2318
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::AssignmentResult)
|
895
2319
|
res.assignment_result = out
|
896
2320
|
end
|
2321
|
+
elsif r.status == 400
|
2322
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2323
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2324
|
+
res.bad_request_response = out
|
2325
|
+
end
|
2326
|
+
elsif r.status == 401
|
2327
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2328
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2329
|
+
res.unauthorized_response = out
|
2330
|
+
end
|
2331
|
+
elsif r.status == 403
|
2332
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2333
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2334
|
+
res.forbidden_response = out
|
2335
|
+
end
|
2336
|
+
elsif r.status == 404
|
2337
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2338
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2339
|
+
res.not_found_response = out
|
2340
|
+
end
|
897
2341
|
elsif r.status == 408
|
898
2342
|
res.headers = r.headers
|
899
|
-
|
900
|
-
|
2343
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2344
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2345
|
+
res.request_timed_out_response = out
|
2346
|
+
end
|
2347
|
+
elsif r.status == 409
|
2348
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2349
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2350
|
+
res.conflict_response = out
|
2351
|
+
end
|
2352
|
+
elsif r.status == 412
|
2353
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2354
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2355
|
+
res.precondition_failed_response = out
|
2356
|
+
end
|
2357
|
+
elsif r.status == 422
|
2358
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2359
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2360
|
+
res.unprocessable_entity_response = out
|
2361
|
+
end
|
2362
|
+
elsif r.status == 429
|
2363
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2364
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2365
|
+
res.too_many_requests_response = out
|
2366
|
+
end
|
2367
|
+
elsif r.status == 500
|
2368
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2369
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2370
|
+
res.internal_server_error_response = out
|
2371
|
+
end
|
2372
|
+
elsif r.status == 501
|
2373
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2374
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2375
|
+
res.not_implemented_response = out
|
2376
|
+
end
|
2377
|
+
elsif r.status == 502
|
2378
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2379
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2380
|
+
res.bad_gateway_response = out
|
2381
|
+
end
|
901
2382
|
end
|
902
2383
|
|
903
2384
|
res
|
904
2385
|
end
|
905
2386
|
|
906
2387
|
|
907
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserCompletionRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsGetUserCompletionResponse) }
|
908
|
-
def get_user_completion(request, retries = nil)
|
2388
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserCompletionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetUserCompletionResponse) }
|
2389
|
+
def get_user_completion(request, retries = nil, timeout_ms = nil)
|
909
2390
|
# get_user_completion - Get User Completion
|
910
2391
|
url, params = @sdk_configuration.get_server_details
|
911
2392
|
base_url = Utils.template_url(url, params)
|
@@ -933,14 +2414,62 @@ module StackOne
|
|
933
2414
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
934
2415
|
retry_options[:retry_statuses] = [429, 408]
|
935
2416
|
|
2417
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2418
|
+
|
2419
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2420
|
+
timeout ||= @sdk_configuration.timeout
|
2421
|
+
|
936
2422
|
connection = @sdk_configuration.client.dup
|
937
2423
|
connection.request :retry, retry_options
|
938
2424
|
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
2425
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2426
|
+
base_url: base_url,
|
2427
|
+
oauth2_scopes: nil,
|
2428
|
+
operation_id: 'lms_get_user_completion',
|
2429
|
+
security_source: @sdk_configuration.security_source
|
2430
|
+
)
|
2431
|
+
|
2432
|
+
error = T.let(nil, T.nilable(StandardError))
|
2433
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2434
|
+
|
2435
|
+
begin
|
2436
|
+
r = connection.get(url) do |req|
|
2437
|
+
req.headers.merge!(headers)
|
2438
|
+
req.options.timeout = timeout unless timeout.nil?
|
2439
|
+
req.params = query_params
|
2440
|
+
Utils.configure_request_security(req, security)
|
2441
|
+
|
2442
|
+
@sdk_configuration.hooks.before_request(
|
2443
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2444
|
+
hook_ctx: hook_ctx
|
2445
|
+
),
|
2446
|
+
request: req
|
2447
|
+
)
|
2448
|
+
end
|
2449
|
+
rescue StandardError => e
|
2450
|
+
error = e
|
2451
|
+
ensure
|
2452
|
+
if r.nil? || Utils.error_status?(r.status)
|
2453
|
+
r = @sdk_configuration.hooks.after_error(
|
2454
|
+
error: error,
|
2455
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2456
|
+
hook_ctx: hook_ctx
|
2457
|
+
),
|
2458
|
+
response: r
|
2459
|
+
)
|
2460
|
+
else
|
2461
|
+
r = @sdk_configuration.hooks.after_success(
|
2462
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2463
|
+
hook_ctx: hook_ctx
|
2464
|
+
),
|
2465
|
+
response: r
|
2466
|
+
)
|
2467
|
+
end
|
2468
|
+
|
2469
|
+
if r.nil?
|
2470
|
+
raise error if !error.nil?
|
2471
|
+
raise 'no response'
|
2472
|
+
end
|
944
2473
|
end
|
945
2474
|
|
946
2475
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -953,18 +2482,75 @@ module StackOne
|
|
953
2482
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CompletionResult)
|
954
2483
|
res.completion_result = out
|
955
2484
|
end
|
2485
|
+
elsif r.status == 400
|
2486
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2487
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2488
|
+
res.bad_request_response = out
|
2489
|
+
end
|
2490
|
+
elsif r.status == 401
|
2491
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2492
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2493
|
+
res.unauthorized_response = out
|
2494
|
+
end
|
2495
|
+
elsif r.status == 403
|
2496
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2497
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2498
|
+
res.forbidden_response = out
|
2499
|
+
end
|
2500
|
+
elsif r.status == 404
|
2501
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2502
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2503
|
+
res.not_found_response = out
|
2504
|
+
end
|
956
2505
|
elsif r.status == 408
|
957
2506
|
res.headers = r.headers
|
958
|
-
|
959
|
-
|
2507
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2508
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2509
|
+
res.request_timed_out_response = out
|
2510
|
+
end
|
2511
|
+
elsif r.status == 409
|
2512
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2513
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2514
|
+
res.conflict_response = out
|
2515
|
+
end
|
2516
|
+
elsif r.status == 412
|
2517
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2518
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2519
|
+
res.precondition_failed_response = out
|
2520
|
+
end
|
2521
|
+
elsif r.status == 422
|
2522
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2523
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2524
|
+
res.unprocessable_entity_response = out
|
2525
|
+
end
|
2526
|
+
elsif r.status == 429
|
2527
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2528
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2529
|
+
res.too_many_requests_response = out
|
2530
|
+
end
|
2531
|
+
elsif r.status == 500
|
2532
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2533
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2534
|
+
res.internal_server_error_response = out
|
2535
|
+
end
|
2536
|
+
elsif r.status == 501
|
2537
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2538
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2539
|
+
res.not_implemented_response = out
|
2540
|
+
end
|
2541
|
+
elsif r.status == 502
|
2542
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2543
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2544
|
+
res.bad_gateway_response = out
|
2545
|
+
end
|
960
2546
|
end
|
961
2547
|
|
962
2548
|
res
|
963
2549
|
end
|
964
2550
|
|
965
2551
|
|
966
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListAssignmentsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListAssignmentsResponse) }
|
967
|
-
def list_assignments(request, retries = nil)
|
2552
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListAssignmentsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListAssignmentsResponse) }
|
2553
|
+
def list_assignments(request, retries = nil, timeout_ms = nil)
|
968
2554
|
# list_assignments - List Assignments
|
969
2555
|
url, params = @sdk_configuration.get_server_details
|
970
2556
|
base_url = Utils.template_url(url, params)
|
@@ -987,14 +2573,62 @@ module StackOne
|
|
987
2573
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
988
2574
|
retry_options[:retry_statuses] = [429, 408]
|
989
2575
|
|
2576
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2577
|
+
|
2578
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2579
|
+
timeout ||= @sdk_configuration.timeout
|
2580
|
+
|
990
2581
|
connection = @sdk_configuration.client.dup
|
991
2582
|
connection.request :retry, retry_options
|
992
2583
|
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
2584
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2585
|
+
base_url: base_url,
|
2586
|
+
oauth2_scopes: nil,
|
2587
|
+
operation_id: 'lms_list_assignments',
|
2588
|
+
security_source: @sdk_configuration.security_source
|
2589
|
+
)
|
2590
|
+
|
2591
|
+
error = T.let(nil, T.nilable(StandardError))
|
2592
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2593
|
+
|
2594
|
+
begin
|
2595
|
+
r = connection.get(url) do |req|
|
2596
|
+
req.headers.merge!(headers)
|
2597
|
+
req.options.timeout = timeout unless timeout.nil?
|
2598
|
+
req.params = query_params
|
2599
|
+
Utils.configure_request_security(req, security)
|
2600
|
+
|
2601
|
+
@sdk_configuration.hooks.before_request(
|
2602
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2603
|
+
hook_ctx: hook_ctx
|
2604
|
+
),
|
2605
|
+
request: req
|
2606
|
+
)
|
2607
|
+
end
|
2608
|
+
rescue StandardError => e
|
2609
|
+
error = e
|
2610
|
+
ensure
|
2611
|
+
if r.nil? || Utils.error_status?(r.status)
|
2612
|
+
r = @sdk_configuration.hooks.after_error(
|
2613
|
+
error: error,
|
2614
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2615
|
+
hook_ctx: hook_ctx
|
2616
|
+
),
|
2617
|
+
response: r
|
2618
|
+
)
|
2619
|
+
else
|
2620
|
+
r = @sdk_configuration.hooks.after_success(
|
2621
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2622
|
+
hook_ctx: hook_ctx
|
2623
|
+
),
|
2624
|
+
response: r
|
2625
|
+
)
|
2626
|
+
end
|
2627
|
+
|
2628
|
+
if r.nil?
|
2629
|
+
raise error if !error.nil?
|
2630
|
+
raise 'no response'
|
2631
|
+
end
|
998
2632
|
end
|
999
2633
|
|
1000
2634
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1007,18 +2641,75 @@ module StackOne
|
|
1007
2641
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::AssignmentsPaginated)
|
1008
2642
|
res.assignments_paginated = out
|
1009
2643
|
end
|
2644
|
+
elsif r.status == 400
|
2645
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2646
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2647
|
+
res.bad_request_response = out
|
2648
|
+
end
|
2649
|
+
elsif r.status == 401
|
2650
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2651
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2652
|
+
res.unauthorized_response = out
|
2653
|
+
end
|
2654
|
+
elsif r.status == 403
|
2655
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2656
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2657
|
+
res.forbidden_response = out
|
2658
|
+
end
|
2659
|
+
elsif r.status == 404
|
2660
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2661
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2662
|
+
res.not_found_response = out
|
2663
|
+
end
|
1010
2664
|
elsif r.status == 408
|
1011
2665
|
res.headers = r.headers
|
1012
|
-
|
1013
|
-
|
2666
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2667
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2668
|
+
res.request_timed_out_response = out
|
2669
|
+
end
|
2670
|
+
elsif r.status == 409
|
2671
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2672
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2673
|
+
res.conflict_response = out
|
2674
|
+
end
|
2675
|
+
elsif r.status == 412
|
2676
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2677
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2678
|
+
res.precondition_failed_response = out
|
2679
|
+
end
|
2680
|
+
elsif r.status == 422
|
2681
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2682
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2683
|
+
res.unprocessable_entity_response = out
|
2684
|
+
end
|
2685
|
+
elsif r.status == 429
|
2686
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2687
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2688
|
+
res.too_many_requests_response = out
|
2689
|
+
end
|
2690
|
+
elsif r.status == 500
|
2691
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2692
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2693
|
+
res.internal_server_error_response = out
|
2694
|
+
end
|
2695
|
+
elsif r.status == 501
|
2696
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2697
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2698
|
+
res.not_implemented_response = out
|
2699
|
+
end
|
2700
|
+
elsif r.status == 502
|
2701
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2702
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2703
|
+
res.bad_gateway_response = out
|
2704
|
+
end
|
1014
2705
|
end
|
1015
2706
|
|
1016
2707
|
res
|
1017
2708
|
end
|
1018
2709
|
|
1019
2710
|
|
1020
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListCategoriesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListCategoriesResponse) }
|
1021
|
-
def list_categories(request, retries = nil)
|
2711
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListCategoriesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListCategoriesResponse) }
|
2712
|
+
def list_categories(request, retries = nil, timeout_ms = nil)
|
1022
2713
|
# list_categories - List Categories
|
1023
2714
|
url, params = @sdk_configuration.get_server_details
|
1024
2715
|
base_url = Utils.template_url(url, params)
|
@@ -1041,14 +2732,62 @@ module StackOne
|
|
1041
2732
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1042
2733
|
retry_options[:retry_statuses] = [429, 408]
|
1043
2734
|
|
2735
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2736
|
+
|
2737
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2738
|
+
timeout ||= @sdk_configuration.timeout
|
2739
|
+
|
1044
2740
|
connection = @sdk_configuration.client.dup
|
1045
2741
|
connection.request :retry, retry_options
|
1046
2742
|
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
2743
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2744
|
+
base_url: base_url,
|
2745
|
+
oauth2_scopes: nil,
|
2746
|
+
operation_id: 'lms_list_categories',
|
2747
|
+
security_source: @sdk_configuration.security_source
|
2748
|
+
)
|
2749
|
+
|
2750
|
+
error = T.let(nil, T.nilable(StandardError))
|
2751
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2752
|
+
|
2753
|
+
begin
|
2754
|
+
r = connection.get(url) do |req|
|
2755
|
+
req.headers.merge!(headers)
|
2756
|
+
req.options.timeout = timeout unless timeout.nil?
|
2757
|
+
req.params = query_params
|
2758
|
+
Utils.configure_request_security(req, security)
|
2759
|
+
|
2760
|
+
@sdk_configuration.hooks.before_request(
|
2761
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2762
|
+
hook_ctx: hook_ctx
|
2763
|
+
),
|
2764
|
+
request: req
|
2765
|
+
)
|
2766
|
+
end
|
2767
|
+
rescue StandardError => e
|
2768
|
+
error = e
|
2769
|
+
ensure
|
2770
|
+
if r.nil? || Utils.error_status?(r.status)
|
2771
|
+
r = @sdk_configuration.hooks.after_error(
|
2772
|
+
error: error,
|
2773
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2774
|
+
hook_ctx: hook_ctx
|
2775
|
+
),
|
2776
|
+
response: r
|
2777
|
+
)
|
2778
|
+
else
|
2779
|
+
r = @sdk_configuration.hooks.after_success(
|
2780
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2781
|
+
hook_ctx: hook_ctx
|
2782
|
+
),
|
2783
|
+
response: r
|
2784
|
+
)
|
2785
|
+
end
|
2786
|
+
|
2787
|
+
if r.nil?
|
2788
|
+
raise error if !error.nil?
|
2789
|
+
raise 'no response'
|
2790
|
+
end
|
1052
2791
|
end
|
1053
2792
|
|
1054
2793
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1061,18 +2800,75 @@ module StackOne
|
|
1061
2800
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CategoriesPaginated)
|
1062
2801
|
res.categories_paginated = out
|
1063
2802
|
end
|
2803
|
+
elsif r.status == 400
|
2804
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2805
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2806
|
+
res.bad_request_response = out
|
2807
|
+
end
|
2808
|
+
elsif r.status == 401
|
2809
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2810
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2811
|
+
res.unauthorized_response = out
|
2812
|
+
end
|
2813
|
+
elsif r.status == 403
|
2814
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2815
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2816
|
+
res.forbidden_response = out
|
2817
|
+
end
|
2818
|
+
elsif r.status == 404
|
2819
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2820
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2821
|
+
res.not_found_response = out
|
2822
|
+
end
|
1064
2823
|
elsif r.status == 408
|
1065
2824
|
res.headers = r.headers
|
1066
|
-
|
1067
|
-
|
2825
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2826
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2827
|
+
res.request_timed_out_response = out
|
2828
|
+
end
|
2829
|
+
elsif r.status == 409
|
2830
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2831
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2832
|
+
res.conflict_response = out
|
2833
|
+
end
|
2834
|
+
elsif r.status == 412
|
2835
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2836
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2837
|
+
res.precondition_failed_response = out
|
2838
|
+
end
|
2839
|
+
elsif r.status == 422
|
2840
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2841
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
2842
|
+
res.unprocessable_entity_response = out
|
2843
|
+
end
|
2844
|
+
elsif r.status == 429
|
2845
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2846
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
2847
|
+
res.too_many_requests_response = out
|
2848
|
+
end
|
2849
|
+
elsif r.status == 500
|
2850
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2851
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
2852
|
+
res.internal_server_error_response = out
|
2853
|
+
end
|
2854
|
+
elsif r.status == 501
|
2855
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2856
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
2857
|
+
res.not_implemented_response = out
|
2858
|
+
end
|
2859
|
+
elsif r.status == 502
|
2860
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2861
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
2862
|
+
res.bad_gateway_response = out
|
2863
|
+
end
|
1068
2864
|
end
|
1069
2865
|
|
1070
2866
|
res
|
1071
2867
|
end
|
1072
2868
|
|
1073
2869
|
|
1074
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListCompletionsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListCompletionsResponse) }
|
1075
|
-
def list_completions(request, retries = nil)
|
2870
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListCompletionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListCompletionsResponse) }
|
2871
|
+
def list_completions(request, retries = nil, timeout_ms = nil)
|
1076
2872
|
# list_completions - List Completions
|
1077
2873
|
url, params = @sdk_configuration.get_server_details
|
1078
2874
|
base_url = Utils.template_url(url, params)
|
@@ -1095,14 +2891,62 @@ module StackOne
|
|
1095
2891
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1096
2892
|
retry_options[:retry_statuses] = [429, 408]
|
1097
2893
|
|
2894
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2895
|
+
|
2896
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2897
|
+
timeout ||= @sdk_configuration.timeout
|
2898
|
+
|
1098
2899
|
connection = @sdk_configuration.client.dup
|
1099
2900
|
connection.request :retry, retry_options
|
1100
2901
|
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
2902
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2903
|
+
base_url: base_url,
|
2904
|
+
oauth2_scopes: nil,
|
2905
|
+
operation_id: 'lms_list_completions',
|
2906
|
+
security_source: @sdk_configuration.security_source
|
2907
|
+
)
|
2908
|
+
|
2909
|
+
error = T.let(nil, T.nilable(StandardError))
|
2910
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2911
|
+
|
2912
|
+
begin
|
2913
|
+
r = connection.get(url) do |req|
|
2914
|
+
req.headers.merge!(headers)
|
2915
|
+
req.options.timeout = timeout unless timeout.nil?
|
2916
|
+
req.params = query_params
|
2917
|
+
Utils.configure_request_security(req, security)
|
2918
|
+
|
2919
|
+
@sdk_configuration.hooks.before_request(
|
2920
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2921
|
+
hook_ctx: hook_ctx
|
2922
|
+
),
|
2923
|
+
request: req
|
2924
|
+
)
|
2925
|
+
end
|
2926
|
+
rescue StandardError => e
|
2927
|
+
error = e
|
2928
|
+
ensure
|
2929
|
+
if r.nil? || Utils.error_status?(r.status)
|
2930
|
+
r = @sdk_configuration.hooks.after_error(
|
2931
|
+
error: error,
|
2932
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2933
|
+
hook_ctx: hook_ctx
|
2934
|
+
),
|
2935
|
+
response: r
|
2936
|
+
)
|
2937
|
+
else
|
2938
|
+
r = @sdk_configuration.hooks.after_success(
|
2939
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2940
|
+
hook_ctx: hook_ctx
|
2941
|
+
),
|
2942
|
+
response: r
|
2943
|
+
)
|
2944
|
+
end
|
2945
|
+
|
2946
|
+
if r.nil?
|
2947
|
+
raise error if !error.nil?
|
2948
|
+
raise 'no response'
|
2949
|
+
end
|
1106
2950
|
end
|
1107
2951
|
|
1108
2952
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1115,18 +2959,75 @@ module StackOne
|
|
1115
2959
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CompletionsPaginated)
|
1116
2960
|
res.completions_paginated = out
|
1117
2961
|
end
|
2962
|
+
elsif r.status == 400
|
2963
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2964
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
2965
|
+
res.bad_request_response = out
|
2966
|
+
end
|
2967
|
+
elsif r.status == 401
|
2968
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2969
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
2970
|
+
res.unauthorized_response = out
|
2971
|
+
end
|
2972
|
+
elsif r.status == 403
|
2973
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2974
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
2975
|
+
res.forbidden_response = out
|
2976
|
+
end
|
2977
|
+
elsif r.status == 404
|
2978
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2979
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
2980
|
+
res.not_found_response = out
|
2981
|
+
end
|
1118
2982
|
elsif r.status == 408
|
1119
2983
|
res.headers = r.headers
|
1120
|
-
|
1121
|
-
|
2984
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2985
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
2986
|
+
res.request_timed_out_response = out
|
2987
|
+
end
|
2988
|
+
elsif r.status == 409
|
2989
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2990
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
2991
|
+
res.conflict_response = out
|
2992
|
+
end
|
2993
|
+
elsif r.status == 412
|
2994
|
+
if Utils.match_content_type(content_type, 'application/json')
|
2995
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
2996
|
+
res.precondition_failed_response = out
|
2997
|
+
end
|
2998
|
+
elsif r.status == 422
|
2999
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3000
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3001
|
+
res.unprocessable_entity_response = out
|
3002
|
+
end
|
3003
|
+
elsif r.status == 429
|
3004
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3005
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3006
|
+
res.too_many_requests_response = out
|
3007
|
+
end
|
3008
|
+
elsif r.status == 500
|
3009
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3010
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3011
|
+
res.internal_server_error_response = out
|
3012
|
+
end
|
3013
|
+
elsif r.status == 501
|
3014
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3015
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3016
|
+
res.not_implemented_response = out
|
3017
|
+
end
|
3018
|
+
elsif r.status == 502
|
3019
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3020
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3021
|
+
res.bad_gateway_response = out
|
3022
|
+
end
|
1122
3023
|
end
|
1123
3024
|
|
1124
3025
|
res
|
1125
3026
|
end
|
1126
3027
|
|
1127
3028
|
|
1128
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListContentRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListContentResponse) }
|
1129
|
-
def list_content(request, retries = nil)
|
3029
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListContentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListContentResponse) }
|
3030
|
+
def list_content(request, retries = nil, timeout_ms = nil)
|
1130
3031
|
# list_content - List Content
|
1131
3032
|
url, params = @sdk_configuration.get_server_details
|
1132
3033
|
base_url = Utils.template_url(url, params)
|
@@ -1149,14 +3050,62 @@ module StackOne
|
|
1149
3050
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1150
3051
|
retry_options[:retry_statuses] = [429, 408]
|
1151
3052
|
|
3053
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3054
|
+
|
3055
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3056
|
+
timeout ||= @sdk_configuration.timeout
|
3057
|
+
|
1152
3058
|
connection = @sdk_configuration.client.dup
|
1153
3059
|
connection.request :retry, retry_options
|
1154
3060
|
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
3061
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3062
|
+
base_url: base_url,
|
3063
|
+
oauth2_scopes: nil,
|
3064
|
+
operation_id: 'lms_list_content',
|
3065
|
+
security_source: @sdk_configuration.security_source
|
3066
|
+
)
|
3067
|
+
|
3068
|
+
error = T.let(nil, T.nilable(StandardError))
|
3069
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3070
|
+
|
3071
|
+
begin
|
3072
|
+
r = connection.get(url) do |req|
|
3073
|
+
req.headers.merge!(headers)
|
3074
|
+
req.options.timeout = timeout unless timeout.nil?
|
3075
|
+
req.params = query_params
|
3076
|
+
Utils.configure_request_security(req, security)
|
3077
|
+
|
3078
|
+
@sdk_configuration.hooks.before_request(
|
3079
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3080
|
+
hook_ctx: hook_ctx
|
3081
|
+
),
|
3082
|
+
request: req
|
3083
|
+
)
|
3084
|
+
end
|
3085
|
+
rescue StandardError => e
|
3086
|
+
error = e
|
3087
|
+
ensure
|
3088
|
+
if r.nil? || Utils.error_status?(r.status)
|
3089
|
+
r = @sdk_configuration.hooks.after_error(
|
3090
|
+
error: error,
|
3091
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3092
|
+
hook_ctx: hook_ctx
|
3093
|
+
),
|
3094
|
+
response: r
|
3095
|
+
)
|
3096
|
+
else
|
3097
|
+
r = @sdk_configuration.hooks.after_success(
|
3098
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3099
|
+
hook_ctx: hook_ctx
|
3100
|
+
),
|
3101
|
+
response: r
|
3102
|
+
)
|
3103
|
+
end
|
3104
|
+
|
3105
|
+
if r.nil?
|
3106
|
+
raise error if !error.nil?
|
3107
|
+
raise 'no response'
|
3108
|
+
end
|
1160
3109
|
end
|
1161
3110
|
|
1162
3111
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1169,18 +3118,75 @@ module StackOne
|
|
1169
3118
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ContentPaginated)
|
1170
3119
|
res.content_paginated = out
|
1171
3120
|
end
|
3121
|
+
elsif r.status == 400
|
3122
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3123
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3124
|
+
res.bad_request_response = out
|
3125
|
+
end
|
3126
|
+
elsif r.status == 401
|
3127
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3128
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3129
|
+
res.unauthorized_response = out
|
3130
|
+
end
|
3131
|
+
elsif r.status == 403
|
3132
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3133
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3134
|
+
res.forbidden_response = out
|
3135
|
+
end
|
3136
|
+
elsif r.status == 404
|
3137
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3138
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3139
|
+
res.not_found_response = out
|
3140
|
+
end
|
1172
3141
|
elsif r.status == 408
|
1173
3142
|
res.headers = r.headers
|
1174
|
-
|
1175
|
-
|
3143
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3144
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3145
|
+
res.request_timed_out_response = out
|
3146
|
+
end
|
3147
|
+
elsif r.status == 409
|
3148
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3149
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3150
|
+
res.conflict_response = out
|
3151
|
+
end
|
3152
|
+
elsif r.status == 412
|
3153
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3154
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3155
|
+
res.precondition_failed_response = out
|
3156
|
+
end
|
3157
|
+
elsif r.status == 422
|
3158
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3159
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3160
|
+
res.unprocessable_entity_response = out
|
3161
|
+
end
|
3162
|
+
elsif r.status == 429
|
3163
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3164
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3165
|
+
res.too_many_requests_response = out
|
3166
|
+
end
|
3167
|
+
elsif r.status == 500
|
3168
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3169
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3170
|
+
res.internal_server_error_response = out
|
3171
|
+
end
|
3172
|
+
elsif r.status == 501
|
3173
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3174
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3175
|
+
res.not_implemented_response = out
|
3176
|
+
end
|
3177
|
+
elsif r.status == 502
|
3178
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3179
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3180
|
+
res.bad_gateway_response = out
|
3181
|
+
end
|
1176
3182
|
end
|
1177
3183
|
|
1178
3184
|
res
|
1179
3185
|
end
|
1180
3186
|
|
1181
3187
|
|
1182
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListCoursesRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListCoursesResponse) }
|
1183
|
-
def list_courses(request, retries = nil)
|
3188
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListCoursesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListCoursesResponse) }
|
3189
|
+
def list_courses(request, retries = nil, timeout_ms = nil)
|
1184
3190
|
# list_courses - List Courses
|
1185
3191
|
url, params = @sdk_configuration.get_server_details
|
1186
3192
|
base_url = Utils.template_url(url, params)
|
@@ -1203,14 +3209,62 @@ module StackOne
|
|
1203
3209
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1204
3210
|
retry_options[:retry_statuses] = [429, 408]
|
1205
3211
|
|
3212
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3213
|
+
|
3214
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3215
|
+
timeout ||= @sdk_configuration.timeout
|
3216
|
+
|
1206
3217
|
connection = @sdk_configuration.client.dup
|
1207
3218
|
connection.request :retry, retry_options
|
1208
3219
|
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
3220
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3221
|
+
base_url: base_url,
|
3222
|
+
oauth2_scopes: nil,
|
3223
|
+
operation_id: 'lms_list_courses',
|
3224
|
+
security_source: @sdk_configuration.security_source
|
3225
|
+
)
|
3226
|
+
|
3227
|
+
error = T.let(nil, T.nilable(StandardError))
|
3228
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3229
|
+
|
3230
|
+
begin
|
3231
|
+
r = connection.get(url) do |req|
|
3232
|
+
req.headers.merge!(headers)
|
3233
|
+
req.options.timeout = timeout unless timeout.nil?
|
3234
|
+
req.params = query_params
|
3235
|
+
Utils.configure_request_security(req, security)
|
3236
|
+
|
3237
|
+
@sdk_configuration.hooks.before_request(
|
3238
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3239
|
+
hook_ctx: hook_ctx
|
3240
|
+
),
|
3241
|
+
request: req
|
3242
|
+
)
|
3243
|
+
end
|
3244
|
+
rescue StandardError => e
|
3245
|
+
error = e
|
3246
|
+
ensure
|
3247
|
+
if r.nil? || Utils.error_status?(r.status)
|
3248
|
+
r = @sdk_configuration.hooks.after_error(
|
3249
|
+
error: error,
|
3250
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3251
|
+
hook_ctx: hook_ctx
|
3252
|
+
),
|
3253
|
+
response: r
|
3254
|
+
)
|
3255
|
+
else
|
3256
|
+
r = @sdk_configuration.hooks.after_success(
|
3257
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3258
|
+
hook_ctx: hook_ctx
|
3259
|
+
),
|
3260
|
+
response: r
|
3261
|
+
)
|
3262
|
+
end
|
3263
|
+
|
3264
|
+
if r.nil?
|
3265
|
+
raise error if !error.nil?
|
3266
|
+
raise 'no response'
|
3267
|
+
end
|
1214
3268
|
end
|
1215
3269
|
|
1216
3270
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1223,18 +3277,75 @@ module StackOne
|
|
1223
3277
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CoursePaginated)
|
1224
3278
|
res.course_paginated = out
|
1225
3279
|
end
|
3280
|
+
elsif r.status == 400
|
3281
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3282
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3283
|
+
res.bad_request_response = out
|
3284
|
+
end
|
3285
|
+
elsif r.status == 401
|
3286
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3287
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3288
|
+
res.unauthorized_response = out
|
3289
|
+
end
|
3290
|
+
elsif r.status == 403
|
3291
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3292
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3293
|
+
res.forbidden_response = out
|
3294
|
+
end
|
3295
|
+
elsif r.status == 404
|
3296
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3297
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3298
|
+
res.not_found_response = out
|
3299
|
+
end
|
1226
3300
|
elsif r.status == 408
|
1227
3301
|
res.headers = r.headers
|
1228
|
-
|
1229
|
-
|
3302
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3303
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3304
|
+
res.request_timed_out_response = out
|
3305
|
+
end
|
3306
|
+
elsif r.status == 409
|
3307
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3308
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3309
|
+
res.conflict_response = out
|
3310
|
+
end
|
3311
|
+
elsif r.status == 412
|
3312
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3313
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3314
|
+
res.precondition_failed_response = out
|
3315
|
+
end
|
3316
|
+
elsif r.status == 422
|
3317
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3318
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3319
|
+
res.unprocessable_entity_response = out
|
3320
|
+
end
|
3321
|
+
elsif r.status == 429
|
3322
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3323
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3324
|
+
res.too_many_requests_response = out
|
3325
|
+
end
|
3326
|
+
elsif r.status == 500
|
3327
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3328
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3329
|
+
res.internal_server_error_response = out
|
3330
|
+
end
|
3331
|
+
elsif r.status == 501
|
3332
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3333
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3334
|
+
res.not_implemented_response = out
|
3335
|
+
end
|
3336
|
+
elsif r.status == 502
|
3337
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3338
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3339
|
+
res.bad_gateway_response = out
|
3340
|
+
end
|
1230
3341
|
end
|
1231
3342
|
|
1232
3343
|
res
|
1233
3344
|
end
|
1234
3345
|
|
1235
3346
|
|
1236
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListSkillsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListSkillsResponse) }
|
1237
|
-
def list_skills(request, retries = nil)
|
3347
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListSkillsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListSkillsResponse) }
|
3348
|
+
def list_skills(request, retries = nil, timeout_ms = nil)
|
1238
3349
|
# list_skills - List Skills
|
1239
3350
|
url, params = @sdk_configuration.get_server_details
|
1240
3351
|
base_url = Utils.template_url(url, params)
|
@@ -1257,14 +3368,62 @@ module StackOne
|
|
1257
3368
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1258
3369
|
retry_options[:retry_statuses] = [429, 408]
|
1259
3370
|
|
3371
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3372
|
+
|
3373
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3374
|
+
timeout ||= @sdk_configuration.timeout
|
3375
|
+
|
1260
3376
|
connection = @sdk_configuration.client.dup
|
1261
3377
|
connection.request :retry, retry_options
|
1262
3378
|
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
3379
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3380
|
+
base_url: base_url,
|
3381
|
+
oauth2_scopes: nil,
|
3382
|
+
operation_id: 'lms_list_skills',
|
3383
|
+
security_source: @sdk_configuration.security_source
|
3384
|
+
)
|
3385
|
+
|
3386
|
+
error = T.let(nil, T.nilable(StandardError))
|
3387
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3388
|
+
|
3389
|
+
begin
|
3390
|
+
r = connection.get(url) do |req|
|
3391
|
+
req.headers.merge!(headers)
|
3392
|
+
req.options.timeout = timeout unless timeout.nil?
|
3393
|
+
req.params = query_params
|
3394
|
+
Utils.configure_request_security(req, security)
|
3395
|
+
|
3396
|
+
@sdk_configuration.hooks.before_request(
|
3397
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3398
|
+
hook_ctx: hook_ctx
|
3399
|
+
),
|
3400
|
+
request: req
|
3401
|
+
)
|
3402
|
+
end
|
3403
|
+
rescue StandardError => e
|
3404
|
+
error = e
|
3405
|
+
ensure
|
3406
|
+
if r.nil? || Utils.error_status?(r.status)
|
3407
|
+
r = @sdk_configuration.hooks.after_error(
|
3408
|
+
error: error,
|
3409
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3410
|
+
hook_ctx: hook_ctx
|
3411
|
+
),
|
3412
|
+
response: r
|
3413
|
+
)
|
3414
|
+
else
|
3415
|
+
r = @sdk_configuration.hooks.after_success(
|
3416
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3417
|
+
hook_ctx: hook_ctx
|
3418
|
+
),
|
3419
|
+
response: r
|
3420
|
+
)
|
3421
|
+
end
|
3422
|
+
|
3423
|
+
if r.nil?
|
3424
|
+
raise error if !error.nil?
|
3425
|
+
raise 'no response'
|
3426
|
+
end
|
1268
3427
|
end
|
1269
3428
|
|
1270
3429
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1277,18 +3436,75 @@ module StackOne
|
|
1277
3436
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::SkillsPaginated)
|
1278
3437
|
res.skills_paginated = out
|
1279
3438
|
end
|
3439
|
+
elsif r.status == 400
|
3440
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3441
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3442
|
+
res.bad_request_response = out
|
3443
|
+
end
|
3444
|
+
elsif r.status == 401
|
3445
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3446
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3447
|
+
res.unauthorized_response = out
|
3448
|
+
end
|
3449
|
+
elsif r.status == 403
|
3450
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3451
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3452
|
+
res.forbidden_response = out
|
3453
|
+
end
|
3454
|
+
elsif r.status == 404
|
3455
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3456
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3457
|
+
res.not_found_response = out
|
3458
|
+
end
|
1280
3459
|
elsif r.status == 408
|
1281
3460
|
res.headers = r.headers
|
1282
|
-
|
1283
|
-
|
3461
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3462
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3463
|
+
res.request_timed_out_response = out
|
3464
|
+
end
|
3465
|
+
elsif r.status == 409
|
3466
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3467
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3468
|
+
res.conflict_response = out
|
3469
|
+
end
|
3470
|
+
elsif r.status == 412
|
3471
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3472
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3473
|
+
res.precondition_failed_response = out
|
3474
|
+
end
|
3475
|
+
elsif r.status == 422
|
3476
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3477
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3478
|
+
res.unprocessable_entity_response = out
|
3479
|
+
end
|
3480
|
+
elsif r.status == 429
|
3481
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3482
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3483
|
+
res.too_many_requests_response = out
|
3484
|
+
end
|
3485
|
+
elsif r.status == 500
|
3486
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3487
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3488
|
+
res.internal_server_error_response = out
|
3489
|
+
end
|
3490
|
+
elsif r.status == 501
|
3491
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3492
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3493
|
+
res.not_implemented_response = out
|
3494
|
+
end
|
3495
|
+
elsif r.status == 502
|
3496
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3497
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3498
|
+
res.bad_gateway_response = out
|
3499
|
+
end
|
1284
3500
|
end
|
1285
3501
|
|
1286
3502
|
res
|
1287
3503
|
end
|
1288
3504
|
|
1289
3505
|
|
1290
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserAssignmentsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListUserAssignmentsResponse) }
|
1291
|
-
def list_user_assignments(request, retries = nil)
|
3506
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserAssignmentsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListUserAssignmentsResponse) }
|
3507
|
+
def list_user_assignments(request, retries = nil, timeout_ms = nil)
|
1292
3508
|
# list_user_assignments - List User Assignments
|
1293
3509
|
url, params = @sdk_configuration.get_server_details
|
1294
3510
|
base_url = Utils.template_url(url, params)
|
@@ -1316,14 +3532,62 @@ module StackOne
|
|
1316
3532
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1317
3533
|
retry_options[:retry_statuses] = [429, 408]
|
1318
3534
|
|
3535
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3536
|
+
|
3537
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3538
|
+
timeout ||= @sdk_configuration.timeout
|
3539
|
+
|
1319
3540
|
connection = @sdk_configuration.client.dup
|
1320
3541
|
connection.request :retry, retry_options
|
1321
3542
|
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
3543
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3544
|
+
base_url: base_url,
|
3545
|
+
oauth2_scopes: nil,
|
3546
|
+
operation_id: 'lms_list_user_assignments',
|
3547
|
+
security_source: @sdk_configuration.security_source
|
3548
|
+
)
|
3549
|
+
|
3550
|
+
error = T.let(nil, T.nilable(StandardError))
|
3551
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3552
|
+
|
3553
|
+
begin
|
3554
|
+
r = connection.get(url) do |req|
|
3555
|
+
req.headers.merge!(headers)
|
3556
|
+
req.options.timeout = timeout unless timeout.nil?
|
3557
|
+
req.params = query_params
|
3558
|
+
Utils.configure_request_security(req, security)
|
3559
|
+
|
3560
|
+
@sdk_configuration.hooks.before_request(
|
3561
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3562
|
+
hook_ctx: hook_ctx
|
3563
|
+
),
|
3564
|
+
request: req
|
3565
|
+
)
|
3566
|
+
end
|
3567
|
+
rescue StandardError => e
|
3568
|
+
error = e
|
3569
|
+
ensure
|
3570
|
+
if r.nil? || Utils.error_status?(r.status)
|
3571
|
+
r = @sdk_configuration.hooks.after_error(
|
3572
|
+
error: error,
|
3573
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3574
|
+
hook_ctx: hook_ctx
|
3575
|
+
),
|
3576
|
+
response: r
|
3577
|
+
)
|
3578
|
+
else
|
3579
|
+
r = @sdk_configuration.hooks.after_success(
|
3580
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3581
|
+
hook_ctx: hook_ctx
|
3582
|
+
),
|
3583
|
+
response: r
|
3584
|
+
)
|
3585
|
+
end
|
3586
|
+
|
3587
|
+
if r.nil?
|
3588
|
+
raise error if !error.nil?
|
3589
|
+
raise 'no response'
|
3590
|
+
end
|
1327
3591
|
end
|
1328
3592
|
|
1329
3593
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1336,18 +3600,75 @@ module StackOne
|
|
1336
3600
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::AssignmentsPaginated)
|
1337
3601
|
res.assignments_paginated = out
|
1338
3602
|
end
|
3603
|
+
elsif r.status == 400
|
3604
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3605
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3606
|
+
res.bad_request_response = out
|
3607
|
+
end
|
3608
|
+
elsif r.status == 401
|
3609
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3610
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3611
|
+
res.unauthorized_response = out
|
3612
|
+
end
|
3613
|
+
elsif r.status == 403
|
3614
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3615
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3616
|
+
res.forbidden_response = out
|
3617
|
+
end
|
3618
|
+
elsif r.status == 404
|
3619
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3620
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3621
|
+
res.not_found_response = out
|
3622
|
+
end
|
1339
3623
|
elsif r.status == 408
|
1340
3624
|
res.headers = r.headers
|
1341
|
-
|
1342
|
-
|
3625
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3626
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3627
|
+
res.request_timed_out_response = out
|
3628
|
+
end
|
3629
|
+
elsif r.status == 409
|
3630
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3631
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3632
|
+
res.conflict_response = out
|
3633
|
+
end
|
3634
|
+
elsif r.status == 412
|
3635
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3636
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3637
|
+
res.precondition_failed_response = out
|
3638
|
+
end
|
3639
|
+
elsif r.status == 422
|
3640
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3641
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3642
|
+
res.unprocessable_entity_response = out
|
3643
|
+
end
|
3644
|
+
elsif r.status == 429
|
3645
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3646
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3647
|
+
res.too_many_requests_response = out
|
3648
|
+
end
|
3649
|
+
elsif r.status == 500
|
3650
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3651
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3652
|
+
res.internal_server_error_response = out
|
3653
|
+
end
|
3654
|
+
elsif r.status == 501
|
3655
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3656
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3657
|
+
res.not_implemented_response = out
|
3658
|
+
end
|
3659
|
+
elsif r.status == 502
|
3660
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3661
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3662
|
+
res.bad_gateway_response = out
|
3663
|
+
end
|
1343
3664
|
end
|
1344
3665
|
|
1345
3666
|
res
|
1346
3667
|
end
|
1347
3668
|
|
1348
3669
|
|
1349
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserCompletionsRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListUserCompletionsResponse) }
|
1350
|
-
def list_user_completions(request, retries = nil)
|
3670
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserCompletionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListUserCompletionsResponse) }
|
3671
|
+
def list_user_completions(request, retries = nil, timeout_ms = nil)
|
1351
3672
|
# list_user_completions - List User Completions
|
1352
3673
|
url, params = @sdk_configuration.get_server_details
|
1353
3674
|
base_url = Utils.template_url(url, params)
|
@@ -1375,14 +3696,62 @@ module StackOne
|
|
1375
3696
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1376
3697
|
retry_options[:retry_statuses] = [429, 408]
|
1377
3698
|
|
3699
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3700
|
+
|
3701
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3702
|
+
timeout ||= @sdk_configuration.timeout
|
3703
|
+
|
1378
3704
|
connection = @sdk_configuration.client.dup
|
1379
3705
|
connection.request :retry, retry_options
|
1380
3706
|
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
3707
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3708
|
+
base_url: base_url,
|
3709
|
+
oauth2_scopes: nil,
|
3710
|
+
operation_id: 'lms_list_user_completions',
|
3711
|
+
security_source: @sdk_configuration.security_source
|
3712
|
+
)
|
3713
|
+
|
3714
|
+
error = T.let(nil, T.nilable(StandardError))
|
3715
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3716
|
+
|
3717
|
+
begin
|
3718
|
+
r = connection.get(url) do |req|
|
3719
|
+
req.headers.merge!(headers)
|
3720
|
+
req.options.timeout = timeout unless timeout.nil?
|
3721
|
+
req.params = query_params
|
3722
|
+
Utils.configure_request_security(req, security)
|
3723
|
+
|
3724
|
+
@sdk_configuration.hooks.before_request(
|
3725
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3726
|
+
hook_ctx: hook_ctx
|
3727
|
+
),
|
3728
|
+
request: req
|
3729
|
+
)
|
3730
|
+
end
|
3731
|
+
rescue StandardError => e
|
3732
|
+
error = e
|
3733
|
+
ensure
|
3734
|
+
if r.nil? || Utils.error_status?(r.status)
|
3735
|
+
r = @sdk_configuration.hooks.after_error(
|
3736
|
+
error: error,
|
3737
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3738
|
+
hook_ctx: hook_ctx
|
3739
|
+
),
|
3740
|
+
response: r
|
3741
|
+
)
|
3742
|
+
else
|
3743
|
+
r = @sdk_configuration.hooks.after_success(
|
3744
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3745
|
+
hook_ctx: hook_ctx
|
3746
|
+
),
|
3747
|
+
response: r
|
3748
|
+
)
|
3749
|
+
end
|
3750
|
+
|
3751
|
+
if r.nil?
|
3752
|
+
raise error if !error.nil?
|
3753
|
+
raise 'no response'
|
3754
|
+
end
|
1386
3755
|
end
|
1387
3756
|
|
1388
3757
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1395,18 +3764,75 @@ module StackOne
|
|
1395
3764
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::CompletionsPaginated)
|
1396
3765
|
res.completions_paginated = out
|
1397
3766
|
end
|
3767
|
+
elsif r.status == 400
|
3768
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3769
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3770
|
+
res.bad_request_response = out
|
3771
|
+
end
|
3772
|
+
elsif r.status == 401
|
3773
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3774
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3775
|
+
res.unauthorized_response = out
|
3776
|
+
end
|
3777
|
+
elsif r.status == 403
|
3778
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3779
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3780
|
+
res.forbidden_response = out
|
3781
|
+
end
|
3782
|
+
elsif r.status == 404
|
3783
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3784
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3785
|
+
res.not_found_response = out
|
3786
|
+
end
|
1398
3787
|
elsif r.status == 408
|
1399
3788
|
res.headers = r.headers
|
1400
|
-
|
1401
|
-
|
3789
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3790
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3791
|
+
res.request_timed_out_response = out
|
3792
|
+
end
|
3793
|
+
elsif r.status == 409
|
3794
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3795
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3796
|
+
res.conflict_response = out
|
3797
|
+
end
|
3798
|
+
elsif r.status == 412
|
3799
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3800
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3801
|
+
res.precondition_failed_response = out
|
3802
|
+
end
|
3803
|
+
elsif r.status == 422
|
3804
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3805
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3806
|
+
res.unprocessable_entity_response = out
|
3807
|
+
end
|
3808
|
+
elsif r.status == 429
|
3809
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3810
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3811
|
+
res.too_many_requests_response = out
|
3812
|
+
end
|
3813
|
+
elsif r.status == 500
|
3814
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3815
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3816
|
+
res.internal_server_error_response = out
|
3817
|
+
end
|
3818
|
+
elsif r.status == 501
|
3819
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3820
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3821
|
+
res.not_implemented_response = out
|
3822
|
+
end
|
3823
|
+
elsif r.status == 502
|
3824
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3825
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3826
|
+
res.bad_gateway_response = out
|
3827
|
+
end
|
1402
3828
|
end
|
1403
3829
|
|
1404
3830
|
res
|
1405
3831
|
end
|
1406
3832
|
|
1407
3833
|
|
1408
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListUsersRequest), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsListUsersResponse) }
|
1409
|
-
def list_users(request, retries = nil)
|
3834
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListUsersRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListUsersResponse) }
|
3835
|
+
def list_users(request, retries = nil, timeout_ms = nil)
|
1410
3836
|
# list_users - List Users
|
1411
3837
|
url, params = @sdk_configuration.get_server_details
|
1412
3838
|
base_url = Utils.template_url(url, params)
|
@@ -1429,14 +3855,62 @@ module StackOne
|
|
1429
3855
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1430
3856
|
retry_options[:retry_statuses] = [429, 408]
|
1431
3857
|
|
3858
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
3859
|
+
|
3860
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
3861
|
+
timeout ||= @sdk_configuration.timeout
|
3862
|
+
|
1432
3863
|
connection = @sdk_configuration.client.dup
|
1433
3864
|
connection.request :retry, retry_options
|
1434
3865
|
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
3866
|
+
hook_ctx = SDKHooks::HookContext.new(
|
3867
|
+
base_url: base_url,
|
3868
|
+
oauth2_scopes: nil,
|
3869
|
+
operation_id: 'lms_list_users',
|
3870
|
+
security_source: @sdk_configuration.security_source
|
3871
|
+
)
|
3872
|
+
|
3873
|
+
error = T.let(nil, T.nilable(StandardError))
|
3874
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
3875
|
+
|
3876
|
+
begin
|
3877
|
+
r = connection.get(url) do |req|
|
3878
|
+
req.headers.merge!(headers)
|
3879
|
+
req.options.timeout = timeout unless timeout.nil?
|
3880
|
+
req.params = query_params
|
3881
|
+
Utils.configure_request_security(req, security)
|
3882
|
+
|
3883
|
+
@sdk_configuration.hooks.before_request(
|
3884
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
3885
|
+
hook_ctx: hook_ctx
|
3886
|
+
),
|
3887
|
+
request: req
|
3888
|
+
)
|
3889
|
+
end
|
3890
|
+
rescue StandardError => e
|
3891
|
+
error = e
|
3892
|
+
ensure
|
3893
|
+
if r.nil? || Utils.error_status?(r.status)
|
3894
|
+
r = @sdk_configuration.hooks.after_error(
|
3895
|
+
error: error,
|
3896
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
3897
|
+
hook_ctx: hook_ctx
|
3898
|
+
),
|
3899
|
+
response: r
|
3900
|
+
)
|
3901
|
+
else
|
3902
|
+
r = @sdk_configuration.hooks.after_success(
|
3903
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
3904
|
+
hook_ctx: hook_ctx
|
3905
|
+
),
|
3906
|
+
response: r
|
3907
|
+
)
|
3908
|
+
end
|
3909
|
+
|
3910
|
+
if r.nil?
|
3911
|
+
raise error if !error.nil?
|
3912
|
+
raise 'no response'
|
3913
|
+
end
|
1440
3914
|
end
|
1441
3915
|
|
1442
3916
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1449,18 +3923,75 @@ module StackOne
|
|
1449
3923
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UsersPaginated)
|
1450
3924
|
res.users_paginated = out
|
1451
3925
|
end
|
3926
|
+
elsif r.status == 400
|
3927
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3928
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
3929
|
+
res.bad_request_response = out
|
3930
|
+
end
|
3931
|
+
elsif r.status == 401
|
3932
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3933
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
3934
|
+
res.unauthorized_response = out
|
3935
|
+
end
|
3936
|
+
elsif r.status == 403
|
3937
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3938
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
3939
|
+
res.forbidden_response = out
|
3940
|
+
end
|
3941
|
+
elsif r.status == 404
|
3942
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3943
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
3944
|
+
res.not_found_response = out
|
3945
|
+
end
|
1452
3946
|
elsif r.status == 408
|
1453
3947
|
res.headers = r.headers
|
1454
|
-
|
1455
|
-
|
3948
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3949
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
3950
|
+
res.request_timed_out_response = out
|
3951
|
+
end
|
3952
|
+
elsif r.status == 409
|
3953
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3954
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
3955
|
+
res.conflict_response = out
|
3956
|
+
end
|
3957
|
+
elsif r.status == 412
|
3958
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3959
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
3960
|
+
res.precondition_failed_response = out
|
3961
|
+
end
|
3962
|
+
elsif r.status == 422
|
3963
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3964
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
3965
|
+
res.unprocessable_entity_response = out
|
3966
|
+
end
|
3967
|
+
elsif r.status == 429
|
3968
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3969
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
3970
|
+
res.too_many_requests_response = out
|
3971
|
+
end
|
3972
|
+
elsif r.status == 500
|
3973
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3974
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
3975
|
+
res.internal_server_error_response = out
|
3976
|
+
end
|
3977
|
+
elsif r.status == 501
|
3978
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3979
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
3980
|
+
res.not_implemented_response = out
|
3981
|
+
end
|
3982
|
+
elsif r.status == 502
|
3983
|
+
if Utils.match_content_type(content_type, 'application/json')
|
3984
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
3985
|
+
res.bad_gateway_response = out
|
3986
|
+
end
|
1456
3987
|
end
|
1457
3988
|
|
1458
3989
|
res
|
1459
3990
|
end
|
1460
3991
|
|
1461
3992
|
|
1462
|
-
sig { params(lms_create_collection_request_dto: ::StackOne::Shared::LmsCreateCollectionRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsUpdateCollectionResponse) }
|
1463
|
-
def update_collection(lms_create_collection_request_dto, id, x_account_id, retries = nil)
|
3993
|
+
sig { params(lms_create_collection_request_dto: ::StackOne::Shared::LmsCreateCollectionRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsUpdateCollectionResponse) }
|
3994
|
+
def update_collection(lms_create_collection_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1464
3995
|
# update_collection - Update Collection
|
1465
3996
|
request = ::StackOne::Operations::LmsUpdateCollectionRequest.new(
|
1466
3997
|
|
@@ -1480,6 +4011,14 @@ module StackOne
|
|
1480
4011
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_collection_request_dto, :json)
|
1481
4012
|
headers['content-type'] = req_content_type
|
1482
4013
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
4014
|
+
|
4015
|
+
if form
|
4016
|
+
body = Utils.encode_form(form)
|
4017
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
4018
|
+
body = URI.encode_www_form(data)
|
4019
|
+
else
|
4020
|
+
body = data
|
4021
|
+
end
|
1483
4022
|
headers['Accept'] = 'application/json'
|
1484
4023
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1485
4024
|
retries ||= @sdk_configuration.retry_config
|
@@ -1496,19 +4035,61 @@ module StackOne
|
|
1496
4035
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1497
4036
|
retry_options[:retry_statuses] = [429, 408]
|
1498
4037
|
|
4038
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
4039
|
+
|
4040
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
4041
|
+
timeout ||= @sdk_configuration.timeout
|
4042
|
+
|
1499
4043
|
connection = @sdk_configuration.client.dup
|
1500
4044
|
connection.request :retry, retry_options
|
1501
4045
|
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
4046
|
+
hook_ctx = SDKHooks::HookContext.new(
|
4047
|
+
base_url: base_url,
|
4048
|
+
oauth2_scopes: nil,
|
4049
|
+
operation_id: 'lms_update_collection',
|
4050
|
+
security_source: @sdk_configuration.security_source
|
4051
|
+
)
|
4052
|
+
|
4053
|
+
error = T.let(nil, T.nilable(StandardError))
|
4054
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
4055
|
+
|
4056
|
+
begin
|
4057
|
+
r = connection.patch(url) do |req|
|
4058
|
+
req.body = body
|
4059
|
+
req.headers.merge!(headers)
|
4060
|
+
req.options.timeout = timeout unless timeout.nil?
|
4061
|
+
Utils.configure_request_security(req, security)
|
4062
|
+
|
4063
|
+
@sdk_configuration.hooks.before_request(
|
4064
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
4065
|
+
hook_ctx: hook_ctx
|
4066
|
+
),
|
4067
|
+
request: req
|
4068
|
+
)
|
4069
|
+
end
|
4070
|
+
rescue StandardError => e
|
4071
|
+
error = e
|
4072
|
+
ensure
|
4073
|
+
if r.nil? || Utils.error_status?(r.status)
|
4074
|
+
r = @sdk_configuration.hooks.after_error(
|
4075
|
+
error: error,
|
4076
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
4077
|
+
hook_ctx: hook_ctx
|
4078
|
+
),
|
4079
|
+
response: r
|
4080
|
+
)
|
1510
4081
|
else
|
1511
|
-
|
4082
|
+
r = @sdk_configuration.hooks.after_success(
|
4083
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
4084
|
+
hook_ctx: hook_ctx
|
4085
|
+
),
|
4086
|
+
response: r
|
4087
|
+
)
|
4088
|
+
end
|
4089
|
+
|
4090
|
+
if r.nil?
|
4091
|
+
raise error if !error.nil?
|
4092
|
+
raise 'no response'
|
1512
4093
|
end
|
1513
4094
|
end
|
1514
4095
|
|
@@ -1522,18 +4103,75 @@ module StackOne
|
|
1522
4103
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UpdateResult)
|
1523
4104
|
res.update_result = out
|
1524
4105
|
end
|
4106
|
+
elsif r.status == 400
|
4107
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4108
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
4109
|
+
res.bad_request_response = out
|
4110
|
+
end
|
4111
|
+
elsif r.status == 401
|
4112
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4113
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
4114
|
+
res.unauthorized_response = out
|
4115
|
+
end
|
4116
|
+
elsif r.status == 403
|
4117
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4118
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
4119
|
+
res.forbidden_response = out
|
4120
|
+
end
|
4121
|
+
elsif r.status == 404
|
4122
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4123
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
4124
|
+
res.not_found_response = out
|
4125
|
+
end
|
1525
4126
|
elsif r.status == 408
|
1526
4127
|
res.headers = r.headers
|
1527
|
-
|
1528
|
-
|
4128
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4129
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
4130
|
+
res.request_timed_out_response = out
|
4131
|
+
end
|
4132
|
+
elsif r.status == 409
|
4133
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4134
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
4135
|
+
res.conflict_response = out
|
4136
|
+
end
|
4137
|
+
elsif r.status == 412
|
4138
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4139
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
4140
|
+
res.precondition_failed_response = out
|
4141
|
+
end
|
4142
|
+
elsif r.status == 422
|
4143
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4144
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
4145
|
+
res.unprocessable_entity_response = out
|
4146
|
+
end
|
4147
|
+
elsif r.status == 429
|
4148
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4149
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
4150
|
+
res.too_many_requests_response = out
|
4151
|
+
end
|
4152
|
+
elsif r.status == 500
|
4153
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4154
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
4155
|
+
res.internal_server_error_response = out
|
4156
|
+
end
|
4157
|
+
elsif r.status == 501
|
4158
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4159
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
4160
|
+
res.not_implemented_response = out
|
4161
|
+
end
|
4162
|
+
elsif r.status == 502
|
4163
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4164
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
4165
|
+
res.bad_gateway_response = out
|
4166
|
+
end
|
1529
4167
|
end
|
1530
4168
|
|
1531
4169
|
res
|
1532
4170
|
end
|
1533
4171
|
|
1534
4172
|
|
1535
|
-
sig { params(lms_upsert_content_request_dto: ::StackOne::Shared::LmsUpsertContentRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsUpsertContentResponse) }
|
1536
|
-
def upsert_content(lms_upsert_content_request_dto, x_account_id, retries = nil)
|
4173
|
+
sig { params(lms_upsert_content_request_dto: ::StackOne::Shared::LmsUpsertContentRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsUpsertContentResponse) }
|
4174
|
+
def upsert_content(lms_upsert_content_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
1537
4175
|
# upsert_content - Upsert Content
|
1538
4176
|
request = ::StackOne::Operations::LmsUpsertContentRequest.new(
|
1539
4177
|
|
@@ -1547,6 +4185,14 @@ module StackOne
|
|
1547
4185
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_upsert_content_request_dto, :json)
|
1548
4186
|
headers['content-type'] = req_content_type
|
1549
4187
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
4188
|
+
|
4189
|
+
if form
|
4190
|
+
body = Utils.encode_form(form)
|
4191
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
4192
|
+
body = URI.encode_www_form(data)
|
4193
|
+
else
|
4194
|
+
body = data
|
4195
|
+
end
|
1550
4196
|
headers['Accept'] = 'application/json'
|
1551
4197
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1552
4198
|
retries ||= @sdk_configuration.retry_config
|
@@ -1563,19 +4209,61 @@ module StackOne
|
|
1563
4209
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1564
4210
|
retry_options[:retry_statuses] = [429, 408]
|
1565
4211
|
|
4212
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
4213
|
+
|
4214
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
4215
|
+
timeout ||= @sdk_configuration.timeout
|
4216
|
+
|
1566
4217
|
connection = @sdk_configuration.client.dup
|
1567
4218
|
connection.request :retry, retry_options
|
1568
4219
|
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
4220
|
+
hook_ctx = SDKHooks::HookContext.new(
|
4221
|
+
base_url: base_url,
|
4222
|
+
oauth2_scopes: nil,
|
4223
|
+
operation_id: 'lms_upsert_content',
|
4224
|
+
security_source: @sdk_configuration.security_source
|
4225
|
+
)
|
4226
|
+
|
4227
|
+
error = T.let(nil, T.nilable(StandardError))
|
4228
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
4229
|
+
|
4230
|
+
begin
|
4231
|
+
r = connection.put(url) do |req|
|
4232
|
+
req.body = body
|
4233
|
+
req.headers.merge!(headers)
|
4234
|
+
req.options.timeout = timeout unless timeout.nil?
|
4235
|
+
Utils.configure_request_security(req, security)
|
4236
|
+
|
4237
|
+
@sdk_configuration.hooks.before_request(
|
4238
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
4239
|
+
hook_ctx: hook_ctx
|
4240
|
+
),
|
4241
|
+
request: req
|
4242
|
+
)
|
4243
|
+
end
|
4244
|
+
rescue StandardError => e
|
4245
|
+
error = e
|
4246
|
+
ensure
|
4247
|
+
if r.nil? || Utils.error_status?(r.status)
|
4248
|
+
r = @sdk_configuration.hooks.after_error(
|
4249
|
+
error: error,
|
4250
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
4251
|
+
hook_ctx: hook_ctx
|
4252
|
+
),
|
4253
|
+
response: r
|
4254
|
+
)
|
1577
4255
|
else
|
1578
|
-
|
4256
|
+
r = @sdk_configuration.hooks.after_success(
|
4257
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
4258
|
+
hook_ctx: hook_ctx
|
4259
|
+
),
|
4260
|
+
response: r
|
4261
|
+
)
|
4262
|
+
end
|
4263
|
+
|
4264
|
+
if r.nil?
|
4265
|
+
raise error if !error.nil?
|
4266
|
+
raise 'no response'
|
1579
4267
|
end
|
1580
4268
|
end
|
1581
4269
|
|
@@ -1589,18 +4277,75 @@ module StackOne
|
|
1589
4277
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UpsertResult)
|
1590
4278
|
res.upsert_result = out
|
1591
4279
|
end
|
4280
|
+
elsif r.status == 400
|
4281
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4282
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
4283
|
+
res.bad_request_response = out
|
4284
|
+
end
|
4285
|
+
elsif r.status == 401
|
4286
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4287
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
4288
|
+
res.unauthorized_response = out
|
4289
|
+
end
|
4290
|
+
elsif r.status == 403
|
4291
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4292
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
4293
|
+
res.forbidden_response = out
|
4294
|
+
end
|
4295
|
+
elsif r.status == 404
|
4296
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4297
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
4298
|
+
res.not_found_response = out
|
4299
|
+
end
|
1592
4300
|
elsif r.status == 408
|
1593
4301
|
res.headers = r.headers
|
1594
|
-
|
1595
|
-
|
4302
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4303
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
4304
|
+
res.request_timed_out_response = out
|
4305
|
+
end
|
4306
|
+
elsif r.status == 409
|
4307
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4308
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
4309
|
+
res.conflict_response = out
|
4310
|
+
end
|
4311
|
+
elsif r.status == 412
|
4312
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4313
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
4314
|
+
res.precondition_failed_response = out
|
4315
|
+
end
|
4316
|
+
elsif r.status == 422
|
4317
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4318
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
4319
|
+
res.unprocessable_entity_response = out
|
4320
|
+
end
|
4321
|
+
elsif r.status == 429
|
4322
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4323
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
4324
|
+
res.too_many_requests_response = out
|
4325
|
+
end
|
4326
|
+
elsif r.status == 500
|
4327
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4328
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
4329
|
+
res.internal_server_error_response = out
|
4330
|
+
end
|
4331
|
+
elsif r.status == 501
|
4332
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4333
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
4334
|
+
res.not_implemented_response = out
|
4335
|
+
end
|
4336
|
+
elsif r.status == 502
|
4337
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4338
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
4339
|
+
res.bad_gateway_response = out
|
4340
|
+
end
|
1596
4341
|
end
|
1597
4342
|
|
1598
4343
|
res
|
1599
4344
|
end
|
1600
4345
|
|
1601
4346
|
|
1602
|
-
sig { params(lms_upsert_course_request_dto: ::StackOne::Shared::LmsUpsertCourseRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::LmsUpsertCourseResponse) }
|
1603
|
-
def upsert_course(lms_upsert_course_request_dto, x_account_id, retries = nil)
|
4347
|
+
sig { params(lms_upsert_course_request_dto: ::StackOne::Shared::LmsUpsertCourseRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsUpsertCourseResponse) }
|
4348
|
+
def upsert_course(lms_upsert_course_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
1604
4349
|
# upsert_course - Upsert Course
|
1605
4350
|
request = ::StackOne::Operations::LmsUpsertCourseRequest.new(
|
1606
4351
|
|
@@ -1614,6 +4359,14 @@ module StackOne
|
|
1614
4359
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_upsert_course_request_dto, :json)
|
1615
4360
|
headers['content-type'] = req_content_type
|
1616
4361
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
4362
|
+
|
4363
|
+
if form
|
4364
|
+
body = Utils.encode_form(form)
|
4365
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
4366
|
+
body = URI.encode_www_form(data)
|
4367
|
+
else
|
4368
|
+
body = data
|
4369
|
+
end
|
1617
4370
|
headers['Accept'] = 'application/json'
|
1618
4371
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1619
4372
|
retries ||= @sdk_configuration.retry_config
|
@@ -1630,19 +4383,61 @@ module StackOne
|
|
1630
4383
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1631
4384
|
retry_options[:retry_statuses] = [429, 408]
|
1632
4385
|
|
4386
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
4387
|
+
|
4388
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
4389
|
+
timeout ||= @sdk_configuration.timeout
|
4390
|
+
|
1633
4391
|
connection = @sdk_configuration.client.dup
|
1634
4392
|
connection.request :retry, retry_options
|
1635
4393
|
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
4394
|
+
hook_ctx = SDKHooks::HookContext.new(
|
4395
|
+
base_url: base_url,
|
4396
|
+
oauth2_scopes: nil,
|
4397
|
+
operation_id: 'lms_upsert_course',
|
4398
|
+
security_source: @sdk_configuration.security_source
|
4399
|
+
)
|
4400
|
+
|
4401
|
+
error = T.let(nil, T.nilable(StandardError))
|
4402
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
4403
|
+
|
4404
|
+
begin
|
4405
|
+
r = connection.put(url) do |req|
|
4406
|
+
req.body = body
|
4407
|
+
req.headers.merge!(headers)
|
4408
|
+
req.options.timeout = timeout unless timeout.nil?
|
4409
|
+
Utils.configure_request_security(req, security)
|
4410
|
+
|
4411
|
+
@sdk_configuration.hooks.before_request(
|
4412
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
4413
|
+
hook_ctx: hook_ctx
|
4414
|
+
),
|
4415
|
+
request: req
|
4416
|
+
)
|
4417
|
+
end
|
4418
|
+
rescue StandardError => e
|
4419
|
+
error = e
|
4420
|
+
ensure
|
4421
|
+
if r.nil? || Utils.error_status?(r.status)
|
4422
|
+
r = @sdk_configuration.hooks.after_error(
|
4423
|
+
error: error,
|
4424
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
4425
|
+
hook_ctx: hook_ctx
|
4426
|
+
),
|
4427
|
+
response: r
|
4428
|
+
)
|
1644
4429
|
else
|
1645
|
-
|
4430
|
+
r = @sdk_configuration.hooks.after_success(
|
4431
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
4432
|
+
hook_ctx: hook_ctx
|
4433
|
+
),
|
4434
|
+
response: r
|
4435
|
+
)
|
4436
|
+
end
|
4437
|
+
|
4438
|
+
if r.nil?
|
4439
|
+
raise error if !error.nil?
|
4440
|
+
raise 'no response'
|
1646
4441
|
end
|
1647
4442
|
end
|
1648
4443
|
|
@@ -1656,10 +4451,67 @@ module StackOne
|
|
1656
4451
|
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UpsertResult)
|
1657
4452
|
res.upsert_result = out
|
1658
4453
|
end
|
4454
|
+
elsif r.status == 400
|
4455
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4456
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadRequestResponse)
|
4457
|
+
res.bad_request_response = out
|
4458
|
+
end
|
4459
|
+
elsif r.status == 401
|
4460
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4461
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnauthorizedResponse)
|
4462
|
+
res.unauthorized_response = out
|
4463
|
+
end
|
4464
|
+
elsif r.status == 403
|
4465
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4466
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ForbiddenResponse)
|
4467
|
+
res.forbidden_response = out
|
4468
|
+
end
|
4469
|
+
elsif r.status == 404
|
4470
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4471
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotFoundResponse)
|
4472
|
+
res.not_found_response = out
|
4473
|
+
end
|
1659
4474
|
elsif r.status == 408
|
1660
4475
|
res.headers = r.headers
|
1661
|
-
|
1662
|
-
|
4476
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4477
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::RequestTimedOutResponse)
|
4478
|
+
res.request_timed_out_response = out
|
4479
|
+
end
|
4480
|
+
elsif r.status == 409
|
4481
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4482
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::ConflictResponse)
|
4483
|
+
res.conflict_response = out
|
4484
|
+
end
|
4485
|
+
elsif r.status == 412
|
4486
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4487
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::PreconditionFailedResponse)
|
4488
|
+
res.precondition_failed_response = out
|
4489
|
+
end
|
4490
|
+
elsif r.status == 422
|
4491
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4492
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::UnprocessableEntityResponse)
|
4493
|
+
res.unprocessable_entity_response = out
|
4494
|
+
end
|
4495
|
+
elsif r.status == 429
|
4496
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4497
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::TooManyRequestsResponse)
|
4498
|
+
res.too_many_requests_response = out
|
4499
|
+
end
|
4500
|
+
elsif r.status == 500
|
4501
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4502
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::InternalServerErrorResponse)
|
4503
|
+
res.internal_server_error_response = out
|
4504
|
+
end
|
4505
|
+
elsif r.status == 501
|
4506
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4507
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::NotImplementedResponse)
|
4508
|
+
res.not_implemented_response = out
|
4509
|
+
end
|
4510
|
+
elsif r.status == 502
|
4511
|
+
if Utils.match_content_type(content_type, 'application/json')
|
4512
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::StackOne::Shared::BadGatewayResponse)
|
4513
|
+
res.bad_gateway_response = out
|
4514
|
+
end
|
1663
4515
|
end
|
1664
4516
|
|
1665
4517
|
res
|