stackone_client 0.5.9 → 0.7.0
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 +361 -36
- data/lib/stack_one/ats.rb +5301 -652
- data/lib/stack_one/connect_sessions.rb +157 -22
- data/lib/stack_one/connectors.rb +145 -14
- data/lib/stack_one/crm.rb +725 -78
- data/lib/stack_one/hris.rb +4335 -462
- data/lib/stack_one/iam.rb +805 -56
- data/lib/stack_one/lms.rb +1967 -220
- data/lib/stack_one/marketing.rb +1921 -230
- 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_document_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_note_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_offer_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_scheduled_interview_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_application_scorecard_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_assessments_package_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_assessments_request_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_assessments_result_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_background_check_package_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_background_check_request_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_background_check_result_request.rb +1 -1
- 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_note_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_candidate_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_department_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_interview_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_interview_stage_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_job_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_get_job_posting_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_job_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_list_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_location_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_offer_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_rejected_reason_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_get_user_request.rb +1 -1
- data/lib/stack_one/models/operations/ats_list_application_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_application_documents_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_application_notes_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_application_scorecards_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_applications_offers_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_applications_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_applications_scheduled_interviews_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_assessments_packages_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_background_check_packages_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_background_check_request_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_candidate_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_candidate_notes_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_candidates_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_departments_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_interview_stages_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_interviews_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_job_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_job_postings_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_jobs_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_lists_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_locations_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_offers_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_rejected_reasons_request.rb +2 -2
- data/lib/stack_one/models/operations/ats_list_users_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_get_account_request.rb +1 -1
- data/lib/stack_one/models/operations/crm_get_contact_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_get_contact_request.rb +1 -1
- data/lib/stack_one/models/operations/crm_get_list_request.rb +1 -1
- data/lib/stack_one/models/operations/crm_list_accounts_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_list_contact_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_list_contacts_request.rb +2 -2
- data/lib/stack_one/models/operations/crm_list_lists_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_get_benefit_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_company_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_cost_center_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_department_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_custom_field_definition_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_get_employee_document_category_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_document_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_employment_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_skill_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employee_time_off_balance_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employees_time_off_request_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employees_work_eligibility_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_employment_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_job_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_location_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_location_response.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_team_group_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_entries_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_off_policy_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_off_request_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_get_time_off_type_request.rb +1 -1
- data/lib/stack_one/models/operations/hris_list_benefits_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_companies_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_cost_center_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_department_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_categories_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_custom_field_definitions_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_documents_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_employments_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_skills_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_balances_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_time_off_requests_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employee_work_eligibility_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employees_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_employments_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_jobs_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_locations_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_locations_response.rb +1 -1
- data/lib/stack_one/models/operations/hris_list_team_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_entries_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_off_policies_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_off_requests_request.rb +2 -2
- data/lib/stack_one/models/operations/hris_list_time_off_types_request.rb +2 -2
- 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 +36 -0
- data/lib/stack_one/models/operations/iam_delete_user_request.rb +27 -0
- data/lib/stack_one/models/operations/iam_delete_user_response.rb +36 -0
- data/lib/stack_one/models/operations/iam_get_group_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_get_policy_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_get_role_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_get_user_request.rb +1 -1
- data/lib/stack_one/models/operations/iam_list_groups_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_list_policies_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_list_roles_request.rb +2 -2
- data/lib/stack_one/models/operations/iam_list_users_request.rb +2 -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 +36 -0
- data/lib/stack_one/models/operations/lms_get_assignment_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_category_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_completion_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_content_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_course_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_skill_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_user_assignment_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_user_completion_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_get_user_request.rb +1 -1
- data/lib/stack_one/models/operations/lms_list_assignments_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_categories_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_completions_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_content_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_courses_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_skills_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_user_assignments_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_user_completions_request.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_users_queryparam_filter.rb +5 -2
- data/lib/stack_one/models/operations/lms_list_users_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_get_campaign_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_content_block_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_email_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_in_app_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_omni_channel_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_push_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_get_sms_template_request.rb +1 -1
- data/lib/stack_one/models/operations/marketing_list_campaigns_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_content_blocks_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_email_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_in_app_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_omni_channel_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_push_templates_request.rb +2 -2
- data/lib/stack_one/models/operations/marketing_list_sms_templates_request.rb +2 -2
- data/lib/stack_one/models/operations.rb +6 -0
- 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/categories.rb +2 -0
- data/lib/stack_one/models/shared/company.rb +5 -2
- data/lib/stack_one/models/shared/connectorsmeta_category.rb +2 -0
- data/lib/stack_one/models/shared/connectsessioncreate_categories.rb +2 -0
- data/lib/stack_one/models/shared/connectsessiontokenauthlink_categories.rb +2 -0
- data/lib/stack_one/models/shared/createemploymentapimodel.rb +4 -5
- data/lib/stack_one/models/shared/employee_company.rb +5 -2
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto.rb +10 -8
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_employment.rb +56 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_pay_frequency.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_pay_period.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_contract_type.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_employment_contract_type_value.rb +20 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_employment_type_value.rb +33 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_pay_period_value.rb +29 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_type.rb +27 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_employment_value.rb +31 -0
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_state.rb +3 -3
- data/lib/stack_one/models/shared/hriscreateemploymentrequestdto.rb +4 -5
- 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/hrisupdateemployeerequestdto.rb +8 -8
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_employment.rb +56 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_pay_frequency.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_pay_period.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_contract_type.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_employment_contract_type_value.rb +20 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_employment_type_value.rb +33 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_pay_period_value.rb +29 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_type.rb +27 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_employment_value.rb +31 -0
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_state.rb +3 -3
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_state.rb +3 -3
- 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/job.rb +5 -2
- data/lib/stack_one/models/shared/linkedaccountmeta_category.rb +2 -0
- data/lib/stack_one/models/shared/rawresponse.rb +2 -2
- data/lib/stack_one/models/shared/state.rb +3 -3
- data/lib/stack_one/models/shared/timeoff.rb +2 -0
- data/lib/stack_one/models/shared/timeoff_type.rb +2 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel.rb +8 -8
- data/lib/stack_one/models/shared/updateemployeeapimodel_employment.rb +56 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_frequency.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_pay_period.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_contract_type.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_contract_type_value.rb +20 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_employment_type_value.rb +33 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_pay_period_value.rb +29 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_type.rb +27 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_employment_value.rb +31 -0
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_state.rb +3 -3
- data/lib/stack_one/models/shared/updateemployeeapimodel_state.rb +3 -3
- data/lib/stack_one/models/shared/updatepackage.rb +5 -2
- data/lib/stack_one/models/shared/updateuserapimodel.rb +45 -0
- data/lib/stack_one/models/shared/updateuserapimodel_status.rb +27 -0
- data/lib/stack_one/models/shared/updateuserapimodel_value.rb +20 -0
- data/lib/stack_one/models/shared.rb +33 -6
- data/lib/stack_one/proxy.rb +80 -11
- 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 +25 -7
- data/lib/stack_one/stackone.rb +29 -10
- data/lib/stack_one/utils/retries.rb +95 -0
- data/lib/stack_one/utils/utils.rb +10 -0
- metadata +74 -10
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_home_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/hriscreateemployeerequestdto_schemas_work_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_home_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/hrisupdateemployeerequestdto_schemas_work_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_home_location_state_value.rb +0 -3840
- data/lib/stack_one/models/shared/updateemployeeapimodel_schemas_work_location_state_value.rb +0 -3840
data/lib/stack_one/lms.rb
CHANGED
@@ -5,7 +5,10 @@
|
|
5
5
|
|
6
6
|
require 'faraday'
|
7
7
|
require 'faraday/multipart'
|
8
|
+
require 'faraday/retry'
|
8
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
11
|
+
require_relative 'utils/retries'
|
9
12
|
|
10
13
|
module StackOne
|
11
14
|
extend T::Sig
|
@@ -19,8 +22,8 @@ module StackOne
|
|
19
22
|
end
|
20
23
|
|
21
24
|
|
22
|
-
sig { params(lms_batch_upsert_content_request_dto: ::StackOne::Shared::LmsBatchUpsertContentRequestDto, x_account_id: ::String).returns(::StackOne::Operations::LmsBatchUpsertContentResponse) }
|
23
|
-
def batch_upsert_content(lms_batch_upsert_content_request_dto, x_account_id)
|
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)
|
24
27
|
# batch_upsert_content - Batch Upsert Content
|
25
28
|
request = ::StackOne::Operations::LmsBatchUpsertContentRequest.new(
|
26
29
|
|
@@ -34,19 +37,85 @@ module StackOne
|
|
34
37
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_batch_upsert_content_request_dto, :json)
|
35
38
|
headers['content-type'] = req_content_type
|
36
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
|
37
48
|
headers['Accept'] = 'application/json'
|
38
49
|
headers['user-agent'] = @sdk_configuration.user_agent
|
50
|
+
retries ||= @sdk_configuration.retry_config
|
51
|
+
retries ||= Utils::RetryConfig.new(
|
52
|
+
backoff: Utils::BackoffStrategy.new(
|
53
|
+
exponent: 1.5,
|
54
|
+
initial_interval: 500,
|
55
|
+
max_elapsed_time: 3_600_000,
|
56
|
+
max_interval: 60_000
|
57
|
+
),
|
58
|
+
retry_connection_errors: true,
|
59
|
+
strategy: 'backoff'
|
60
|
+
)
|
61
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
62
|
+
retry_options[:retry_statuses] = [429, 408]
|
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
|
39
68
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
69
|
+
connection = @sdk_configuration.client.dup
|
70
|
+
connection.request :retry, retry_options
|
71
|
+
|
72
|
+
hook_ctx = SDKHooks::HookContext.new(
|
73
|
+
base_url: base_url,
|
74
|
+
oauth2_scopes: [],
|
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
|
+
)
|
48
107
|
else
|
49
|
-
|
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'
|
50
119
|
end
|
51
120
|
end
|
52
121
|
|
@@ -70,8 +139,8 @@ module StackOne
|
|
70
139
|
end
|
71
140
|
|
72
141
|
|
73
|
-
sig { params(lms_batch_upsert_course_request_dto: ::StackOne::Shared::LmsBatchUpsertCourseRequestDto, x_account_id: ::String).returns(::StackOne::Operations::LmsBatchUpsertCourseResponse) }
|
74
|
-
def batch_upsert_course(lms_batch_upsert_course_request_dto, x_account_id)
|
142
|
+
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) }
|
143
|
+
def batch_upsert_course(lms_batch_upsert_course_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
75
144
|
# batch_upsert_course - Batch Upsert Course
|
76
145
|
request = ::StackOne::Operations::LmsBatchUpsertCourseRequest.new(
|
77
146
|
|
@@ -85,19 +154,85 @@ module StackOne
|
|
85
154
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_batch_upsert_course_request_dto, :json)
|
86
155
|
headers['content-type'] = req_content_type
|
87
156
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
157
|
+
|
158
|
+
if form
|
159
|
+
body = Utils.encode_form(form)
|
160
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
161
|
+
body = URI.encode_www_form(data)
|
162
|
+
else
|
163
|
+
body = data
|
164
|
+
end
|
88
165
|
headers['Accept'] = 'application/json'
|
89
166
|
headers['user-agent'] = @sdk_configuration.user_agent
|
167
|
+
retries ||= @sdk_configuration.retry_config
|
168
|
+
retries ||= Utils::RetryConfig.new(
|
169
|
+
backoff: Utils::BackoffStrategy.new(
|
170
|
+
exponent: 1.5,
|
171
|
+
initial_interval: 500,
|
172
|
+
max_elapsed_time: 3_600_000,
|
173
|
+
max_interval: 60_000
|
174
|
+
),
|
175
|
+
retry_connection_errors: true,
|
176
|
+
strategy: 'backoff'
|
177
|
+
)
|
178
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
179
|
+
retry_options[:retry_statuses] = [429, 408]
|
180
|
+
|
181
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
182
|
+
|
183
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
184
|
+
timeout ||= @sdk_configuration.timeout
|
185
|
+
|
186
|
+
connection = @sdk_configuration.client.dup
|
187
|
+
connection.request :retry, retry_options
|
188
|
+
|
189
|
+
hook_ctx = SDKHooks::HookContext.new(
|
190
|
+
base_url: base_url,
|
191
|
+
oauth2_scopes: [],
|
192
|
+
operation_id: 'lms_batch_upsert_course',
|
193
|
+
security_source: @sdk_configuration.security_source
|
194
|
+
)
|
90
195
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
req.body =
|
97
|
-
|
98
|
-
req.
|
196
|
+
error = T.let(nil, T.nilable(StandardError))
|
197
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
198
|
+
|
199
|
+
begin
|
200
|
+
r = connection.post(url) do |req|
|
201
|
+
req.body = body
|
202
|
+
req.headers.merge!(headers)
|
203
|
+
req.options.timeout = timeout unless timeout.nil?
|
204
|
+
Utils.configure_request_security(req, security)
|
205
|
+
|
206
|
+
@sdk_configuration.hooks.before_request(
|
207
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
208
|
+
hook_ctx: hook_ctx
|
209
|
+
),
|
210
|
+
request: req
|
211
|
+
)
|
212
|
+
end
|
213
|
+
rescue StandardError => e
|
214
|
+
error = e
|
215
|
+
ensure
|
216
|
+
if r.nil? || Utils.error_status?(r.status)
|
217
|
+
r = @sdk_configuration.hooks.after_error(
|
218
|
+
error: error,
|
219
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
220
|
+
hook_ctx: hook_ctx
|
221
|
+
),
|
222
|
+
response: r
|
223
|
+
)
|
99
224
|
else
|
100
|
-
|
225
|
+
r = @sdk_configuration.hooks.after_success(
|
226
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
227
|
+
hook_ctx: hook_ctx
|
228
|
+
),
|
229
|
+
response: r
|
230
|
+
)
|
231
|
+
end
|
232
|
+
|
233
|
+
if r.nil?
|
234
|
+
raise error if !error.nil?
|
235
|
+
raise 'no response'
|
101
236
|
end
|
102
237
|
end
|
103
238
|
|
@@ -121,8 +256,8 @@ module StackOne
|
|
121
256
|
end
|
122
257
|
|
123
258
|
|
124
|
-
sig { params(lms_create_collection_request_dto: ::StackOne::Shared::LmsCreateCollectionRequestDto, x_account_id: ::String).returns(::StackOne::Operations::LmsCreateCollectionResponse) }
|
125
|
-
def create_collection(lms_create_collection_request_dto, x_account_id)
|
259
|
+
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) }
|
260
|
+
def create_collection(lms_create_collection_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
126
261
|
# create_collection - Create Collection
|
127
262
|
request = ::StackOne::Operations::LmsCreateCollectionRequest.new(
|
128
263
|
|
@@ -136,19 +271,85 @@ module StackOne
|
|
136
271
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_collection_request_dto, :json)
|
137
272
|
headers['content-type'] = req_content_type
|
138
273
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
274
|
+
|
275
|
+
if form
|
276
|
+
body = Utils.encode_form(form)
|
277
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
278
|
+
body = URI.encode_www_form(data)
|
279
|
+
else
|
280
|
+
body = data
|
281
|
+
end
|
139
282
|
headers['Accept'] = 'application/json'
|
140
283
|
headers['user-agent'] = @sdk_configuration.user_agent
|
284
|
+
retries ||= @sdk_configuration.retry_config
|
285
|
+
retries ||= Utils::RetryConfig.new(
|
286
|
+
backoff: Utils::BackoffStrategy.new(
|
287
|
+
exponent: 1.5,
|
288
|
+
initial_interval: 500,
|
289
|
+
max_elapsed_time: 3_600_000,
|
290
|
+
max_interval: 60_000
|
291
|
+
),
|
292
|
+
retry_connection_errors: true,
|
293
|
+
strategy: 'backoff'
|
294
|
+
)
|
295
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
296
|
+
retry_options[:retry_statuses] = [429, 408]
|
297
|
+
|
298
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
299
|
+
|
300
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
301
|
+
timeout ||= @sdk_configuration.timeout
|
141
302
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
303
|
+
connection = @sdk_configuration.client.dup
|
304
|
+
connection.request :retry, retry_options
|
305
|
+
|
306
|
+
hook_ctx = SDKHooks::HookContext.new(
|
307
|
+
base_url: base_url,
|
308
|
+
oauth2_scopes: [],
|
309
|
+
operation_id: 'lms_create_collection',
|
310
|
+
security_source: @sdk_configuration.security_source
|
311
|
+
)
|
312
|
+
|
313
|
+
error = T.let(nil, T.nilable(StandardError))
|
314
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
315
|
+
|
316
|
+
begin
|
317
|
+
r = connection.post(url) do |req|
|
318
|
+
req.body = body
|
319
|
+
req.headers.merge!(headers)
|
320
|
+
req.options.timeout = timeout unless timeout.nil?
|
321
|
+
Utils.configure_request_security(req, security)
|
322
|
+
|
323
|
+
@sdk_configuration.hooks.before_request(
|
324
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
325
|
+
hook_ctx: hook_ctx
|
326
|
+
),
|
327
|
+
request: req
|
328
|
+
)
|
329
|
+
end
|
330
|
+
rescue StandardError => e
|
331
|
+
error = e
|
332
|
+
ensure
|
333
|
+
if r.nil? || Utils.error_status?(r.status)
|
334
|
+
r = @sdk_configuration.hooks.after_error(
|
335
|
+
error: error,
|
336
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
337
|
+
hook_ctx: hook_ctx
|
338
|
+
),
|
339
|
+
response: r
|
340
|
+
)
|
150
341
|
else
|
151
|
-
|
342
|
+
r = @sdk_configuration.hooks.after_success(
|
343
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
344
|
+
hook_ctx: hook_ctx
|
345
|
+
),
|
346
|
+
response: r
|
347
|
+
)
|
348
|
+
end
|
349
|
+
|
350
|
+
if r.nil?
|
351
|
+
raise error if !error.nil?
|
352
|
+
raise 'no response'
|
152
353
|
end
|
153
354
|
end
|
154
355
|
|
@@ -172,8 +373,8 @@ module StackOne
|
|
172
373
|
end
|
173
374
|
|
174
375
|
|
175
|
-
sig { params(lms_create_assignment_request_dto: ::StackOne::Shared::LmsCreateAssignmentRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::LmsCreateUserAssignmentResponse) }
|
176
|
-
def create_user_assignment(lms_create_assignment_request_dto, id, x_account_id)
|
376
|
+
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) }
|
377
|
+
def create_user_assignment(lms_create_assignment_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
177
378
|
# create_user_assignment - Create User Assignment
|
178
379
|
request = ::StackOne::Operations::LmsCreateUserAssignmentRequest.new(
|
179
380
|
|
@@ -193,19 +394,85 @@ module StackOne
|
|
193
394
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_assignment_request_dto, :json)
|
194
395
|
headers['content-type'] = req_content_type
|
195
396
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
397
|
+
|
398
|
+
if form
|
399
|
+
body = Utils.encode_form(form)
|
400
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
401
|
+
body = URI.encode_www_form(data)
|
402
|
+
else
|
403
|
+
body = data
|
404
|
+
end
|
196
405
|
headers['Accept'] = 'application/json'
|
197
406
|
headers['user-agent'] = @sdk_configuration.user_agent
|
407
|
+
retries ||= @sdk_configuration.retry_config
|
408
|
+
retries ||= Utils::RetryConfig.new(
|
409
|
+
backoff: Utils::BackoffStrategy.new(
|
410
|
+
exponent: 1.5,
|
411
|
+
initial_interval: 500,
|
412
|
+
max_elapsed_time: 3_600_000,
|
413
|
+
max_interval: 60_000
|
414
|
+
),
|
415
|
+
retry_connection_errors: true,
|
416
|
+
strategy: 'backoff'
|
417
|
+
)
|
418
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
419
|
+
retry_options[:retry_statuses] = [429, 408]
|
420
|
+
|
421
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
422
|
+
|
423
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
424
|
+
timeout ||= @sdk_configuration.timeout
|
198
425
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
426
|
+
connection = @sdk_configuration.client.dup
|
427
|
+
connection.request :retry, retry_options
|
428
|
+
|
429
|
+
hook_ctx = SDKHooks::HookContext.new(
|
430
|
+
base_url: base_url,
|
431
|
+
oauth2_scopes: [],
|
432
|
+
operation_id: 'lms_create_user_assignment',
|
433
|
+
security_source: @sdk_configuration.security_source
|
434
|
+
)
|
435
|
+
|
436
|
+
error = T.let(nil, T.nilable(StandardError))
|
437
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
438
|
+
|
439
|
+
begin
|
440
|
+
r = connection.post(url) do |req|
|
441
|
+
req.body = body
|
442
|
+
req.headers.merge!(headers)
|
443
|
+
req.options.timeout = timeout unless timeout.nil?
|
444
|
+
Utils.configure_request_security(req, security)
|
445
|
+
|
446
|
+
@sdk_configuration.hooks.before_request(
|
447
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
448
|
+
hook_ctx: hook_ctx
|
449
|
+
),
|
450
|
+
request: req
|
451
|
+
)
|
452
|
+
end
|
453
|
+
rescue StandardError => e
|
454
|
+
error = e
|
455
|
+
ensure
|
456
|
+
if r.nil? || Utils.error_status?(r.status)
|
457
|
+
r = @sdk_configuration.hooks.after_error(
|
458
|
+
error: error,
|
459
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
460
|
+
hook_ctx: hook_ctx
|
461
|
+
),
|
462
|
+
response: r
|
463
|
+
)
|
207
464
|
else
|
208
|
-
|
465
|
+
r = @sdk_configuration.hooks.after_success(
|
466
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
467
|
+
hook_ctx: hook_ctx
|
468
|
+
),
|
469
|
+
response: r
|
470
|
+
)
|
471
|
+
end
|
472
|
+
|
473
|
+
if r.nil?
|
474
|
+
raise error if !error.nil?
|
475
|
+
raise 'no response'
|
209
476
|
end
|
210
477
|
end
|
211
478
|
|
@@ -229,8 +496,8 @@ module StackOne
|
|
229
496
|
end
|
230
497
|
|
231
498
|
|
232
|
-
sig { params(lms_create_completion_request_dto: ::StackOne::Shared::LmsCreateCompletionRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::LmsCreateUserCompletionResponse) }
|
233
|
-
def create_user_completion(lms_create_completion_request_dto, id, x_account_id)
|
499
|
+
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) }
|
500
|
+
def create_user_completion(lms_create_completion_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
234
501
|
# create_user_completion - Create User Completion
|
235
502
|
request = ::StackOne::Operations::LmsCreateUserCompletionRequest.new(
|
236
503
|
|
@@ -250,19 +517,85 @@ module StackOne
|
|
250
517
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_completion_request_dto, :json)
|
251
518
|
headers['content-type'] = req_content_type
|
252
519
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
520
|
+
|
521
|
+
if form
|
522
|
+
body = Utils.encode_form(form)
|
523
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
524
|
+
body = URI.encode_www_form(data)
|
525
|
+
else
|
526
|
+
body = data
|
527
|
+
end
|
253
528
|
headers['Accept'] = 'application/json'
|
254
529
|
headers['user-agent'] = @sdk_configuration.user_agent
|
530
|
+
retries ||= @sdk_configuration.retry_config
|
531
|
+
retries ||= Utils::RetryConfig.new(
|
532
|
+
backoff: Utils::BackoffStrategy.new(
|
533
|
+
exponent: 1.5,
|
534
|
+
initial_interval: 500,
|
535
|
+
max_elapsed_time: 3_600_000,
|
536
|
+
max_interval: 60_000
|
537
|
+
),
|
538
|
+
retry_connection_errors: true,
|
539
|
+
strategy: 'backoff'
|
540
|
+
)
|
541
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
542
|
+
retry_options[:retry_statuses] = [429, 408]
|
543
|
+
|
544
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
255
545
|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
546
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
547
|
+
timeout ||= @sdk_configuration.timeout
|
548
|
+
|
549
|
+
connection = @sdk_configuration.client.dup
|
550
|
+
connection.request :retry, retry_options
|
551
|
+
|
552
|
+
hook_ctx = SDKHooks::HookContext.new(
|
553
|
+
base_url: base_url,
|
554
|
+
oauth2_scopes: [],
|
555
|
+
operation_id: 'lms_create_user_completion',
|
556
|
+
security_source: @sdk_configuration.security_source
|
557
|
+
)
|
558
|
+
|
559
|
+
error = T.let(nil, T.nilable(StandardError))
|
560
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
561
|
+
|
562
|
+
begin
|
563
|
+
r = connection.post(url) do |req|
|
564
|
+
req.body = body
|
565
|
+
req.headers.merge!(headers)
|
566
|
+
req.options.timeout = timeout unless timeout.nil?
|
567
|
+
Utils.configure_request_security(req, security)
|
568
|
+
|
569
|
+
@sdk_configuration.hooks.before_request(
|
570
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
571
|
+
hook_ctx: hook_ctx
|
572
|
+
),
|
573
|
+
request: req
|
574
|
+
)
|
575
|
+
end
|
576
|
+
rescue StandardError => e
|
577
|
+
error = e
|
578
|
+
ensure
|
579
|
+
if r.nil? || Utils.error_status?(r.status)
|
580
|
+
r = @sdk_configuration.hooks.after_error(
|
581
|
+
error: error,
|
582
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
583
|
+
hook_ctx: hook_ctx
|
584
|
+
),
|
585
|
+
response: r
|
586
|
+
)
|
264
587
|
else
|
265
|
-
|
588
|
+
r = @sdk_configuration.hooks.after_success(
|
589
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
590
|
+
hook_ctx: hook_ctx
|
591
|
+
),
|
592
|
+
response: r
|
593
|
+
)
|
594
|
+
end
|
595
|
+
|
596
|
+
if r.nil?
|
597
|
+
raise error if !error.nil?
|
598
|
+
raise 'no response'
|
266
599
|
end
|
267
600
|
end
|
268
601
|
|
@@ -286,8 +619,8 @@ module StackOne
|
|
286
619
|
end
|
287
620
|
|
288
621
|
|
289
|
-
sig { params(id: ::String, sub_resource_id: ::String, x_account_id: ::String).returns(::StackOne::Operations::LmsDeleteUserCompletionResponse) }
|
290
|
-
def delete_user_completion(id, sub_resource_id, x_account_id)
|
622
|
+
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) }
|
623
|
+
def delete_user_completion(id, sub_resource_id, x_account_id, retries = nil, timeout_ms = nil)
|
291
624
|
# delete_user_completion - Delete User Completion
|
292
625
|
request = ::StackOne::Operations::LmsDeleteUserCompletionRequest.new(
|
293
626
|
|
@@ -306,11 +639,75 @@ module StackOne
|
|
306
639
|
headers = Utils.get_headers(request)
|
307
640
|
headers['Accept'] = 'application/json'
|
308
641
|
headers['user-agent'] = @sdk_configuration.user_agent
|
642
|
+
retries ||= @sdk_configuration.retry_config
|
643
|
+
retries ||= Utils::RetryConfig.new(
|
644
|
+
backoff: Utils::BackoffStrategy.new(
|
645
|
+
exponent: 1.5,
|
646
|
+
initial_interval: 500,
|
647
|
+
max_elapsed_time: 3_600_000,
|
648
|
+
max_interval: 60_000
|
649
|
+
),
|
650
|
+
retry_connection_errors: true,
|
651
|
+
strategy: 'backoff'
|
652
|
+
)
|
653
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
654
|
+
retry_options[:retry_statuses] = [429, 408]
|
655
|
+
|
656
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
309
657
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
658
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
659
|
+
timeout ||= @sdk_configuration.timeout
|
660
|
+
|
661
|
+
connection = @sdk_configuration.client.dup
|
662
|
+
connection.request :retry, retry_options
|
663
|
+
|
664
|
+
hook_ctx = SDKHooks::HookContext.new(
|
665
|
+
base_url: base_url,
|
666
|
+
oauth2_scopes: [],
|
667
|
+
operation_id: 'lms_delete_user_completion',
|
668
|
+
security_source: @sdk_configuration.security_source
|
669
|
+
)
|
670
|
+
|
671
|
+
error = T.let(nil, T.nilable(StandardError))
|
672
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
673
|
+
|
674
|
+
begin
|
675
|
+
r = connection.delete(url) do |req|
|
676
|
+
req.headers.merge!(headers)
|
677
|
+
req.options.timeout = timeout unless timeout.nil?
|
678
|
+
Utils.configure_request_security(req, security)
|
679
|
+
|
680
|
+
@sdk_configuration.hooks.before_request(
|
681
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
682
|
+
hook_ctx: hook_ctx
|
683
|
+
),
|
684
|
+
request: req
|
685
|
+
)
|
686
|
+
end
|
687
|
+
rescue StandardError => e
|
688
|
+
error = e
|
689
|
+
ensure
|
690
|
+
if r.nil? || Utils.error_status?(r.status)
|
691
|
+
r = @sdk_configuration.hooks.after_error(
|
692
|
+
error: error,
|
693
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
694
|
+
hook_ctx: hook_ctx
|
695
|
+
),
|
696
|
+
response: r
|
697
|
+
)
|
698
|
+
else
|
699
|
+
r = @sdk_configuration.hooks.after_success(
|
700
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
701
|
+
hook_ctx: hook_ctx
|
702
|
+
),
|
703
|
+
response: r
|
704
|
+
)
|
705
|
+
end
|
706
|
+
|
707
|
+
if r.nil?
|
708
|
+
raise error if !error.nil?
|
709
|
+
raise 'no response'
|
710
|
+
end
|
314
711
|
end
|
315
712
|
|
316
713
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -334,8 +731,8 @@ module StackOne
|
|
334
731
|
end
|
335
732
|
|
336
733
|
|
337
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetAssignmentRequest)).returns(::StackOne::Operations::LmsGetAssignmentResponse) }
|
338
|
-
def get_assignment(request)
|
734
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetAssignmentResponse) }
|
735
|
+
def get_assignment(request, retries = nil, timeout_ms = nil)
|
339
736
|
# get_assignment - Get Assignment
|
340
737
|
url, params = @sdk_configuration.get_server_details
|
341
738
|
base_url = Utils.template_url(url, params)
|
@@ -349,12 +746,76 @@ module StackOne
|
|
349
746
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetAssignmentRequest, request)
|
350
747
|
headers['Accept'] = 'application/json'
|
351
748
|
headers['user-agent'] = @sdk_configuration.user_agent
|
749
|
+
retries ||= @sdk_configuration.retry_config
|
750
|
+
retries ||= Utils::RetryConfig.new(
|
751
|
+
backoff: Utils::BackoffStrategy.new(
|
752
|
+
exponent: 1.5,
|
753
|
+
initial_interval: 500,
|
754
|
+
max_elapsed_time: 3_600_000,
|
755
|
+
max_interval: 60_000
|
756
|
+
),
|
757
|
+
retry_connection_errors: true,
|
758
|
+
strategy: 'backoff'
|
759
|
+
)
|
760
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
761
|
+
retry_options[:retry_statuses] = [429, 408]
|
762
|
+
|
763
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
764
|
+
|
765
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
766
|
+
timeout ||= @sdk_configuration.timeout
|
352
767
|
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
768
|
+
connection = @sdk_configuration.client.dup
|
769
|
+
connection.request :retry, retry_options
|
770
|
+
|
771
|
+
hook_ctx = SDKHooks::HookContext.new(
|
772
|
+
base_url: base_url,
|
773
|
+
oauth2_scopes: [],
|
774
|
+
operation_id: 'lms_get_assignment',
|
775
|
+
security_source: @sdk_configuration.security_source
|
776
|
+
)
|
777
|
+
|
778
|
+
error = T.let(nil, T.nilable(StandardError))
|
779
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
780
|
+
|
781
|
+
begin
|
782
|
+
r = connection.get(url) do |req|
|
783
|
+
req.headers.merge!(headers)
|
784
|
+
req.options.timeout = timeout unless timeout.nil?
|
785
|
+
req.params = query_params
|
786
|
+
Utils.configure_request_security(req, security)
|
787
|
+
|
788
|
+
@sdk_configuration.hooks.before_request(
|
789
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
790
|
+
hook_ctx: hook_ctx
|
791
|
+
),
|
792
|
+
request: req
|
793
|
+
)
|
794
|
+
end
|
795
|
+
rescue StandardError => e
|
796
|
+
error = e
|
797
|
+
ensure
|
798
|
+
if r.nil? || Utils.error_status?(r.status)
|
799
|
+
r = @sdk_configuration.hooks.after_error(
|
800
|
+
error: error,
|
801
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
802
|
+
hook_ctx: hook_ctx
|
803
|
+
),
|
804
|
+
response: r
|
805
|
+
)
|
806
|
+
else
|
807
|
+
r = @sdk_configuration.hooks.after_success(
|
808
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
809
|
+
hook_ctx: hook_ctx
|
810
|
+
),
|
811
|
+
response: r
|
812
|
+
)
|
813
|
+
end
|
814
|
+
|
815
|
+
if r.nil?
|
816
|
+
raise error if !error.nil?
|
817
|
+
raise 'no response'
|
818
|
+
end
|
358
819
|
end
|
359
820
|
|
360
821
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -377,8 +838,8 @@ module StackOne
|
|
377
838
|
end
|
378
839
|
|
379
840
|
|
380
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCategoryRequest)).returns(::StackOne::Operations::LmsGetCategoryResponse) }
|
381
|
-
def get_category(request)
|
841
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCategoryRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetCategoryResponse) }
|
842
|
+
def get_category(request, retries = nil, timeout_ms = nil)
|
382
843
|
# get_category - Get Category
|
383
844
|
url, params = @sdk_configuration.get_server_details
|
384
845
|
base_url = Utils.template_url(url, params)
|
@@ -392,12 +853,76 @@ module StackOne
|
|
392
853
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetCategoryRequest, request)
|
393
854
|
headers['Accept'] = 'application/json'
|
394
855
|
headers['user-agent'] = @sdk_configuration.user_agent
|
856
|
+
retries ||= @sdk_configuration.retry_config
|
857
|
+
retries ||= Utils::RetryConfig.new(
|
858
|
+
backoff: Utils::BackoffStrategy.new(
|
859
|
+
exponent: 1.5,
|
860
|
+
initial_interval: 500,
|
861
|
+
max_elapsed_time: 3_600_000,
|
862
|
+
max_interval: 60_000
|
863
|
+
),
|
864
|
+
retry_connection_errors: true,
|
865
|
+
strategy: 'backoff'
|
866
|
+
)
|
867
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
868
|
+
retry_options[:retry_statuses] = [429, 408]
|
869
|
+
|
870
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
871
|
+
|
872
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
873
|
+
timeout ||= @sdk_configuration.timeout
|
395
874
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
875
|
+
connection = @sdk_configuration.client.dup
|
876
|
+
connection.request :retry, retry_options
|
877
|
+
|
878
|
+
hook_ctx = SDKHooks::HookContext.new(
|
879
|
+
base_url: base_url,
|
880
|
+
oauth2_scopes: [],
|
881
|
+
operation_id: 'lms_get_category',
|
882
|
+
security_source: @sdk_configuration.security_source
|
883
|
+
)
|
884
|
+
|
885
|
+
error = T.let(nil, T.nilable(StandardError))
|
886
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
887
|
+
|
888
|
+
begin
|
889
|
+
r = connection.get(url) do |req|
|
890
|
+
req.headers.merge!(headers)
|
891
|
+
req.options.timeout = timeout unless timeout.nil?
|
892
|
+
req.params = query_params
|
893
|
+
Utils.configure_request_security(req, security)
|
894
|
+
|
895
|
+
@sdk_configuration.hooks.before_request(
|
896
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
897
|
+
hook_ctx: hook_ctx
|
898
|
+
),
|
899
|
+
request: req
|
900
|
+
)
|
901
|
+
end
|
902
|
+
rescue StandardError => e
|
903
|
+
error = e
|
904
|
+
ensure
|
905
|
+
if r.nil? || Utils.error_status?(r.status)
|
906
|
+
r = @sdk_configuration.hooks.after_error(
|
907
|
+
error: error,
|
908
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
909
|
+
hook_ctx: hook_ctx
|
910
|
+
),
|
911
|
+
response: r
|
912
|
+
)
|
913
|
+
else
|
914
|
+
r = @sdk_configuration.hooks.after_success(
|
915
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
916
|
+
hook_ctx: hook_ctx
|
917
|
+
),
|
918
|
+
response: r
|
919
|
+
)
|
920
|
+
end
|
921
|
+
|
922
|
+
if r.nil?
|
923
|
+
raise error if !error.nil?
|
924
|
+
raise 'no response'
|
925
|
+
end
|
401
926
|
end
|
402
927
|
|
403
928
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -420,8 +945,8 @@ module StackOne
|
|
420
945
|
end
|
421
946
|
|
422
947
|
|
423
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCompletionRequest)).returns(::StackOne::Operations::LmsGetCompletionResponse) }
|
424
|
-
def get_completion(request)
|
948
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCompletionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetCompletionResponse) }
|
949
|
+
def get_completion(request, retries = nil, timeout_ms = nil)
|
425
950
|
# get_completion - Get Completion
|
426
951
|
url, params = @sdk_configuration.get_server_details
|
427
952
|
base_url = Utils.template_url(url, params)
|
@@ -435,12 +960,76 @@ module StackOne
|
|
435
960
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetCompletionRequest, request)
|
436
961
|
headers['Accept'] = 'application/json'
|
437
962
|
headers['user-agent'] = @sdk_configuration.user_agent
|
963
|
+
retries ||= @sdk_configuration.retry_config
|
964
|
+
retries ||= Utils::RetryConfig.new(
|
965
|
+
backoff: Utils::BackoffStrategy.new(
|
966
|
+
exponent: 1.5,
|
967
|
+
initial_interval: 500,
|
968
|
+
max_elapsed_time: 3_600_000,
|
969
|
+
max_interval: 60_000
|
970
|
+
),
|
971
|
+
retry_connection_errors: true,
|
972
|
+
strategy: 'backoff'
|
973
|
+
)
|
974
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
975
|
+
retry_options[:retry_statuses] = [429, 408]
|
976
|
+
|
977
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
978
|
+
|
979
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
980
|
+
timeout ||= @sdk_configuration.timeout
|
981
|
+
|
982
|
+
connection = @sdk_configuration.client.dup
|
983
|
+
connection.request :retry, retry_options
|
984
|
+
|
985
|
+
hook_ctx = SDKHooks::HookContext.new(
|
986
|
+
base_url: base_url,
|
987
|
+
oauth2_scopes: [],
|
988
|
+
operation_id: 'lms_get_completion',
|
989
|
+
security_source: @sdk_configuration.security_source
|
990
|
+
)
|
438
991
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
992
|
+
error = T.let(nil, T.nilable(StandardError))
|
993
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
994
|
+
|
995
|
+
begin
|
996
|
+
r = connection.get(url) do |req|
|
997
|
+
req.headers.merge!(headers)
|
998
|
+
req.options.timeout = timeout unless timeout.nil?
|
999
|
+
req.params = query_params
|
1000
|
+
Utils.configure_request_security(req, security)
|
1001
|
+
|
1002
|
+
@sdk_configuration.hooks.before_request(
|
1003
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1004
|
+
hook_ctx: hook_ctx
|
1005
|
+
),
|
1006
|
+
request: req
|
1007
|
+
)
|
1008
|
+
end
|
1009
|
+
rescue StandardError => e
|
1010
|
+
error = e
|
1011
|
+
ensure
|
1012
|
+
if r.nil? || Utils.error_status?(r.status)
|
1013
|
+
r = @sdk_configuration.hooks.after_error(
|
1014
|
+
error: error,
|
1015
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1016
|
+
hook_ctx: hook_ctx
|
1017
|
+
),
|
1018
|
+
response: r
|
1019
|
+
)
|
1020
|
+
else
|
1021
|
+
r = @sdk_configuration.hooks.after_success(
|
1022
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1023
|
+
hook_ctx: hook_ctx
|
1024
|
+
),
|
1025
|
+
response: r
|
1026
|
+
)
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
if r.nil?
|
1030
|
+
raise error if !error.nil?
|
1031
|
+
raise 'no response'
|
1032
|
+
end
|
444
1033
|
end
|
445
1034
|
|
446
1035
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -463,8 +1052,8 @@ module StackOne
|
|
463
1052
|
end
|
464
1053
|
|
465
1054
|
|
466
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetContentRequest)).returns(::StackOne::Operations::LmsGetContentResponse) }
|
467
|
-
def get_content(request)
|
1055
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetContentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetContentResponse) }
|
1056
|
+
def get_content(request, retries = nil, timeout_ms = nil)
|
468
1057
|
# get_content - Get Content
|
469
1058
|
url, params = @sdk_configuration.get_server_details
|
470
1059
|
base_url = Utils.template_url(url, params)
|
@@ -478,12 +1067,76 @@ module StackOne
|
|
478
1067
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetContentRequest, request)
|
479
1068
|
headers['Accept'] = 'application/json'
|
480
1069
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1070
|
+
retries ||= @sdk_configuration.retry_config
|
1071
|
+
retries ||= Utils::RetryConfig.new(
|
1072
|
+
backoff: Utils::BackoffStrategy.new(
|
1073
|
+
exponent: 1.5,
|
1074
|
+
initial_interval: 500,
|
1075
|
+
max_elapsed_time: 3_600_000,
|
1076
|
+
max_interval: 60_000
|
1077
|
+
),
|
1078
|
+
retry_connection_errors: true,
|
1079
|
+
strategy: 'backoff'
|
1080
|
+
)
|
1081
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1082
|
+
retry_options[:retry_statuses] = [429, 408]
|
1083
|
+
|
1084
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1085
|
+
|
1086
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1087
|
+
timeout ||= @sdk_configuration.timeout
|
1088
|
+
|
1089
|
+
connection = @sdk_configuration.client.dup
|
1090
|
+
connection.request :retry, retry_options
|
481
1091
|
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
1092
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1093
|
+
base_url: base_url,
|
1094
|
+
oauth2_scopes: [],
|
1095
|
+
operation_id: 'lms_get_content',
|
1096
|
+
security_source: @sdk_configuration.security_source
|
1097
|
+
)
|
1098
|
+
|
1099
|
+
error = T.let(nil, T.nilable(StandardError))
|
1100
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1101
|
+
|
1102
|
+
begin
|
1103
|
+
r = connection.get(url) do |req|
|
1104
|
+
req.headers.merge!(headers)
|
1105
|
+
req.options.timeout = timeout unless timeout.nil?
|
1106
|
+
req.params = query_params
|
1107
|
+
Utils.configure_request_security(req, security)
|
1108
|
+
|
1109
|
+
@sdk_configuration.hooks.before_request(
|
1110
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1111
|
+
hook_ctx: hook_ctx
|
1112
|
+
),
|
1113
|
+
request: req
|
1114
|
+
)
|
1115
|
+
end
|
1116
|
+
rescue StandardError => e
|
1117
|
+
error = e
|
1118
|
+
ensure
|
1119
|
+
if r.nil? || Utils.error_status?(r.status)
|
1120
|
+
r = @sdk_configuration.hooks.after_error(
|
1121
|
+
error: error,
|
1122
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1123
|
+
hook_ctx: hook_ctx
|
1124
|
+
),
|
1125
|
+
response: r
|
1126
|
+
)
|
1127
|
+
else
|
1128
|
+
r = @sdk_configuration.hooks.after_success(
|
1129
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1130
|
+
hook_ctx: hook_ctx
|
1131
|
+
),
|
1132
|
+
response: r
|
1133
|
+
)
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
if r.nil?
|
1137
|
+
raise error if !error.nil?
|
1138
|
+
raise 'no response'
|
1139
|
+
end
|
487
1140
|
end
|
488
1141
|
|
489
1142
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -506,8 +1159,8 @@ module StackOne
|
|
506
1159
|
end
|
507
1160
|
|
508
1161
|
|
509
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCourseRequest)).returns(::StackOne::Operations::LmsGetCourseResponse) }
|
510
|
-
def get_course(request)
|
1162
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetCourseRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetCourseResponse) }
|
1163
|
+
def get_course(request, retries = nil, timeout_ms = nil)
|
511
1164
|
# get_course - Get Course
|
512
1165
|
url, params = @sdk_configuration.get_server_details
|
513
1166
|
base_url = Utils.template_url(url, params)
|
@@ -521,12 +1174,76 @@ module StackOne
|
|
521
1174
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetCourseRequest, request)
|
522
1175
|
headers['Accept'] = 'application/json'
|
523
1176
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1177
|
+
retries ||= @sdk_configuration.retry_config
|
1178
|
+
retries ||= Utils::RetryConfig.new(
|
1179
|
+
backoff: Utils::BackoffStrategy.new(
|
1180
|
+
exponent: 1.5,
|
1181
|
+
initial_interval: 500,
|
1182
|
+
max_elapsed_time: 3_600_000,
|
1183
|
+
max_interval: 60_000
|
1184
|
+
),
|
1185
|
+
retry_connection_errors: true,
|
1186
|
+
strategy: 'backoff'
|
1187
|
+
)
|
1188
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1189
|
+
retry_options[:retry_statuses] = [429, 408]
|
1190
|
+
|
1191
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
524
1192
|
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
1193
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1194
|
+
timeout ||= @sdk_configuration.timeout
|
1195
|
+
|
1196
|
+
connection = @sdk_configuration.client.dup
|
1197
|
+
connection.request :retry, retry_options
|
1198
|
+
|
1199
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1200
|
+
base_url: base_url,
|
1201
|
+
oauth2_scopes: [],
|
1202
|
+
operation_id: 'lms_get_course',
|
1203
|
+
security_source: @sdk_configuration.security_source
|
1204
|
+
)
|
1205
|
+
|
1206
|
+
error = T.let(nil, T.nilable(StandardError))
|
1207
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1208
|
+
|
1209
|
+
begin
|
1210
|
+
r = connection.get(url) do |req|
|
1211
|
+
req.headers.merge!(headers)
|
1212
|
+
req.options.timeout = timeout unless timeout.nil?
|
1213
|
+
req.params = query_params
|
1214
|
+
Utils.configure_request_security(req, security)
|
1215
|
+
|
1216
|
+
@sdk_configuration.hooks.before_request(
|
1217
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1218
|
+
hook_ctx: hook_ctx
|
1219
|
+
),
|
1220
|
+
request: req
|
1221
|
+
)
|
1222
|
+
end
|
1223
|
+
rescue StandardError => e
|
1224
|
+
error = e
|
1225
|
+
ensure
|
1226
|
+
if r.nil? || Utils.error_status?(r.status)
|
1227
|
+
r = @sdk_configuration.hooks.after_error(
|
1228
|
+
error: error,
|
1229
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1230
|
+
hook_ctx: hook_ctx
|
1231
|
+
),
|
1232
|
+
response: r
|
1233
|
+
)
|
1234
|
+
else
|
1235
|
+
r = @sdk_configuration.hooks.after_success(
|
1236
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1237
|
+
hook_ctx: hook_ctx
|
1238
|
+
),
|
1239
|
+
response: r
|
1240
|
+
)
|
1241
|
+
end
|
1242
|
+
|
1243
|
+
if r.nil?
|
1244
|
+
raise error if !error.nil?
|
1245
|
+
raise 'no response'
|
1246
|
+
end
|
530
1247
|
end
|
531
1248
|
|
532
1249
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -549,8 +1266,8 @@ module StackOne
|
|
549
1266
|
end
|
550
1267
|
|
551
1268
|
|
552
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetSkillRequest)).returns(::StackOne::Operations::LmsGetSkillResponse) }
|
553
|
-
def get_skill(request)
|
1269
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetSkillRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetSkillResponse) }
|
1270
|
+
def get_skill(request, retries = nil, timeout_ms = nil)
|
554
1271
|
# get_skill - Get Skill
|
555
1272
|
url, params = @sdk_configuration.get_server_details
|
556
1273
|
base_url = Utils.template_url(url, params)
|
@@ -564,12 +1281,76 @@ module StackOne
|
|
564
1281
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetSkillRequest, request)
|
565
1282
|
headers['Accept'] = 'application/json'
|
566
1283
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1284
|
+
retries ||= @sdk_configuration.retry_config
|
1285
|
+
retries ||= Utils::RetryConfig.new(
|
1286
|
+
backoff: Utils::BackoffStrategy.new(
|
1287
|
+
exponent: 1.5,
|
1288
|
+
initial_interval: 500,
|
1289
|
+
max_elapsed_time: 3_600_000,
|
1290
|
+
max_interval: 60_000
|
1291
|
+
),
|
1292
|
+
retry_connection_errors: true,
|
1293
|
+
strategy: 'backoff'
|
1294
|
+
)
|
1295
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1296
|
+
retry_options[:retry_statuses] = [429, 408]
|
567
1297
|
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
1298
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1299
|
+
|
1300
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1301
|
+
timeout ||= @sdk_configuration.timeout
|
1302
|
+
|
1303
|
+
connection = @sdk_configuration.client.dup
|
1304
|
+
connection.request :retry, retry_options
|
1305
|
+
|
1306
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1307
|
+
base_url: base_url,
|
1308
|
+
oauth2_scopes: [],
|
1309
|
+
operation_id: 'lms_get_skill',
|
1310
|
+
security_source: @sdk_configuration.security_source
|
1311
|
+
)
|
1312
|
+
|
1313
|
+
error = T.let(nil, T.nilable(StandardError))
|
1314
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1315
|
+
|
1316
|
+
begin
|
1317
|
+
r = connection.get(url) do |req|
|
1318
|
+
req.headers.merge!(headers)
|
1319
|
+
req.options.timeout = timeout unless timeout.nil?
|
1320
|
+
req.params = query_params
|
1321
|
+
Utils.configure_request_security(req, security)
|
1322
|
+
|
1323
|
+
@sdk_configuration.hooks.before_request(
|
1324
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1325
|
+
hook_ctx: hook_ctx
|
1326
|
+
),
|
1327
|
+
request: req
|
1328
|
+
)
|
1329
|
+
end
|
1330
|
+
rescue StandardError => e
|
1331
|
+
error = e
|
1332
|
+
ensure
|
1333
|
+
if r.nil? || Utils.error_status?(r.status)
|
1334
|
+
r = @sdk_configuration.hooks.after_error(
|
1335
|
+
error: error,
|
1336
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1337
|
+
hook_ctx: hook_ctx
|
1338
|
+
),
|
1339
|
+
response: r
|
1340
|
+
)
|
1341
|
+
else
|
1342
|
+
r = @sdk_configuration.hooks.after_success(
|
1343
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1344
|
+
hook_ctx: hook_ctx
|
1345
|
+
),
|
1346
|
+
response: r
|
1347
|
+
)
|
1348
|
+
end
|
1349
|
+
|
1350
|
+
if r.nil?
|
1351
|
+
raise error if !error.nil?
|
1352
|
+
raise 'no response'
|
1353
|
+
end
|
573
1354
|
end
|
574
1355
|
|
575
1356
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -592,8 +1373,8 @@ module StackOne
|
|
592
1373
|
end
|
593
1374
|
|
594
1375
|
|
595
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserRequest)).returns(::StackOne::Operations::LmsGetUserResponse) }
|
596
|
-
def get_user(request)
|
1376
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetUserResponse) }
|
1377
|
+
def get_user(request, retries = nil, timeout_ms = nil)
|
597
1378
|
# get_user - Get User
|
598
1379
|
url, params = @sdk_configuration.get_server_details
|
599
1380
|
base_url = Utils.template_url(url, params)
|
@@ -607,12 +1388,76 @@ module StackOne
|
|
607
1388
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetUserRequest, request)
|
608
1389
|
headers['Accept'] = 'application/json'
|
609
1390
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1391
|
+
retries ||= @sdk_configuration.retry_config
|
1392
|
+
retries ||= Utils::RetryConfig.new(
|
1393
|
+
backoff: Utils::BackoffStrategy.new(
|
1394
|
+
exponent: 1.5,
|
1395
|
+
initial_interval: 500,
|
1396
|
+
max_elapsed_time: 3_600_000,
|
1397
|
+
max_interval: 60_000
|
1398
|
+
),
|
1399
|
+
retry_connection_errors: true,
|
1400
|
+
strategy: 'backoff'
|
1401
|
+
)
|
1402
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1403
|
+
retry_options[:retry_statuses] = [429, 408]
|
1404
|
+
|
1405
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1406
|
+
|
1407
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1408
|
+
timeout ||= @sdk_configuration.timeout
|
1409
|
+
|
1410
|
+
connection = @sdk_configuration.client.dup
|
1411
|
+
connection.request :retry, retry_options
|
610
1412
|
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
1413
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1414
|
+
base_url: base_url,
|
1415
|
+
oauth2_scopes: [],
|
1416
|
+
operation_id: 'lms_get_user',
|
1417
|
+
security_source: @sdk_configuration.security_source
|
1418
|
+
)
|
1419
|
+
|
1420
|
+
error = T.let(nil, T.nilable(StandardError))
|
1421
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1422
|
+
|
1423
|
+
begin
|
1424
|
+
r = connection.get(url) do |req|
|
1425
|
+
req.headers.merge!(headers)
|
1426
|
+
req.options.timeout = timeout unless timeout.nil?
|
1427
|
+
req.params = query_params
|
1428
|
+
Utils.configure_request_security(req, security)
|
1429
|
+
|
1430
|
+
@sdk_configuration.hooks.before_request(
|
1431
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1432
|
+
hook_ctx: hook_ctx
|
1433
|
+
),
|
1434
|
+
request: req
|
1435
|
+
)
|
1436
|
+
end
|
1437
|
+
rescue StandardError => e
|
1438
|
+
error = e
|
1439
|
+
ensure
|
1440
|
+
if r.nil? || Utils.error_status?(r.status)
|
1441
|
+
r = @sdk_configuration.hooks.after_error(
|
1442
|
+
error: error,
|
1443
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1444
|
+
hook_ctx: hook_ctx
|
1445
|
+
),
|
1446
|
+
response: r
|
1447
|
+
)
|
1448
|
+
else
|
1449
|
+
r = @sdk_configuration.hooks.after_success(
|
1450
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1451
|
+
hook_ctx: hook_ctx
|
1452
|
+
),
|
1453
|
+
response: r
|
1454
|
+
)
|
1455
|
+
end
|
1456
|
+
|
1457
|
+
if r.nil?
|
1458
|
+
raise error if !error.nil?
|
1459
|
+
raise 'no response'
|
1460
|
+
end
|
616
1461
|
end
|
617
1462
|
|
618
1463
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -635,8 +1480,8 @@ module StackOne
|
|
635
1480
|
end
|
636
1481
|
|
637
1482
|
|
638
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserAssignmentRequest)).returns(::StackOne::Operations::LmsGetUserAssignmentResponse) }
|
639
|
-
def get_user_assignment(request)
|
1483
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetUserAssignmentResponse) }
|
1484
|
+
def get_user_assignment(request, retries = nil, timeout_ms = nil)
|
640
1485
|
# get_user_assignment - Get User Assignment
|
641
1486
|
url, params = @sdk_configuration.get_server_details
|
642
1487
|
base_url = Utils.template_url(url, params)
|
@@ -650,12 +1495,76 @@ module StackOne
|
|
650
1495
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetUserAssignmentRequest, request)
|
651
1496
|
headers['Accept'] = 'application/json'
|
652
1497
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1498
|
+
retries ||= @sdk_configuration.retry_config
|
1499
|
+
retries ||= Utils::RetryConfig.new(
|
1500
|
+
backoff: Utils::BackoffStrategy.new(
|
1501
|
+
exponent: 1.5,
|
1502
|
+
initial_interval: 500,
|
1503
|
+
max_elapsed_time: 3_600_000,
|
1504
|
+
max_interval: 60_000
|
1505
|
+
),
|
1506
|
+
retry_connection_errors: true,
|
1507
|
+
strategy: 'backoff'
|
1508
|
+
)
|
1509
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1510
|
+
retry_options[:retry_statuses] = [429, 408]
|
1511
|
+
|
1512
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1513
|
+
|
1514
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1515
|
+
timeout ||= @sdk_configuration.timeout
|
1516
|
+
|
1517
|
+
connection = @sdk_configuration.client.dup
|
1518
|
+
connection.request :retry, retry_options
|
1519
|
+
|
1520
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1521
|
+
base_url: base_url,
|
1522
|
+
oauth2_scopes: [],
|
1523
|
+
operation_id: 'lms_get_user_assignment',
|
1524
|
+
security_source: @sdk_configuration.security_source
|
1525
|
+
)
|
653
1526
|
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
1527
|
+
error = T.let(nil, T.nilable(StandardError))
|
1528
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1529
|
+
|
1530
|
+
begin
|
1531
|
+
r = connection.get(url) do |req|
|
1532
|
+
req.headers.merge!(headers)
|
1533
|
+
req.options.timeout = timeout unless timeout.nil?
|
1534
|
+
req.params = query_params
|
1535
|
+
Utils.configure_request_security(req, security)
|
1536
|
+
|
1537
|
+
@sdk_configuration.hooks.before_request(
|
1538
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1539
|
+
hook_ctx: hook_ctx
|
1540
|
+
),
|
1541
|
+
request: req
|
1542
|
+
)
|
1543
|
+
end
|
1544
|
+
rescue StandardError => e
|
1545
|
+
error = e
|
1546
|
+
ensure
|
1547
|
+
if r.nil? || Utils.error_status?(r.status)
|
1548
|
+
r = @sdk_configuration.hooks.after_error(
|
1549
|
+
error: error,
|
1550
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1551
|
+
hook_ctx: hook_ctx
|
1552
|
+
),
|
1553
|
+
response: r
|
1554
|
+
)
|
1555
|
+
else
|
1556
|
+
r = @sdk_configuration.hooks.after_success(
|
1557
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1558
|
+
hook_ctx: hook_ctx
|
1559
|
+
),
|
1560
|
+
response: r
|
1561
|
+
)
|
1562
|
+
end
|
1563
|
+
|
1564
|
+
if r.nil?
|
1565
|
+
raise error if !error.nil?
|
1566
|
+
raise 'no response'
|
1567
|
+
end
|
659
1568
|
end
|
660
1569
|
|
661
1570
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -678,8 +1587,8 @@ module StackOne
|
|
678
1587
|
end
|
679
1588
|
|
680
1589
|
|
681
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserCompletionRequest)).returns(::StackOne::Operations::LmsGetUserCompletionResponse) }
|
682
|
-
def get_user_completion(request)
|
1590
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsGetUserCompletionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsGetUserCompletionResponse) }
|
1591
|
+
def get_user_completion(request, retries = nil, timeout_ms = nil)
|
683
1592
|
# get_user_completion - Get User Completion
|
684
1593
|
url, params = @sdk_configuration.get_server_details
|
685
1594
|
base_url = Utils.template_url(url, params)
|
@@ -693,12 +1602,76 @@ module StackOne
|
|
693
1602
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsGetUserCompletionRequest, request)
|
694
1603
|
headers['Accept'] = 'application/json'
|
695
1604
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1605
|
+
retries ||= @sdk_configuration.retry_config
|
1606
|
+
retries ||= Utils::RetryConfig.new(
|
1607
|
+
backoff: Utils::BackoffStrategy.new(
|
1608
|
+
exponent: 1.5,
|
1609
|
+
initial_interval: 500,
|
1610
|
+
max_elapsed_time: 3_600_000,
|
1611
|
+
max_interval: 60_000
|
1612
|
+
),
|
1613
|
+
retry_connection_errors: true,
|
1614
|
+
strategy: 'backoff'
|
1615
|
+
)
|
1616
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1617
|
+
retry_options[:retry_statuses] = [429, 408]
|
1618
|
+
|
1619
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1620
|
+
|
1621
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1622
|
+
timeout ||= @sdk_configuration.timeout
|
696
1623
|
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
1624
|
+
connection = @sdk_configuration.client.dup
|
1625
|
+
connection.request :retry, retry_options
|
1626
|
+
|
1627
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1628
|
+
base_url: base_url,
|
1629
|
+
oauth2_scopes: [],
|
1630
|
+
operation_id: 'lms_get_user_completion',
|
1631
|
+
security_source: @sdk_configuration.security_source
|
1632
|
+
)
|
1633
|
+
|
1634
|
+
error = T.let(nil, T.nilable(StandardError))
|
1635
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1636
|
+
|
1637
|
+
begin
|
1638
|
+
r = connection.get(url) do |req|
|
1639
|
+
req.headers.merge!(headers)
|
1640
|
+
req.options.timeout = timeout unless timeout.nil?
|
1641
|
+
req.params = query_params
|
1642
|
+
Utils.configure_request_security(req, security)
|
1643
|
+
|
1644
|
+
@sdk_configuration.hooks.before_request(
|
1645
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1646
|
+
hook_ctx: hook_ctx
|
1647
|
+
),
|
1648
|
+
request: req
|
1649
|
+
)
|
1650
|
+
end
|
1651
|
+
rescue StandardError => e
|
1652
|
+
error = e
|
1653
|
+
ensure
|
1654
|
+
if r.nil? || Utils.error_status?(r.status)
|
1655
|
+
r = @sdk_configuration.hooks.after_error(
|
1656
|
+
error: error,
|
1657
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1658
|
+
hook_ctx: hook_ctx
|
1659
|
+
),
|
1660
|
+
response: r
|
1661
|
+
)
|
1662
|
+
else
|
1663
|
+
r = @sdk_configuration.hooks.after_success(
|
1664
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1665
|
+
hook_ctx: hook_ctx
|
1666
|
+
),
|
1667
|
+
response: r
|
1668
|
+
)
|
1669
|
+
end
|
1670
|
+
|
1671
|
+
if r.nil?
|
1672
|
+
raise error if !error.nil?
|
1673
|
+
raise 'no response'
|
1674
|
+
end
|
702
1675
|
end
|
703
1676
|
|
704
1677
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -721,8 +1694,8 @@ module StackOne
|
|
721
1694
|
end
|
722
1695
|
|
723
1696
|
|
724
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListAssignmentsRequest)).returns(::StackOne::Operations::LmsListAssignmentsResponse) }
|
725
|
-
def list_assignments(request)
|
1697
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListAssignmentsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListAssignmentsResponse) }
|
1698
|
+
def list_assignments(request, retries = nil, timeout_ms = nil)
|
726
1699
|
# list_assignments - List Assignments
|
727
1700
|
url, params = @sdk_configuration.get_server_details
|
728
1701
|
base_url = Utils.template_url(url, params)
|
@@ -731,12 +1704,76 @@ module StackOne
|
|
731
1704
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListAssignmentsRequest, request)
|
732
1705
|
headers['Accept'] = 'application/json'
|
733
1706
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1707
|
+
retries ||= @sdk_configuration.retry_config
|
1708
|
+
retries ||= Utils::RetryConfig.new(
|
1709
|
+
backoff: Utils::BackoffStrategy.new(
|
1710
|
+
exponent: 1.5,
|
1711
|
+
initial_interval: 500,
|
1712
|
+
max_elapsed_time: 3_600_000,
|
1713
|
+
max_interval: 60_000
|
1714
|
+
),
|
1715
|
+
retry_connection_errors: true,
|
1716
|
+
strategy: 'backoff'
|
1717
|
+
)
|
1718
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1719
|
+
retry_options[:retry_statuses] = [429, 408]
|
1720
|
+
|
1721
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1722
|
+
|
1723
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1724
|
+
timeout ||= @sdk_configuration.timeout
|
734
1725
|
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
1726
|
+
connection = @sdk_configuration.client.dup
|
1727
|
+
connection.request :retry, retry_options
|
1728
|
+
|
1729
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1730
|
+
base_url: base_url,
|
1731
|
+
oauth2_scopes: [],
|
1732
|
+
operation_id: 'lms_list_assignments',
|
1733
|
+
security_source: @sdk_configuration.security_source
|
1734
|
+
)
|
1735
|
+
|
1736
|
+
error = T.let(nil, T.nilable(StandardError))
|
1737
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1738
|
+
|
1739
|
+
begin
|
1740
|
+
r = connection.get(url) do |req|
|
1741
|
+
req.headers.merge!(headers)
|
1742
|
+
req.options.timeout = timeout unless timeout.nil?
|
1743
|
+
req.params = query_params
|
1744
|
+
Utils.configure_request_security(req, security)
|
1745
|
+
|
1746
|
+
@sdk_configuration.hooks.before_request(
|
1747
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1748
|
+
hook_ctx: hook_ctx
|
1749
|
+
),
|
1750
|
+
request: req
|
1751
|
+
)
|
1752
|
+
end
|
1753
|
+
rescue StandardError => e
|
1754
|
+
error = e
|
1755
|
+
ensure
|
1756
|
+
if r.nil? || Utils.error_status?(r.status)
|
1757
|
+
r = @sdk_configuration.hooks.after_error(
|
1758
|
+
error: error,
|
1759
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1760
|
+
hook_ctx: hook_ctx
|
1761
|
+
),
|
1762
|
+
response: r
|
1763
|
+
)
|
1764
|
+
else
|
1765
|
+
r = @sdk_configuration.hooks.after_success(
|
1766
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1767
|
+
hook_ctx: hook_ctx
|
1768
|
+
),
|
1769
|
+
response: r
|
1770
|
+
)
|
1771
|
+
end
|
1772
|
+
|
1773
|
+
if r.nil?
|
1774
|
+
raise error if !error.nil?
|
1775
|
+
raise 'no response'
|
1776
|
+
end
|
740
1777
|
end
|
741
1778
|
|
742
1779
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -759,8 +1796,8 @@ module StackOne
|
|
759
1796
|
end
|
760
1797
|
|
761
1798
|
|
762
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListCategoriesRequest)).returns(::StackOne::Operations::LmsListCategoriesResponse) }
|
763
|
-
def list_categories(request)
|
1799
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListCategoriesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListCategoriesResponse) }
|
1800
|
+
def list_categories(request, retries = nil, timeout_ms = nil)
|
764
1801
|
# list_categories - List Categories
|
765
1802
|
url, params = @sdk_configuration.get_server_details
|
766
1803
|
base_url = Utils.template_url(url, params)
|
@@ -769,12 +1806,76 @@ module StackOne
|
|
769
1806
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListCategoriesRequest, request)
|
770
1807
|
headers['Accept'] = 'application/json'
|
771
1808
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1809
|
+
retries ||= @sdk_configuration.retry_config
|
1810
|
+
retries ||= Utils::RetryConfig.new(
|
1811
|
+
backoff: Utils::BackoffStrategy.new(
|
1812
|
+
exponent: 1.5,
|
1813
|
+
initial_interval: 500,
|
1814
|
+
max_elapsed_time: 3_600_000,
|
1815
|
+
max_interval: 60_000
|
1816
|
+
),
|
1817
|
+
retry_connection_errors: true,
|
1818
|
+
strategy: 'backoff'
|
1819
|
+
)
|
1820
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1821
|
+
retry_options[:retry_statuses] = [429, 408]
|
772
1822
|
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
1823
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1824
|
+
|
1825
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1826
|
+
timeout ||= @sdk_configuration.timeout
|
1827
|
+
|
1828
|
+
connection = @sdk_configuration.client.dup
|
1829
|
+
connection.request :retry, retry_options
|
1830
|
+
|
1831
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1832
|
+
base_url: base_url,
|
1833
|
+
oauth2_scopes: [],
|
1834
|
+
operation_id: 'lms_list_categories',
|
1835
|
+
security_source: @sdk_configuration.security_source
|
1836
|
+
)
|
1837
|
+
|
1838
|
+
error = T.let(nil, T.nilable(StandardError))
|
1839
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1840
|
+
|
1841
|
+
begin
|
1842
|
+
r = connection.get(url) do |req|
|
1843
|
+
req.headers.merge!(headers)
|
1844
|
+
req.options.timeout = timeout unless timeout.nil?
|
1845
|
+
req.params = query_params
|
1846
|
+
Utils.configure_request_security(req, security)
|
1847
|
+
|
1848
|
+
@sdk_configuration.hooks.before_request(
|
1849
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1850
|
+
hook_ctx: hook_ctx
|
1851
|
+
),
|
1852
|
+
request: req
|
1853
|
+
)
|
1854
|
+
end
|
1855
|
+
rescue StandardError => e
|
1856
|
+
error = e
|
1857
|
+
ensure
|
1858
|
+
if r.nil? || Utils.error_status?(r.status)
|
1859
|
+
r = @sdk_configuration.hooks.after_error(
|
1860
|
+
error: error,
|
1861
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1862
|
+
hook_ctx: hook_ctx
|
1863
|
+
),
|
1864
|
+
response: r
|
1865
|
+
)
|
1866
|
+
else
|
1867
|
+
r = @sdk_configuration.hooks.after_success(
|
1868
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1869
|
+
hook_ctx: hook_ctx
|
1870
|
+
),
|
1871
|
+
response: r
|
1872
|
+
)
|
1873
|
+
end
|
1874
|
+
|
1875
|
+
if r.nil?
|
1876
|
+
raise error if !error.nil?
|
1877
|
+
raise 'no response'
|
1878
|
+
end
|
778
1879
|
end
|
779
1880
|
|
780
1881
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -797,8 +1898,8 @@ module StackOne
|
|
797
1898
|
end
|
798
1899
|
|
799
1900
|
|
800
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListCompletionsRequest)).returns(::StackOne::Operations::LmsListCompletionsResponse) }
|
801
|
-
def list_completions(request)
|
1901
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListCompletionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListCompletionsResponse) }
|
1902
|
+
def list_completions(request, retries = nil, timeout_ms = nil)
|
802
1903
|
# list_completions - List Completions
|
803
1904
|
url, params = @sdk_configuration.get_server_details
|
804
1905
|
base_url = Utils.template_url(url, params)
|
@@ -807,12 +1908,76 @@ module StackOne
|
|
807
1908
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListCompletionsRequest, request)
|
808
1909
|
headers['Accept'] = 'application/json'
|
809
1910
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1911
|
+
retries ||= @sdk_configuration.retry_config
|
1912
|
+
retries ||= Utils::RetryConfig.new(
|
1913
|
+
backoff: Utils::BackoffStrategy.new(
|
1914
|
+
exponent: 1.5,
|
1915
|
+
initial_interval: 500,
|
1916
|
+
max_elapsed_time: 3_600_000,
|
1917
|
+
max_interval: 60_000
|
1918
|
+
),
|
1919
|
+
retry_connection_errors: true,
|
1920
|
+
strategy: 'backoff'
|
1921
|
+
)
|
1922
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1923
|
+
retry_options[:retry_statuses] = [429, 408]
|
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
|
+
|
1930
|
+
connection = @sdk_configuration.client.dup
|
1931
|
+
connection.request :retry, retry_options
|
810
1932
|
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
1933
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1934
|
+
base_url: base_url,
|
1935
|
+
oauth2_scopes: [],
|
1936
|
+
operation_id: 'lms_list_completions',
|
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
|
816
1981
|
end
|
817
1982
|
|
818
1983
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -835,8 +2000,8 @@ module StackOne
|
|
835
2000
|
end
|
836
2001
|
|
837
2002
|
|
838
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListContentRequest)).returns(::StackOne::Operations::LmsListContentResponse) }
|
839
|
-
def list_content(request)
|
2003
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListContentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListContentResponse) }
|
2004
|
+
def list_content(request, retries = nil, timeout_ms = nil)
|
840
2005
|
# list_content - List Content
|
841
2006
|
url, params = @sdk_configuration.get_server_details
|
842
2007
|
base_url = Utils.template_url(url, params)
|
@@ -845,12 +2010,76 @@ module StackOne
|
|
845
2010
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListContentRequest, request)
|
846
2011
|
headers['Accept'] = 'application/json'
|
847
2012
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2013
|
+
retries ||= @sdk_configuration.retry_config
|
2014
|
+
retries ||= Utils::RetryConfig.new(
|
2015
|
+
backoff: Utils::BackoffStrategy.new(
|
2016
|
+
exponent: 1.5,
|
2017
|
+
initial_interval: 500,
|
2018
|
+
max_elapsed_time: 3_600_000,
|
2019
|
+
max_interval: 60_000
|
2020
|
+
),
|
2021
|
+
retry_connection_errors: true,
|
2022
|
+
strategy: 'backoff'
|
2023
|
+
)
|
2024
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2025
|
+
retry_options[:retry_statuses] = [429, 408]
|
2026
|
+
|
2027
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2028
|
+
|
2029
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2030
|
+
timeout ||= @sdk_configuration.timeout
|
848
2031
|
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
2032
|
+
connection = @sdk_configuration.client.dup
|
2033
|
+
connection.request :retry, retry_options
|
2034
|
+
|
2035
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2036
|
+
base_url: base_url,
|
2037
|
+
oauth2_scopes: [],
|
2038
|
+
operation_id: 'lms_list_content',
|
2039
|
+
security_source: @sdk_configuration.security_source
|
2040
|
+
)
|
2041
|
+
|
2042
|
+
error = T.let(nil, T.nilable(StandardError))
|
2043
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2044
|
+
|
2045
|
+
begin
|
2046
|
+
r = connection.get(url) do |req|
|
2047
|
+
req.headers.merge!(headers)
|
2048
|
+
req.options.timeout = timeout unless timeout.nil?
|
2049
|
+
req.params = query_params
|
2050
|
+
Utils.configure_request_security(req, security)
|
2051
|
+
|
2052
|
+
@sdk_configuration.hooks.before_request(
|
2053
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2054
|
+
hook_ctx: hook_ctx
|
2055
|
+
),
|
2056
|
+
request: req
|
2057
|
+
)
|
2058
|
+
end
|
2059
|
+
rescue StandardError => e
|
2060
|
+
error = e
|
2061
|
+
ensure
|
2062
|
+
if r.nil? || Utils.error_status?(r.status)
|
2063
|
+
r = @sdk_configuration.hooks.after_error(
|
2064
|
+
error: error,
|
2065
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2066
|
+
hook_ctx: hook_ctx
|
2067
|
+
),
|
2068
|
+
response: r
|
2069
|
+
)
|
2070
|
+
else
|
2071
|
+
r = @sdk_configuration.hooks.after_success(
|
2072
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2073
|
+
hook_ctx: hook_ctx
|
2074
|
+
),
|
2075
|
+
response: r
|
2076
|
+
)
|
2077
|
+
end
|
2078
|
+
|
2079
|
+
if r.nil?
|
2080
|
+
raise error if !error.nil?
|
2081
|
+
raise 'no response'
|
2082
|
+
end
|
854
2083
|
end
|
855
2084
|
|
856
2085
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -873,8 +2102,8 @@ module StackOne
|
|
873
2102
|
end
|
874
2103
|
|
875
2104
|
|
876
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListCoursesRequest)).returns(::StackOne::Operations::LmsListCoursesResponse) }
|
877
|
-
def list_courses(request)
|
2105
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListCoursesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListCoursesResponse) }
|
2106
|
+
def list_courses(request, retries = nil, timeout_ms = nil)
|
878
2107
|
# list_courses - List Courses
|
879
2108
|
url, params = @sdk_configuration.get_server_details
|
880
2109
|
base_url = Utils.template_url(url, params)
|
@@ -883,12 +2112,76 @@ module StackOne
|
|
883
2112
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListCoursesRequest, request)
|
884
2113
|
headers['Accept'] = 'application/json'
|
885
2114
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2115
|
+
retries ||= @sdk_configuration.retry_config
|
2116
|
+
retries ||= Utils::RetryConfig.new(
|
2117
|
+
backoff: Utils::BackoffStrategy.new(
|
2118
|
+
exponent: 1.5,
|
2119
|
+
initial_interval: 500,
|
2120
|
+
max_elapsed_time: 3_600_000,
|
2121
|
+
max_interval: 60_000
|
2122
|
+
),
|
2123
|
+
retry_connection_errors: true,
|
2124
|
+
strategy: 'backoff'
|
2125
|
+
)
|
2126
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2127
|
+
retry_options[:retry_statuses] = [429, 408]
|
2128
|
+
|
2129
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2130
|
+
|
2131
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2132
|
+
timeout ||= @sdk_configuration.timeout
|
2133
|
+
|
2134
|
+
connection = @sdk_configuration.client.dup
|
2135
|
+
connection.request :retry, retry_options
|
2136
|
+
|
2137
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2138
|
+
base_url: base_url,
|
2139
|
+
oauth2_scopes: [],
|
2140
|
+
operation_id: 'lms_list_courses',
|
2141
|
+
security_source: @sdk_configuration.security_source
|
2142
|
+
)
|
886
2143
|
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
2144
|
+
error = T.let(nil, T.nilable(StandardError))
|
2145
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2146
|
+
|
2147
|
+
begin
|
2148
|
+
r = connection.get(url) do |req|
|
2149
|
+
req.headers.merge!(headers)
|
2150
|
+
req.options.timeout = timeout unless timeout.nil?
|
2151
|
+
req.params = query_params
|
2152
|
+
Utils.configure_request_security(req, security)
|
2153
|
+
|
2154
|
+
@sdk_configuration.hooks.before_request(
|
2155
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2156
|
+
hook_ctx: hook_ctx
|
2157
|
+
),
|
2158
|
+
request: req
|
2159
|
+
)
|
2160
|
+
end
|
2161
|
+
rescue StandardError => e
|
2162
|
+
error = e
|
2163
|
+
ensure
|
2164
|
+
if r.nil? || Utils.error_status?(r.status)
|
2165
|
+
r = @sdk_configuration.hooks.after_error(
|
2166
|
+
error: error,
|
2167
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2168
|
+
hook_ctx: hook_ctx
|
2169
|
+
),
|
2170
|
+
response: r
|
2171
|
+
)
|
2172
|
+
else
|
2173
|
+
r = @sdk_configuration.hooks.after_success(
|
2174
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2175
|
+
hook_ctx: hook_ctx
|
2176
|
+
),
|
2177
|
+
response: r
|
2178
|
+
)
|
2179
|
+
end
|
2180
|
+
|
2181
|
+
if r.nil?
|
2182
|
+
raise error if !error.nil?
|
2183
|
+
raise 'no response'
|
2184
|
+
end
|
892
2185
|
end
|
893
2186
|
|
894
2187
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -911,8 +2204,8 @@ module StackOne
|
|
911
2204
|
end
|
912
2205
|
|
913
2206
|
|
914
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListSkillsRequest)).returns(::StackOne::Operations::LmsListSkillsResponse) }
|
915
|
-
def list_skills(request)
|
2207
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListSkillsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListSkillsResponse) }
|
2208
|
+
def list_skills(request, retries = nil, timeout_ms = nil)
|
916
2209
|
# list_skills - List Skills
|
917
2210
|
url, params = @sdk_configuration.get_server_details
|
918
2211
|
base_url = Utils.template_url(url, params)
|
@@ -921,12 +2214,76 @@ module StackOne
|
|
921
2214
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListSkillsRequest, request)
|
922
2215
|
headers['Accept'] = 'application/json'
|
923
2216
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2217
|
+
retries ||= @sdk_configuration.retry_config
|
2218
|
+
retries ||= Utils::RetryConfig.new(
|
2219
|
+
backoff: Utils::BackoffStrategy.new(
|
2220
|
+
exponent: 1.5,
|
2221
|
+
initial_interval: 500,
|
2222
|
+
max_elapsed_time: 3_600_000,
|
2223
|
+
max_interval: 60_000
|
2224
|
+
),
|
2225
|
+
retry_connection_errors: true,
|
2226
|
+
strategy: 'backoff'
|
2227
|
+
)
|
2228
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2229
|
+
retry_options[:retry_statuses] = [429, 408]
|
2230
|
+
|
2231
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2232
|
+
|
2233
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2234
|
+
timeout ||= @sdk_configuration.timeout
|
924
2235
|
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
2236
|
+
connection = @sdk_configuration.client.dup
|
2237
|
+
connection.request :retry, retry_options
|
2238
|
+
|
2239
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2240
|
+
base_url: base_url,
|
2241
|
+
oauth2_scopes: [],
|
2242
|
+
operation_id: 'lms_list_skills',
|
2243
|
+
security_source: @sdk_configuration.security_source
|
2244
|
+
)
|
2245
|
+
|
2246
|
+
error = T.let(nil, T.nilable(StandardError))
|
2247
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2248
|
+
|
2249
|
+
begin
|
2250
|
+
r = connection.get(url) do |req|
|
2251
|
+
req.headers.merge!(headers)
|
2252
|
+
req.options.timeout = timeout unless timeout.nil?
|
2253
|
+
req.params = query_params
|
2254
|
+
Utils.configure_request_security(req, security)
|
2255
|
+
|
2256
|
+
@sdk_configuration.hooks.before_request(
|
2257
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2258
|
+
hook_ctx: hook_ctx
|
2259
|
+
),
|
2260
|
+
request: req
|
2261
|
+
)
|
2262
|
+
end
|
2263
|
+
rescue StandardError => e
|
2264
|
+
error = e
|
2265
|
+
ensure
|
2266
|
+
if r.nil? || Utils.error_status?(r.status)
|
2267
|
+
r = @sdk_configuration.hooks.after_error(
|
2268
|
+
error: error,
|
2269
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2270
|
+
hook_ctx: hook_ctx
|
2271
|
+
),
|
2272
|
+
response: r
|
2273
|
+
)
|
2274
|
+
else
|
2275
|
+
r = @sdk_configuration.hooks.after_success(
|
2276
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2277
|
+
hook_ctx: hook_ctx
|
2278
|
+
),
|
2279
|
+
response: r
|
2280
|
+
)
|
2281
|
+
end
|
2282
|
+
|
2283
|
+
if r.nil?
|
2284
|
+
raise error if !error.nil?
|
2285
|
+
raise 'no response'
|
2286
|
+
end
|
930
2287
|
end
|
931
2288
|
|
932
2289
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -949,8 +2306,8 @@ module StackOne
|
|
949
2306
|
end
|
950
2307
|
|
951
2308
|
|
952
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserAssignmentsRequest)).returns(::StackOne::Operations::LmsListUserAssignmentsResponse) }
|
953
|
-
def list_user_assignments(request)
|
2309
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserAssignmentsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListUserAssignmentsResponse) }
|
2310
|
+
def list_user_assignments(request, retries = nil, timeout_ms = nil)
|
954
2311
|
# list_user_assignments - List User Assignments
|
955
2312
|
url, params = @sdk_configuration.get_server_details
|
956
2313
|
base_url = Utils.template_url(url, params)
|
@@ -964,12 +2321,76 @@ module StackOne
|
|
964
2321
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListUserAssignmentsRequest, request)
|
965
2322
|
headers['Accept'] = 'application/json'
|
966
2323
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2324
|
+
retries ||= @sdk_configuration.retry_config
|
2325
|
+
retries ||= Utils::RetryConfig.new(
|
2326
|
+
backoff: Utils::BackoffStrategy.new(
|
2327
|
+
exponent: 1.5,
|
2328
|
+
initial_interval: 500,
|
2329
|
+
max_elapsed_time: 3_600_000,
|
2330
|
+
max_interval: 60_000
|
2331
|
+
),
|
2332
|
+
retry_connection_errors: true,
|
2333
|
+
strategy: 'backoff'
|
2334
|
+
)
|
2335
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2336
|
+
retry_options[:retry_statuses] = [429, 408]
|
2337
|
+
|
2338
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
967
2339
|
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
2340
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2341
|
+
timeout ||= @sdk_configuration.timeout
|
2342
|
+
|
2343
|
+
connection = @sdk_configuration.client.dup
|
2344
|
+
connection.request :retry, retry_options
|
2345
|
+
|
2346
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2347
|
+
base_url: base_url,
|
2348
|
+
oauth2_scopes: [],
|
2349
|
+
operation_id: 'lms_list_user_assignments',
|
2350
|
+
security_source: @sdk_configuration.security_source
|
2351
|
+
)
|
2352
|
+
|
2353
|
+
error = T.let(nil, T.nilable(StandardError))
|
2354
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2355
|
+
|
2356
|
+
begin
|
2357
|
+
r = connection.get(url) do |req|
|
2358
|
+
req.headers.merge!(headers)
|
2359
|
+
req.options.timeout = timeout unless timeout.nil?
|
2360
|
+
req.params = query_params
|
2361
|
+
Utils.configure_request_security(req, security)
|
2362
|
+
|
2363
|
+
@sdk_configuration.hooks.before_request(
|
2364
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2365
|
+
hook_ctx: hook_ctx
|
2366
|
+
),
|
2367
|
+
request: req
|
2368
|
+
)
|
2369
|
+
end
|
2370
|
+
rescue StandardError => e
|
2371
|
+
error = e
|
2372
|
+
ensure
|
2373
|
+
if r.nil? || Utils.error_status?(r.status)
|
2374
|
+
r = @sdk_configuration.hooks.after_error(
|
2375
|
+
error: error,
|
2376
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2377
|
+
hook_ctx: hook_ctx
|
2378
|
+
),
|
2379
|
+
response: r
|
2380
|
+
)
|
2381
|
+
else
|
2382
|
+
r = @sdk_configuration.hooks.after_success(
|
2383
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2384
|
+
hook_ctx: hook_ctx
|
2385
|
+
),
|
2386
|
+
response: r
|
2387
|
+
)
|
2388
|
+
end
|
2389
|
+
|
2390
|
+
if r.nil?
|
2391
|
+
raise error if !error.nil?
|
2392
|
+
raise 'no response'
|
2393
|
+
end
|
973
2394
|
end
|
974
2395
|
|
975
2396
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -992,8 +2413,8 @@ module StackOne
|
|
992
2413
|
end
|
993
2414
|
|
994
2415
|
|
995
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserCompletionsRequest)).returns(::StackOne::Operations::LmsListUserCompletionsResponse) }
|
996
|
-
def list_user_completions(request)
|
2416
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListUserCompletionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListUserCompletionsResponse) }
|
2417
|
+
def list_user_completions(request, retries = nil, timeout_ms = nil)
|
997
2418
|
# list_user_completions - List User Completions
|
998
2419
|
url, params = @sdk_configuration.get_server_details
|
999
2420
|
base_url = Utils.template_url(url, params)
|
@@ -1007,12 +2428,76 @@ module StackOne
|
|
1007
2428
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListUserCompletionsRequest, request)
|
1008
2429
|
headers['Accept'] = 'application/json'
|
1009
2430
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2431
|
+
retries ||= @sdk_configuration.retry_config
|
2432
|
+
retries ||= Utils::RetryConfig.new(
|
2433
|
+
backoff: Utils::BackoffStrategy.new(
|
2434
|
+
exponent: 1.5,
|
2435
|
+
initial_interval: 500,
|
2436
|
+
max_elapsed_time: 3_600_000,
|
2437
|
+
max_interval: 60_000
|
2438
|
+
),
|
2439
|
+
retry_connection_errors: true,
|
2440
|
+
strategy: 'backoff'
|
2441
|
+
)
|
2442
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2443
|
+
retry_options[:retry_statuses] = [429, 408]
|
2444
|
+
|
2445
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2446
|
+
|
2447
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2448
|
+
timeout ||= @sdk_configuration.timeout
|
1010
2449
|
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
2450
|
+
connection = @sdk_configuration.client.dup
|
2451
|
+
connection.request :retry, retry_options
|
2452
|
+
|
2453
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2454
|
+
base_url: base_url,
|
2455
|
+
oauth2_scopes: [],
|
2456
|
+
operation_id: 'lms_list_user_completions',
|
2457
|
+
security_source: @sdk_configuration.security_source
|
2458
|
+
)
|
2459
|
+
|
2460
|
+
error = T.let(nil, T.nilable(StandardError))
|
2461
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2462
|
+
|
2463
|
+
begin
|
2464
|
+
r = connection.get(url) do |req|
|
2465
|
+
req.headers.merge!(headers)
|
2466
|
+
req.options.timeout = timeout unless timeout.nil?
|
2467
|
+
req.params = query_params
|
2468
|
+
Utils.configure_request_security(req, security)
|
2469
|
+
|
2470
|
+
@sdk_configuration.hooks.before_request(
|
2471
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2472
|
+
hook_ctx: hook_ctx
|
2473
|
+
),
|
2474
|
+
request: req
|
2475
|
+
)
|
2476
|
+
end
|
2477
|
+
rescue StandardError => e
|
2478
|
+
error = e
|
2479
|
+
ensure
|
2480
|
+
if r.nil? || Utils.error_status?(r.status)
|
2481
|
+
r = @sdk_configuration.hooks.after_error(
|
2482
|
+
error: error,
|
2483
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2484
|
+
hook_ctx: hook_ctx
|
2485
|
+
),
|
2486
|
+
response: r
|
2487
|
+
)
|
2488
|
+
else
|
2489
|
+
r = @sdk_configuration.hooks.after_success(
|
2490
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2491
|
+
hook_ctx: hook_ctx
|
2492
|
+
),
|
2493
|
+
response: r
|
2494
|
+
)
|
2495
|
+
end
|
2496
|
+
|
2497
|
+
if r.nil?
|
2498
|
+
raise error if !error.nil?
|
2499
|
+
raise 'no response'
|
2500
|
+
end
|
1016
2501
|
end
|
1017
2502
|
|
1018
2503
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1035,8 +2520,8 @@ module StackOne
|
|
1035
2520
|
end
|
1036
2521
|
|
1037
2522
|
|
1038
|
-
sig { params(request: T.nilable(::StackOne::Operations::LmsListUsersRequest)).returns(::StackOne::Operations::LmsListUsersResponse) }
|
1039
|
-
def list_users(request)
|
2523
|
+
sig { params(request: T.nilable(::StackOne::Operations::LmsListUsersRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::LmsListUsersResponse) }
|
2524
|
+
def list_users(request, retries = nil, timeout_ms = nil)
|
1040
2525
|
# list_users - List Users
|
1041
2526
|
url, params = @sdk_configuration.get_server_details
|
1042
2527
|
base_url = Utils.template_url(url, params)
|
@@ -1045,12 +2530,76 @@ module StackOne
|
|
1045
2530
|
query_params = Utils.get_query_params(::StackOne::Operations::LmsListUsersRequest, request)
|
1046
2531
|
headers['Accept'] = 'application/json'
|
1047
2532
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2533
|
+
retries ||= @sdk_configuration.retry_config
|
2534
|
+
retries ||= Utils::RetryConfig.new(
|
2535
|
+
backoff: Utils::BackoffStrategy.new(
|
2536
|
+
exponent: 1.5,
|
2537
|
+
initial_interval: 500,
|
2538
|
+
max_elapsed_time: 3_600_000,
|
2539
|
+
max_interval: 60_000
|
2540
|
+
),
|
2541
|
+
retry_connection_errors: true,
|
2542
|
+
strategy: 'backoff'
|
2543
|
+
)
|
2544
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2545
|
+
retry_options[:retry_statuses] = [429, 408]
|
2546
|
+
|
2547
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2548
|
+
|
2549
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2550
|
+
timeout ||= @sdk_configuration.timeout
|
1048
2551
|
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
2552
|
+
connection = @sdk_configuration.client.dup
|
2553
|
+
connection.request :retry, retry_options
|
2554
|
+
|
2555
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2556
|
+
base_url: base_url,
|
2557
|
+
oauth2_scopes: [],
|
2558
|
+
operation_id: 'lms_list_users',
|
2559
|
+
security_source: @sdk_configuration.security_source
|
2560
|
+
)
|
2561
|
+
|
2562
|
+
error = T.let(nil, T.nilable(StandardError))
|
2563
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2564
|
+
|
2565
|
+
begin
|
2566
|
+
r = connection.get(url) do |req|
|
2567
|
+
req.headers.merge!(headers)
|
2568
|
+
req.options.timeout = timeout unless timeout.nil?
|
2569
|
+
req.params = query_params
|
2570
|
+
Utils.configure_request_security(req, security)
|
2571
|
+
|
2572
|
+
@sdk_configuration.hooks.before_request(
|
2573
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2574
|
+
hook_ctx: hook_ctx
|
2575
|
+
),
|
2576
|
+
request: req
|
2577
|
+
)
|
2578
|
+
end
|
2579
|
+
rescue StandardError => e
|
2580
|
+
error = e
|
2581
|
+
ensure
|
2582
|
+
if r.nil? || Utils.error_status?(r.status)
|
2583
|
+
r = @sdk_configuration.hooks.after_error(
|
2584
|
+
error: error,
|
2585
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2586
|
+
hook_ctx: hook_ctx
|
2587
|
+
),
|
2588
|
+
response: r
|
2589
|
+
)
|
2590
|
+
else
|
2591
|
+
r = @sdk_configuration.hooks.after_success(
|
2592
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2593
|
+
hook_ctx: hook_ctx
|
2594
|
+
),
|
2595
|
+
response: r
|
2596
|
+
)
|
2597
|
+
end
|
2598
|
+
|
2599
|
+
if r.nil?
|
2600
|
+
raise error if !error.nil?
|
2601
|
+
raise 'no response'
|
2602
|
+
end
|
1054
2603
|
end
|
1055
2604
|
|
1056
2605
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -1073,8 +2622,8 @@ module StackOne
|
|
1073
2622
|
end
|
1074
2623
|
|
1075
2624
|
|
1076
|
-
sig { params(lms_create_collection_request_dto: ::StackOne::Shared::LmsCreateCollectionRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::LmsUpdateCollectionResponse) }
|
1077
|
-
def update_collection(lms_create_collection_request_dto, id, x_account_id)
|
2625
|
+
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) }
|
2626
|
+
def update_collection(lms_create_collection_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1078
2627
|
# update_collection - Update Collection
|
1079
2628
|
request = ::StackOne::Operations::LmsUpdateCollectionRequest.new(
|
1080
2629
|
|
@@ -1094,19 +2643,85 @@ module StackOne
|
|
1094
2643
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_collection_request_dto, :json)
|
1095
2644
|
headers['content-type'] = req_content_type
|
1096
2645
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2646
|
+
|
2647
|
+
if form
|
2648
|
+
body = Utils.encode_form(form)
|
2649
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2650
|
+
body = URI.encode_www_form(data)
|
2651
|
+
else
|
2652
|
+
body = data
|
2653
|
+
end
|
1097
2654
|
headers['Accept'] = 'application/json'
|
1098
2655
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2656
|
+
retries ||= @sdk_configuration.retry_config
|
2657
|
+
retries ||= Utils::RetryConfig.new(
|
2658
|
+
backoff: Utils::BackoffStrategy.new(
|
2659
|
+
exponent: 1.5,
|
2660
|
+
initial_interval: 500,
|
2661
|
+
max_elapsed_time: 3_600_000,
|
2662
|
+
max_interval: 60_000
|
2663
|
+
),
|
2664
|
+
retry_connection_errors: true,
|
2665
|
+
strategy: 'backoff'
|
2666
|
+
)
|
2667
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2668
|
+
retry_options[:retry_statuses] = [429, 408]
|
2669
|
+
|
2670
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2671
|
+
|
2672
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2673
|
+
timeout ||= @sdk_configuration.timeout
|
2674
|
+
|
2675
|
+
connection = @sdk_configuration.client.dup
|
2676
|
+
connection.request :retry, retry_options
|
1099
2677
|
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
2678
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2679
|
+
base_url: base_url,
|
2680
|
+
oauth2_scopes: [],
|
2681
|
+
operation_id: 'lms_update_collection',
|
2682
|
+
security_source: @sdk_configuration.security_source
|
2683
|
+
)
|
2684
|
+
|
2685
|
+
error = T.let(nil, T.nilable(StandardError))
|
2686
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2687
|
+
|
2688
|
+
begin
|
2689
|
+
r = connection.patch(url) do |req|
|
2690
|
+
req.body = body
|
2691
|
+
req.headers.merge!(headers)
|
2692
|
+
req.options.timeout = timeout unless timeout.nil?
|
2693
|
+
Utils.configure_request_security(req, security)
|
2694
|
+
|
2695
|
+
@sdk_configuration.hooks.before_request(
|
2696
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2697
|
+
hook_ctx: hook_ctx
|
2698
|
+
),
|
2699
|
+
request: req
|
2700
|
+
)
|
2701
|
+
end
|
2702
|
+
rescue StandardError => e
|
2703
|
+
error = e
|
2704
|
+
ensure
|
2705
|
+
if r.nil? || Utils.error_status?(r.status)
|
2706
|
+
r = @sdk_configuration.hooks.after_error(
|
2707
|
+
error: error,
|
2708
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2709
|
+
hook_ctx: hook_ctx
|
2710
|
+
),
|
2711
|
+
response: r
|
2712
|
+
)
|
1108
2713
|
else
|
1109
|
-
|
2714
|
+
r = @sdk_configuration.hooks.after_success(
|
2715
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2716
|
+
hook_ctx: hook_ctx
|
2717
|
+
),
|
2718
|
+
response: r
|
2719
|
+
)
|
2720
|
+
end
|
2721
|
+
|
2722
|
+
if r.nil?
|
2723
|
+
raise error if !error.nil?
|
2724
|
+
raise 'no response'
|
1110
2725
|
end
|
1111
2726
|
end
|
1112
2727
|
|
@@ -1130,8 +2745,8 @@ module StackOne
|
|
1130
2745
|
end
|
1131
2746
|
|
1132
2747
|
|
1133
|
-
sig { params(lms_upsert_content_request_dto: ::StackOne::Shared::LmsUpsertContentRequestDto, x_account_id: ::String).returns(::StackOne::Operations::LmsUpsertContentResponse) }
|
1134
|
-
def upsert_content(lms_upsert_content_request_dto, x_account_id)
|
2748
|
+
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) }
|
2749
|
+
def upsert_content(lms_upsert_content_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
1135
2750
|
# upsert_content - Upsert Content
|
1136
2751
|
request = ::StackOne::Operations::LmsUpsertContentRequest.new(
|
1137
2752
|
|
@@ -1145,19 +2760,85 @@ module StackOne
|
|
1145
2760
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_upsert_content_request_dto, :json)
|
1146
2761
|
headers['content-type'] = req_content_type
|
1147
2762
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2763
|
+
|
2764
|
+
if form
|
2765
|
+
body = Utils.encode_form(form)
|
2766
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2767
|
+
body = URI.encode_www_form(data)
|
2768
|
+
else
|
2769
|
+
body = data
|
2770
|
+
end
|
1148
2771
|
headers['Accept'] = 'application/json'
|
1149
2772
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2773
|
+
retries ||= @sdk_configuration.retry_config
|
2774
|
+
retries ||= Utils::RetryConfig.new(
|
2775
|
+
backoff: Utils::BackoffStrategy.new(
|
2776
|
+
exponent: 1.5,
|
2777
|
+
initial_interval: 500,
|
2778
|
+
max_elapsed_time: 3_600_000,
|
2779
|
+
max_interval: 60_000
|
2780
|
+
),
|
2781
|
+
retry_connection_errors: true,
|
2782
|
+
strategy: 'backoff'
|
2783
|
+
)
|
2784
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2785
|
+
retry_options[:retry_statuses] = [429, 408]
|
2786
|
+
|
2787
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1150
2788
|
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
2789
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2790
|
+
timeout ||= @sdk_configuration.timeout
|
2791
|
+
|
2792
|
+
connection = @sdk_configuration.client.dup
|
2793
|
+
connection.request :retry, retry_options
|
2794
|
+
|
2795
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2796
|
+
base_url: base_url,
|
2797
|
+
oauth2_scopes: [],
|
2798
|
+
operation_id: 'lms_upsert_content',
|
2799
|
+
security_source: @sdk_configuration.security_source
|
2800
|
+
)
|
2801
|
+
|
2802
|
+
error = T.let(nil, T.nilable(StandardError))
|
2803
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2804
|
+
|
2805
|
+
begin
|
2806
|
+
r = connection.put(url) do |req|
|
2807
|
+
req.body = body
|
2808
|
+
req.headers.merge!(headers)
|
2809
|
+
req.options.timeout = timeout unless timeout.nil?
|
2810
|
+
Utils.configure_request_security(req, security)
|
2811
|
+
|
2812
|
+
@sdk_configuration.hooks.before_request(
|
2813
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2814
|
+
hook_ctx: hook_ctx
|
2815
|
+
),
|
2816
|
+
request: req
|
2817
|
+
)
|
2818
|
+
end
|
2819
|
+
rescue StandardError => e
|
2820
|
+
error = e
|
2821
|
+
ensure
|
2822
|
+
if r.nil? || Utils.error_status?(r.status)
|
2823
|
+
r = @sdk_configuration.hooks.after_error(
|
2824
|
+
error: error,
|
2825
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2826
|
+
hook_ctx: hook_ctx
|
2827
|
+
),
|
2828
|
+
response: r
|
2829
|
+
)
|
1159
2830
|
else
|
1160
|
-
|
2831
|
+
r = @sdk_configuration.hooks.after_success(
|
2832
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2833
|
+
hook_ctx: hook_ctx
|
2834
|
+
),
|
2835
|
+
response: r
|
2836
|
+
)
|
2837
|
+
end
|
2838
|
+
|
2839
|
+
if r.nil?
|
2840
|
+
raise error if !error.nil?
|
2841
|
+
raise 'no response'
|
1161
2842
|
end
|
1162
2843
|
end
|
1163
2844
|
|
@@ -1181,8 +2862,8 @@ module StackOne
|
|
1181
2862
|
end
|
1182
2863
|
|
1183
2864
|
|
1184
|
-
sig { params(lms_upsert_course_request_dto: ::StackOne::Shared::LmsUpsertCourseRequestDto, x_account_id: ::String).returns(::StackOne::Operations::LmsUpsertCourseResponse) }
|
1185
|
-
def upsert_course(lms_upsert_course_request_dto, x_account_id)
|
2865
|
+
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) }
|
2866
|
+
def upsert_course(lms_upsert_course_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
1186
2867
|
# upsert_course - Upsert Course
|
1187
2868
|
request = ::StackOne::Operations::LmsUpsertCourseRequest.new(
|
1188
2869
|
|
@@ -1196,19 +2877,85 @@ module StackOne
|
|
1196
2877
|
req_content_type, data, form = Utils.serialize_request_body(request, :lms_upsert_course_request_dto, :json)
|
1197
2878
|
headers['content-type'] = req_content_type
|
1198
2879
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
2880
|
+
|
2881
|
+
if form
|
2882
|
+
body = Utils.encode_form(form)
|
2883
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
2884
|
+
body = URI.encode_www_form(data)
|
2885
|
+
else
|
2886
|
+
body = data
|
2887
|
+
end
|
1199
2888
|
headers['Accept'] = 'application/json'
|
1200
2889
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2890
|
+
retries ||= @sdk_configuration.retry_config
|
2891
|
+
retries ||= Utils::RetryConfig.new(
|
2892
|
+
backoff: Utils::BackoffStrategy.new(
|
2893
|
+
exponent: 1.5,
|
2894
|
+
initial_interval: 500,
|
2895
|
+
max_elapsed_time: 3_600_000,
|
2896
|
+
max_interval: 60_000
|
2897
|
+
),
|
2898
|
+
retry_connection_errors: true,
|
2899
|
+
strategy: 'backoff'
|
2900
|
+
)
|
2901
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
2902
|
+
retry_options[:retry_statuses] = [429, 408]
|
2903
|
+
|
2904
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
2905
|
+
|
2906
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
2907
|
+
timeout ||= @sdk_configuration.timeout
|
1201
2908
|
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
2909
|
+
connection = @sdk_configuration.client.dup
|
2910
|
+
connection.request :retry, retry_options
|
2911
|
+
|
2912
|
+
hook_ctx = SDKHooks::HookContext.new(
|
2913
|
+
base_url: base_url,
|
2914
|
+
oauth2_scopes: [],
|
2915
|
+
operation_id: 'lms_upsert_course',
|
2916
|
+
security_source: @sdk_configuration.security_source
|
2917
|
+
)
|
2918
|
+
|
2919
|
+
error = T.let(nil, T.nilable(StandardError))
|
2920
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
2921
|
+
|
2922
|
+
begin
|
2923
|
+
r = connection.put(url) do |req|
|
2924
|
+
req.body = body
|
2925
|
+
req.headers.merge!(headers)
|
2926
|
+
req.options.timeout = timeout unless timeout.nil?
|
2927
|
+
Utils.configure_request_security(req, security)
|
2928
|
+
|
2929
|
+
@sdk_configuration.hooks.before_request(
|
2930
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
2931
|
+
hook_ctx: hook_ctx
|
2932
|
+
),
|
2933
|
+
request: req
|
2934
|
+
)
|
2935
|
+
end
|
2936
|
+
rescue StandardError => e
|
2937
|
+
error = e
|
2938
|
+
ensure
|
2939
|
+
if r.nil? || Utils.error_status?(r.status)
|
2940
|
+
r = @sdk_configuration.hooks.after_error(
|
2941
|
+
error: error,
|
2942
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
2943
|
+
hook_ctx: hook_ctx
|
2944
|
+
),
|
2945
|
+
response: r
|
2946
|
+
)
|
1210
2947
|
else
|
1211
|
-
|
2948
|
+
r = @sdk_configuration.hooks.after_success(
|
2949
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
2950
|
+
hook_ctx: hook_ctx
|
2951
|
+
),
|
2952
|
+
response: r
|
2953
|
+
)
|
2954
|
+
end
|
2955
|
+
|
2956
|
+
if r.nil?
|
2957
|
+
raise error if !error.nil?
|
2958
|
+
raise 'no response'
|
1212
2959
|
end
|
1213
2960
|
end
|
1214
2961
|
|