stackone_client 0.23.0 → 0.25.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 +1 -1
- data/lib/stack_one/ats.rb +276 -0
- data/lib/stack_one/connect_sessions.rb +1 -1
- data/lib/stack_one/connectors.rb +1 -1
- data/lib/stack_one/hris.rb +812 -265
- data/lib/stack_one/lms.rb +291 -1441
- data/lib/stack_one/models/operations/ats_list_application_changes_queryparam_filter.rb +37 -0
- data/lib/stack_one/models/operations/ats_list_application_changes_request.rb +61 -0
- data/lib/stack_one/models/operations/{lms_batch_upsert_course_response.rb → ats_list_application_changes_response.rb} +7 -7
- data/lib/stack_one/models/operations/change_type.rb +22 -0
- data/lib/stack_one/models/operations/hris_get_position_request.rb +49 -0
- data/lib/stack_one/models/operations/{lms_update_collection_response.rb → hris_get_position_response.rb} +7 -7
- data/lib/stack_one/models/operations/hris_list_positions_queryparam_filter.rb +33 -0
- data/lib/stack_one/models/operations/hris_list_positions_request.rb +73 -0
- data/lib/stack_one/models/operations/{lms_upsert_course_response.rb → hris_list_positions_response.rb} +7 -7
- data/lib/stack_one/models/operations/lms_list_assignments_queryparam_filter.rb +2 -2
- data/lib/stack_one/models/operations/lms_list_assignments_queryparam_status.rb +21 -0
- data/lib/stack_one/models/operations/queryparam_status.rb +5 -4
- data/lib/stack_one/models/operations.rb +10 -8
- data/lib/stack_one/models/shared/active.rb +1 -1
- data/lib/stack_one/models/shared/actor.rb +37 -0
- data/lib/stack_one/models/shared/applicationchanges.rb +57 -0
- data/lib/stack_one/models/shared/{customfielddefinition_schemas_4.rb → applicationchanges_4.rb} +1 -1
- data/lib/stack_one/models/shared/applicationchanges_source_value.rb +28 -0
- data/lib/stack_one/models/shared/applicationchanges_value.rb +22 -0
- data/lib/stack_one/models/shared/applicationchangesdatamodel.rb +41 -0
- data/lib/stack_one/models/shared/applicationchangesdatamodel_4.rb +28 -0
- data/lib/stack_one/models/shared/applicationchangesdatamodel_application_status.rb +37 -0
- data/lib/stack_one/models/shared/applicationchangesdatamodel_source_value.rb +28 -0
- data/lib/stack_one/models/shared/applicationchangesdatamodel_value.rb +38 -0
- data/lib/stack_one/models/shared/applicationchangespaginated.rb +41 -0
- data/lib/stack_one/models/shared/categories.rb +1 -0
- data/lib/stack_one/models/shared/category.rb +2 -2
- data/lib/stack_one/models/shared/category_2.rb +20 -0
- data/lib/stack_one/models/shared/change_type.rb +37 -0
- data/lib/stack_one/models/shared/connectorsmeta_category.rb +1 -0
- data/lib/stack_one/models/shared/connectsessioncreate_categories.rb +1 -0
- data/lib/stack_one/models/shared/connectsessiontokenauthlink_categories.rb +1 -0
- data/lib/stack_one/models/shared/course.rb +2 -2
- data/lib/stack_one/models/shared/course_2.rb +20 -0
- data/lib/stack_one/models/shared/course_active.rb +28 -0
- data/lib/stack_one/models/shared/customfielddefinition.rb +2 -2
- data/lib/stack_one/models/shared/customfielddefinition_type.rb +2 -2
- data/lib/stack_one/models/shared/customfieldoption.rb +37 -0
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto.rb +6 -2
- data/lib/stack_one/models/shared/linkedaccountmeta_category.rb +1 -0
- data/lib/stack_one/models/shared/lmscreatecontentrequestdto.rb +2 -2
- data/lib/stack_one/models/shared/lmscreatecontentrequestdto_2.rb +20 -0
- data/lib/stack_one/models/shared/lmscreatecontentrequestdto_active.rb +28 -0
- data/lib/stack_one/models/shared/lmsupsertcontentrequestdto.rb +2 -2
- data/lib/stack_one/models/shared/lmsupsertcontentrequestdto_2.rb +20 -0
- data/lib/stack_one/models/shared/lmsupsertcontentrequestdto_active.rb +28 -0
- data/lib/stack_one/models/shared/lmsuser.rb +2 -2
- data/lib/stack_one/models/shared/lmsuser_2.rb +20 -0
- data/lib/stack_one/models/shared/lmsuser_active.rb +28 -0
- data/lib/stack_one/models/shared/position.rb +69 -0
- data/lib/stack_one/models/shared/{options.rb → position_4.rb} +1 -1
- data/lib/stack_one/models/shared/position_source_value.rb +28 -0
- data/lib/stack_one/models/shared/position_status.rb +37 -0
- data/lib/stack_one/models/shared/position_value.rb +22 -0
- data/lib/stack_one/models/shared/positionresult.rb +37 -0
- data/lib/stack_one/models/shared/positionspaginated.rb +45 -0
- data/lib/stack_one/models/shared/reference_active.rb +28 -0
- data/lib/stack_one/models/shared/skills.rb +2 -2
- data/lib/stack_one/models/shared/skills_2.rb +20 -0
- data/lib/stack_one/models/shared/skills_active.rb +28 -0
- data/lib/stack_one/models/shared/timeoff.rb +6 -2
- data/lib/stack_one/models/shared.rb +32 -6
- data/lib/stack_one/proxy.rb +1 -1
- data/lib/stack_one/request_logs.rb +1 -1
- data/lib/stack_one/sdkconfiguration.rb +2 -2
- metadata +44 -16
- data/lib/stack_one/models/operations/lms_batch_upsert_course_request.rb +0 -37
- data/lib/stack_one/models/operations/lms_create_collection_request.rb +0 -37
- data/lib/stack_one/models/operations/lms_create_collection_response.rb +0 -49
- data/lib/stack_one/models/operations/lms_update_collection_request.rb +0 -41
- data/lib/stack_one/models/operations/lms_upsert_course_request.rb +0 -37
- data/lib/stack_one/models/shared/createcontentapimodel.rb +0 -53
- data/lib/stack_one/models/shared/lmsbatchupsertcourserequestdto.rb +0 -33
- data/lib/stack_one/models/shared/lmscreatecollectionrequestdto.rb +0 -69
- data/lib/stack_one/models/shared/lmsupsertcourserequestdto.rb +0 -81
data/lib/stack_one/lms.rb
CHANGED
@@ -308,19 +308,25 @@ module StackOne
|
|
308
308
|
end
|
309
309
|
|
310
310
|
|
311
|
-
sig { params(
|
312
|
-
def
|
313
|
-
#
|
314
|
-
request = Models::Operations::
|
311
|
+
sig { params(lms_create_assignment_request_dto: Models::Shared::LmsCreateAssignmentRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsCreateUserAssignmentResponse) }
|
312
|
+
def create_user_assignment(lms_create_assignment_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
313
|
+
# create_user_assignment - Create User Assignment
|
314
|
+
request = Models::Operations::LmsCreateUserAssignmentRequest.new(
|
315
315
|
|
316
|
-
|
316
|
+
lms_create_assignment_request_dto: lms_create_assignment_request_dto,
|
317
|
+
id: id,
|
317
318
|
x_account_id: x_account_id
|
318
319
|
)
|
319
320
|
url, params = @sdk_configuration.get_server_details
|
320
321
|
base_url = Utils.template_url(url, params)
|
321
|
-
url =
|
322
|
+
url = Utils.generate_url(
|
323
|
+
Models::Operations::LmsCreateUserAssignmentRequest,
|
324
|
+
base_url,
|
325
|
+
'/unified/lms/users/{id}/assignments',
|
326
|
+
request
|
327
|
+
)
|
322
328
|
headers = Utils.get_headers(request)
|
323
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :
|
329
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_assignment_request_dto, :json)
|
324
330
|
headers['content-type'] = req_content_type
|
325
331
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
326
332
|
|
@@ -358,7 +364,7 @@ module StackOne
|
|
358
364
|
hook_ctx = SDKHooks::HookContext.new(
|
359
365
|
base_url: base_url,
|
360
366
|
oauth2_scopes: [],
|
361
|
-
operation_id: '
|
367
|
+
operation_id: 'lms_create_user_assignment',
|
362
368
|
security_source: @sdk_configuration.security_source
|
363
369
|
)
|
364
370
|
|
@@ -407,7 +413,7 @@ module StackOne
|
|
407
413
|
end
|
408
414
|
|
409
415
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
410
|
-
if Utils.match_status_code(http_response.status, ['
|
416
|
+
if Utils.match_status_code(http_response.status, ['201'])
|
411
417
|
if Utils.match_content_type(content_type, 'application/json')
|
412
418
|
http_response = @sdk_configuration.hooks.after_success(
|
413
419
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
@@ -415,12 +421,12 @@ module StackOne
|
|
415
421
|
),
|
416
422
|
response: http_response
|
417
423
|
)
|
418
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
419
|
-
response = Models::Operations::
|
424
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CreateResult)
|
425
|
+
response = Models::Operations::LmsCreateUserAssignmentResponse.new(
|
420
426
|
status_code: http_response.status,
|
421
427
|
content_type: content_type,
|
422
428
|
raw_response: http_response,
|
423
|
-
|
429
|
+
create_result: obj
|
424
430
|
)
|
425
431
|
|
426
432
|
return response
|
@@ -594,1181 +600,35 @@ module StackOne
|
|
594
600
|
end
|
595
601
|
|
596
602
|
|
597
|
-
sig { params(
|
598
|
-
def
|
599
|
-
#
|
600
|
-
request = Models::Operations::
|
603
|
+
sig { params(lms_create_completion_request_dto: Models::Shared::LmsCreateCompletionRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsCreateUserCompletionResponse) }
|
604
|
+
def create_user_completion(lms_create_completion_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
605
|
+
# create_user_completion - Create User Completion
|
606
|
+
request = Models::Operations::LmsCreateUserCompletionRequest.new(
|
601
607
|
|
602
|
-
|
608
|
+
lms_create_completion_request_dto: lms_create_completion_request_dto,
|
609
|
+
id: id,
|
603
610
|
x_account_id: x_account_id
|
604
611
|
)
|
605
612
|
url, params = @sdk_configuration.get_server_details
|
606
613
|
base_url = Utils.template_url(url, params)
|
607
|
-
url = "#{base_url}/unified/lms/collections"
|
608
|
-
headers = Utils.get_headers(request)
|
609
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_collection_request_dto, :json)
|
610
|
-
headers['content-type'] = req_content_type
|
611
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
612
|
-
|
613
|
-
if form
|
614
|
-
body = Utils.encode_form(form)
|
615
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
616
|
-
body = URI.encode_www_form(data)
|
617
|
-
else
|
618
|
-
body = data
|
619
|
-
end
|
620
|
-
headers['Accept'] = 'application/json'
|
621
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
622
|
-
retries ||= @sdk_configuration.retry_config
|
623
|
-
retries ||= Utils::RetryConfig.new(
|
624
|
-
backoff: Utils::BackoffStrategy.new(
|
625
|
-
exponent: 1.5,
|
626
|
-
initial_interval: 500,
|
627
|
-
max_elapsed_time: 3_600_000,
|
628
|
-
max_interval: 60_000
|
629
|
-
),
|
630
|
-
retry_connection_errors: true,
|
631
|
-
strategy: 'backoff'
|
632
|
-
)
|
633
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
634
|
-
retry_options[:retry_statuses] = [429, 408]
|
635
|
-
|
636
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
637
|
-
|
638
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
639
|
-
timeout ||= @sdk_configuration.timeout
|
640
|
-
|
641
|
-
connection = @sdk_configuration.client.dup
|
642
|
-
connection.request :retry, retry_options
|
643
|
-
|
644
|
-
hook_ctx = SDKHooks::HookContext.new(
|
645
|
-
base_url: base_url,
|
646
|
-
oauth2_scopes: [],
|
647
|
-
operation_id: 'lms_create_collection',
|
648
|
-
security_source: @sdk_configuration.security_source
|
649
|
-
)
|
650
|
-
|
651
|
-
error = T.let(nil, T.nilable(StandardError))
|
652
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
653
|
-
|
654
|
-
|
655
|
-
begin
|
656
|
-
http_response = connection.post(url) do |req|
|
657
|
-
req.body = body
|
658
|
-
req.headers.merge!(headers)
|
659
|
-
req.options.timeout = timeout unless timeout.nil?
|
660
|
-
Utils.configure_request_security(req, security)
|
661
|
-
|
662
|
-
@sdk_configuration.hooks.before_request(
|
663
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
664
|
-
hook_ctx: hook_ctx
|
665
|
-
),
|
666
|
-
request: req
|
667
|
-
)
|
668
|
-
end
|
669
|
-
rescue StandardError => e
|
670
|
-
error = e
|
671
|
-
ensure
|
672
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
673
|
-
http_response = @sdk_configuration.hooks.after_error(
|
674
|
-
error: error,
|
675
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
676
|
-
hook_ctx: hook_ctx
|
677
|
-
),
|
678
|
-
response: http_response
|
679
|
-
)
|
680
|
-
else
|
681
|
-
http_response = @sdk_configuration.hooks.after_success(
|
682
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
683
|
-
hook_ctx: hook_ctx
|
684
|
-
),
|
685
|
-
response: http_response
|
686
|
-
)
|
687
|
-
end
|
688
|
-
|
689
|
-
if http_response.nil?
|
690
|
-
raise error if !error.nil?
|
691
|
-
raise 'no response'
|
692
|
-
end
|
693
|
-
end
|
694
|
-
|
695
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
696
|
-
if Utils.match_status_code(http_response.status, ['201'])
|
697
|
-
if Utils.match_content_type(content_type, 'application/json')
|
698
|
-
http_response = @sdk_configuration.hooks.after_success(
|
699
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
700
|
-
hook_ctx: hook_ctx
|
701
|
-
),
|
702
|
-
response: http_response
|
703
|
-
)
|
704
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CreateResult)
|
705
|
-
response = Models::Operations::LmsCreateCollectionResponse.new(
|
706
|
-
status_code: http_response.status,
|
707
|
-
content_type: content_type,
|
708
|
-
raw_response: http_response,
|
709
|
-
create_result: obj
|
710
|
-
)
|
711
|
-
|
712
|
-
return response
|
713
|
-
else
|
714
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
715
|
-
end
|
716
|
-
elsif Utils.match_status_code(http_response.status, ['400'])
|
717
|
-
if Utils.match_content_type(content_type, 'application/json')
|
718
|
-
http_response = @sdk_configuration.hooks.after_success(
|
719
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
720
|
-
hook_ctx: hook_ctx
|
721
|
-
),
|
722
|
-
response: http_response
|
723
|
-
)
|
724
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadRequestResponse)
|
725
|
-
throw obj
|
726
|
-
else
|
727
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
728
|
-
end
|
729
|
-
elsif Utils.match_status_code(http_response.status, ['401'])
|
730
|
-
if Utils.match_content_type(content_type, 'application/json')
|
731
|
-
http_response = @sdk_configuration.hooks.after_success(
|
732
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
733
|
-
hook_ctx: hook_ctx
|
734
|
-
),
|
735
|
-
response: http_response
|
736
|
-
)
|
737
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnauthorizedResponse)
|
738
|
-
throw obj
|
739
|
-
else
|
740
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
741
|
-
end
|
742
|
-
elsif Utils.match_status_code(http_response.status, ['403'])
|
743
|
-
if Utils.match_content_type(content_type, 'application/json')
|
744
|
-
http_response = @sdk_configuration.hooks.after_success(
|
745
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
746
|
-
hook_ctx: hook_ctx
|
747
|
-
),
|
748
|
-
response: http_response
|
749
|
-
)
|
750
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ForbiddenResponse)
|
751
|
-
throw obj
|
752
|
-
else
|
753
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
754
|
-
end
|
755
|
-
elsif Utils.match_status_code(http_response.status, ['404'])
|
756
|
-
if Utils.match_content_type(content_type, 'application/json')
|
757
|
-
http_response = @sdk_configuration.hooks.after_success(
|
758
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
759
|
-
hook_ctx: hook_ctx
|
760
|
-
),
|
761
|
-
response: http_response
|
762
|
-
)
|
763
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotFoundResponse)
|
764
|
-
throw obj
|
765
|
-
else
|
766
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
767
|
-
end
|
768
|
-
elsif Utils.match_status_code(http_response.status, ['408'])
|
769
|
-
if Utils.match_content_type(content_type, 'application/json')
|
770
|
-
http_response = @sdk_configuration.hooks.after_success(
|
771
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
772
|
-
hook_ctx: hook_ctx
|
773
|
-
),
|
774
|
-
response: http_response
|
775
|
-
)
|
776
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::RequestTimedOutResponse)
|
777
|
-
throw obj
|
778
|
-
else
|
779
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
780
|
-
end
|
781
|
-
elsif Utils.match_status_code(http_response.status, ['409'])
|
782
|
-
if Utils.match_content_type(content_type, 'application/json')
|
783
|
-
http_response = @sdk_configuration.hooks.after_success(
|
784
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
785
|
-
hook_ctx: hook_ctx
|
786
|
-
),
|
787
|
-
response: http_response
|
788
|
-
)
|
789
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ConflictResponse)
|
790
|
-
throw obj
|
791
|
-
else
|
792
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
793
|
-
end
|
794
|
-
elsif Utils.match_status_code(http_response.status, ['412'])
|
795
|
-
if Utils.match_content_type(content_type, 'application/json')
|
796
|
-
http_response = @sdk_configuration.hooks.after_success(
|
797
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
798
|
-
hook_ctx: hook_ctx
|
799
|
-
),
|
800
|
-
response: http_response
|
801
|
-
)
|
802
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::PreconditionFailedResponse)
|
803
|
-
throw obj
|
804
|
-
else
|
805
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
806
|
-
end
|
807
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
808
|
-
if Utils.match_content_type(content_type, 'application/json')
|
809
|
-
http_response = @sdk_configuration.hooks.after_success(
|
810
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
811
|
-
hook_ctx: hook_ctx
|
812
|
-
),
|
813
|
-
response: http_response
|
814
|
-
)
|
815
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnprocessableEntityResponse)
|
816
|
-
throw obj
|
817
|
-
else
|
818
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
819
|
-
end
|
820
|
-
elsif Utils.match_status_code(http_response.status, ['429'])
|
821
|
-
if Utils.match_content_type(content_type, 'application/json')
|
822
|
-
http_response = @sdk_configuration.hooks.after_success(
|
823
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
824
|
-
hook_ctx: hook_ctx
|
825
|
-
),
|
826
|
-
response: http_response
|
827
|
-
)
|
828
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::TooManyRequestsResponse)
|
829
|
-
throw obj
|
830
|
-
else
|
831
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
832
|
-
end
|
833
|
-
elsif Utils.match_status_code(http_response.status, ['500'])
|
834
|
-
if Utils.match_content_type(content_type, 'application/json')
|
835
|
-
http_response = @sdk_configuration.hooks.after_success(
|
836
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
837
|
-
hook_ctx: hook_ctx
|
838
|
-
),
|
839
|
-
response: http_response
|
840
|
-
)
|
841
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::InternalServerErrorResponse)
|
842
|
-
throw obj
|
843
|
-
else
|
844
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
845
|
-
end
|
846
|
-
elsif Utils.match_status_code(http_response.status, ['501'])
|
847
|
-
if Utils.match_content_type(content_type, 'application/json')
|
848
|
-
http_response = @sdk_configuration.hooks.after_success(
|
849
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
850
|
-
hook_ctx: hook_ctx
|
851
|
-
),
|
852
|
-
response: http_response
|
853
|
-
)
|
854
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotImplementedResponse)
|
855
|
-
throw obj
|
856
|
-
else
|
857
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
858
|
-
end
|
859
|
-
elsif Utils.match_status_code(http_response.status, ['502'])
|
860
|
-
if Utils.match_content_type(content_type, 'application/json')
|
861
|
-
http_response = @sdk_configuration.hooks.after_success(
|
862
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
863
|
-
hook_ctx: hook_ctx
|
864
|
-
),
|
865
|
-
response: http_response
|
866
|
-
)
|
867
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadGatewayResponse)
|
868
|
-
throw obj
|
869
|
-
else
|
870
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
871
|
-
end
|
872
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
873
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
874
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
875
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
876
|
-
else
|
877
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
878
|
-
|
879
|
-
end
|
880
|
-
end
|
881
|
-
|
882
|
-
|
883
|
-
sig { params(lms_create_assignment_request_dto: Models::Shared::LmsCreateAssignmentRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsCreateUserAssignmentResponse) }
|
884
|
-
def create_user_assignment(lms_create_assignment_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
885
|
-
# create_user_assignment - Create User Assignment
|
886
|
-
request = Models::Operations::LmsCreateUserAssignmentRequest.new(
|
887
|
-
|
888
|
-
lms_create_assignment_request_dto: lms_create_assignment_request_dto,
|
889
|
-
id: id,
|
890
|
-
x_account_id: x_account_id
|
891
|
-
)
|
892
|
-
url, params = @sdk_configuration.get_server_details
|
893
|
-
base_url = Utils.template_url(url, params)
|
894
|
-
url = Utils.generate_url(
|
895
|
-
Models::Operations::LmsCreateUserAssignmentRequest,
|
896
|
-
base_url,
|
897
|
-
'/unified/lms/users/{id}/assignments',
|
898
|
-
request
|
899
|
-
)
|
900
|
-
headers = Utils.get_headers(request)
|
901
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_assignment_request_dto, :json)
|
902
|
-
headers['content-type'] = req_content_type
|
903
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
904
|
-
|
905
|
-
if form
|
906
|
-
body = Utils.encode_form(form)
|
907
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
908
|
-
body = URI.encode_www_form(data)
|
909
|
-
else
|
910
|
-
body = data
|
911
|
-
end
|
912
|
-
headers['Accept'] = 'application/json'
|
913
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
914
|
-
retries ||= @sdk_configuration.retry_config
|
915
|
-
retries ||= Utils::RetryConfig.new(
|
916
|
-
backoff: Utils::BackoffStrategy.new(
|
917
|
-
exponent: 1.5,
|
918
|
-
initial_interval: 500,
|
919
|
-
max_elapsed_time: 3_600_000,
|
920
|
-
max_interval: 60_000
|
921
|
-
),
|
922
|
-
retry_connection_errors: true,
|
923
|
-
strategy: 'backoff'
|
924
|
-
)
|
925
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
926
|
-
retry_options[:retry_statuses] = [429, 408]
|
927
|
-
|
928
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
929
|
-
|
930
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
931
|
-
timeout ||= @sdk_configuration.timeout
|
932
|
-
|
933
|
-
connection = @sdk_configuration.client.dup
|
934
|
-
connection.request :retry, retry_options
|
935
|
-
|
936
|
-
hook_ctx = SDKHooks::HookContext.new(
|
937
|
-
base_url: base_url,
|
938
|
-
oauth2_scopes: [],
|
939
|
-
operation_id: 'lms_create_user_assignment',
|
940
|
-
security_source: @sdk_configuration.security_source
|
941
|
-
)
|
942
|
-
|
943
|
-
error = T.let(nil, T.nilable(StandardError))
|
944
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
945
|
-
|
946
|
-
|
947
|
-
begin
|
948
|
-
http_response = connection.post(url) do |req|
|
949
|
-
req.body = body
|
950
|
-
req.headers.merge!(headers)
|
951
|
-
req.options.timeout = timeout unless timeout.nil?
|
952
|
-
Utils.configure_request_security(req, security)
|
953
|
-
|
954
|
-
@sdk_configuration.hooks.before_request(
|
955
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
956
|
-
hook_ctx: hook_ctx
|
957
|
-
),
|
958
|
-
request: req
|
959
|
-
)
|
960
|
-
end
|
961
|
-
rescue StandardError => e
|
962
|
-
error = e
|
963
|
-
ensure
|
964
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
965
|
-
http_response = @sdk_configuration.hooks.after_error(
|
966
|
-
error: error,
|
967
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
968
|
-
hook_ctx: hook_ctx
|
969
|
-
),
|
970
|
-
response: http_response
|
971
|
-
)
|
972
|
-
else
|
973
|
-
http_response = @sdk_configuration.hooks.after_success(
|
974
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
975
|
-
hook_ctx: hook_ctx
|
976
|
-
),
|
977
|
-
response: http_response
|
978
|
-
)
|
979
|
-
end
|
980
|
-
|
981
|
-
if http_response.nil?
|
982
|
-
raise error if !error.nil?
|
983
|
-
raise 'no response'
|
984
|
-
end
|
985
|
-
end
|
986
|
-
|
987
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
988
|
-
if Utils.match_status_code(http_response.status, ['201'])
|
989
|
-
if Utils.match_content_type(content_type, 'application/json')
|
990
|
-
http_response = @sdk_configuration.hooks.after_success(
|
991
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
992
|
-
hook_ctx: hook_ctx
|
993
|
-
),
|
994
|
-
response: http_response
|
995
|
-
)
|
996
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CreateResult)
|
997
|
-
response = Models::Operations::LmsCreateUserAssignmentResponse.new(
|
998
|
-
status_code: http_response.status,
|
999
|
-
content_type: content_type,
|
1000
|
-
raw_response: http_response,
|
1001
|
-
create_result: obj
|
1002
|
-
)
|
1003
|
-
|
1004
|
-
return response
|
1005
|
-
else
|
1006
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1007
|
-
end
|
1008
|
-
elsif Utils.match_status_code(http_response.status, ['400'])
|
1009
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1010
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1011
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1012
|
-
hook_ctx: hook_ctx
|
1013
|
-
),
|
1014
|
-
response: http_response
|
1015
|
-
)
|
1016
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadRequestResponse)
|
1017
|
-
throw obj
|
1018
|
-
else
|
1019
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1020
|
-
end
|
1021
|
-
elsif Utils.match_status_code(http_response.status, ['401'])
|
1022
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1023
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1024
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1025
|
-
hook_ctx: hook_ctx
|
1026
|
-
),
|
1027
|
-
response: http_response
|
1028
|
-
)
|
1029
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnauthorizedResponse)
|
1030
|
-
throw obj
|
1031
|
-
else
|
1032
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1033
|
-
end
|
1034
|
-
elsif Utils.match_status_code(http_response.status, ['403'])
|
1035
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1036
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1037
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1038
|
-
hook_ctx: hook_ctx
|
1039
|
-
),
|
1040
|
-
response: http_response
|
1041
|
-
)
|
1042
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ForbiddenResponse)
|
1043
|
-
throw obj
|
1044
|
-
else
|
1045
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1046
|
-
end
|
1047
|
-
elsif Utils.match_status_code(http_response.status, ['404'])
|
1048
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1049
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1050
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1051
|
-
hook_ctx: hook_ctx
|
1052
|
-
),
|
1053
|
-
response: http_response
|
1054
|
-
)
|
1055
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotFoundResponse)
|
1056
|
-
throw obj
|
1057
|
-
else
|
1058
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1059
|
-
end
|
1060
|
-
elsif Utils.match_status_code(http_response.status, ['408'])
|
1061
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1062
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1063
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1064
|
-
hook_ctx: hook_ctx
|
1065
|
-
),
|
1066
|
-
response: http_response
|
1067
|
-
)
|
1068
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::RequestTimedOutResponse)
|
1069
|
-
throw obj
|
1070
|
-
else
|
1071
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1072
|
-
end
|
1073
|
-
elsif Utils.match_status_code(http_response.status, ['409'])
|
1074
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1075
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1076
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1077
|
-
hook_ctx: hook_ctx
|
1078
|
-
),
|
1079
|
-
response: http_response
|
1080
|
-
)
|
1081
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ConflictResponse)
|
1082
|
-
throw obj
|
1083
|
-
else
|
1084
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1085
|
-
end
|
1086
|
-
elsif Utils.match_status_code(http_response.status, ['412'])
|
1087
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1088
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1089
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1090
|
-
hook_ctx: hook_ctx
|
1091
|
-
),
|
1092
|
-
response: http_response
|
1093
|
-
)
|
1094
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::PreconditionFailedResponse)
|
1095
|
-
throw obj
|
1096
|
-
else
|
1097
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1098
|
-
end
|
1099
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
1100
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1101
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1102
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1103
|
-
hook_ctx: hook_ctx
|
1104
|
-
),
|
1105
|
-
response: http_response
|
1106
|
-
)
|
1107
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnprocessableEntityResponse)
|
1108
|
-
throw obj
|
1109
|
-
else
|
1110
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1111
|
-
end
|
1112
|
-
elsif Utils.match_status_code(http_response.status, ['429'])
|
1113
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1114
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1115
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1116
|
-
hook_ctx: hook_ctx
|
1117
|
-
),
|
1118
|
-
response: http_response
|
1119
|
-
)
|
1120
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::TooManyRequestsResponse)
|
1121
|
-
throw obj
|
1122
|
-
else
|
1123
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1124
|
-
end
|
1125
|
-
elsif Utils.match_status_code(http_response.status, ['500'])
|
1126
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1127
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1128
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1129
|
-
hook_ctx: hook_ctx
|
1130
|
-
),
|
1131
|
-
response: http_response
|
1132
|
-
)
|
1133
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::InternalServerErrorResponse)
|
1134
|
-
throw obj
|
1135
|
-
else
|
1136
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1137
|
-
end
|
1138
|
-
elsif Utils.match_status_code(http_response.status, ['501'])
|
1139
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1140
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1141
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1142
|
-
hook_ctx: hook_ctx
|
1143
|
-
),
|
1144
|
-
response: http_response
|
1145
|
-
)
|
1146
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotImplementedResponse)
|
1147
|
-
throw obj
|
1148
|
-
else
|
1149
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1150
|
-
end
|
1151
|
-
elsif Utils.match_status_code(http_response.status, ['502'])
|
1152
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1153
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1154
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1155
|
-
hook_ctx: hook_ctx
|
1156
|
-
),
|
1157
|
-
response: http_response
|
1158
|
-
)
|
1159
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadGatewayResponse)
|
1160
|
-
throw obj
|
1161
|
-
else
|
1162
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1163
|
-
end
|
1164
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
1165
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
1166
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
1167
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
1168
|
-
else
|
1169
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
1170
|
-
|
1171
|
-
end
|
1172
|
-
end
|
1173
|
-
|
1174
|
-
|
1175
|
-
sig { params(lms_create_completion_request_dto: Models::Shared::LmsCreateCompletionRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsCreateUserCompletionResponse) }
|
1176
|
-
def create_user_completion(lms_create_completion_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
1177
|
-
# create_user_completion - Create User Completion
|
1178
|
-
request = Models::Operations::LmsCreateUserCompletionRequest.new(
|
1179
|
-
|
1180
|
-
lms_create_completion_request_dto: lms_create_completion_request_dto,
|
1181
|
-
id: id,
|
1182
|
-
x_account_id: x_account_id
|
1183
|
-
)
|
1184
|
-
url, params = @sdk_configuration.get_server_details
|
1185
|
-
base_url = Utils.template_url(url, params)
|
1186
|
-
url = Utils.generate_url(
|
1187
|
-
Models::Operations::LmsCreateUserCompletionRequest,
|
1188
|
-
base_url,
|
1189
|
-
'/unified/lms/users/{id}/completions',
|
1190
|
-
request
|
1191
|
-
)
|
1192
|
-
headers = Utils.get_headers(request)
|
1193
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_completion_request_dto, :json)
|
1194
|
-
headers['content-type'] = req_content_type
|
1195
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
1196
|
-
|
1197
|
-
if form
|
1198
|
-
body = Utils.encode_form(form)
|
1199
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
1200
|
-
body = URI.encode_www_form(data)
|
1201
|
-
else
|
1202
|
-
body = data
|
1203
|
-
end
|
1204
|
-
headers['Accept'] = 'application/json'
|
1205
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
1206
|
-
retries ||= @sdk_configuration.retry_config
|
1207
|
-
retries ||= Utils::RetryConfig.new(
|
1208
|
-
backoff: Utils::BackoffStrategy.new(
|
1209
|
-
exponent: 1.5,
|
1210
|
-
initial_interval: 500,
|
1211
|
-
max_elapsed_time: 3_600_000,
|
1212
|
-
max_interval: 60_000
|
1213
|
-
),
|
1214
|
-
retry_connection_errors: true,
|
1215
|
-
strategy: 'backoff'
|
1216
|
-
)
|
1217
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1218
|
-
retry_options[:retry_statuses] = [429, 408]
|
1219
|
-
|
1220
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1221
|
-
|
1222
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1223
|
-
timeout ||= @sdk_configuration.timeout
|
1224
|
-
|
1225
|
-
connection = @sdk_configuration.client.dup
|
1226
|
-
connection.request :retry, retry_options
|
1227
|
-
|
1228
|
-
hook_ctx = SDKHooks::HookContext.new(
|
1229
|
-
base_url: base_url,
|
1230
|
-
oauth2_scopes: [],
|
1231
|
-
operation_id: 'lms_create_user_completion',
|
1232
|
-
security_source: @sdk_configuration.security_source
|
1233
|
-
)
|
1234
|
-
|
1235
|
-
error = T.let(nil, T.nilable(StandardError))
|
1236
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
1237
|
-
|
1238
|
-
|
1239
|
-
begin
|
1240
|
-
http_response = connection.post(url) do |req|
|
1241
|
-
req.body = body
|
1242
|
-
req.headers.merge!(headers)
|
1243
|
-
req.options.timeout = timeout unless timeout.nil?
|
1244
|
-
Utils.configure_request_security(req, security)
|
1245
|
-
|
1246
|
-
@sdk_configuration.hooks.before_request(
|
1247
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1248
|
-
hook_ctx: hook_ctx
|
1249
|
-
),
|
1250
|
-
request: req
|
1251
|
-
)
|
1252
|
-
end
|
1253
|
-
rescue StandardError => e
|
1254
|
-
error = e
|
1255
|
-
ensure
|
1256
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
1257
|
-
http_response = @sdk_configuration.hooks.after_error(
|
1258
|
-
error: error,
|
1259
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1260
|
-
hook_ctx: hook_ctx
|
1261
|
-
),
|
1262
|
-
response: http_response
|
1263
|
-
)
|
1264
|
-
else
|
1265
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1266
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1267
|
-
hook_ctx: hook_ctx
|
1268
|
-
),
|
1269
|
-
response: http_response
|
1270
|
-
)
|
1271
|
-
end
|
1272
|
-
|
1273
|
-
if http_response.nil?
|
1274
|
-
raise error if !error.nil?
|
1275
|
-
raise 'no response'
|
1276
|
-
end
|
1277
|
-
end
|
1278
|
-
|
1279
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
1280
|
-
if Utils.match_status_code(http_response.status, ['201'])
|
1281
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1282
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1283
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1284
|
-
hook_ctx: hook_ctx
|
1285
|
-
),
|
1286
|
-
response: http_response
|
1287
|
-
)
|
1288
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CreateResult)
|
1289
|
-
response = Models::Operations::LmsCreateUserCompletionResponse.new(
|
1290
|
-
status_code: http_response.status,
|
1291
|
-
content_type: content_type,
|
1292
|
-
raw_response: http_response,
|
1293
|
-
create_result: obj
|
1294
|
-
)
|
1295
|
-
|
1296
|
-
return response
|
1297
|
-
else
|
1298
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1299
|
-
end
|
1300
|
-
elsif Utils.match_status_code(http_response.status, ['400'])
|
1301
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1302
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1303
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1304
|
-
hook_ctx: hook_ctx
|
1305
|
-
),
|
1306
|
-
response: http_response
|
1307
|
-
)
|
1308
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadRequestResponse)
|
1309
|
-
throw obj
|
1310
|
-
else
|
1311
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1312
|
-
end
|
1313
|
-
elsif Utils.match_status_code(http_response.status, ['401'])
|
1314
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1315
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1316
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1317
|
-
hook_ctx: hook_ctx
|
1318
|
-
),
|
1319
|
-
response: http_response
|
1320
|
-
)
|
1321
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnauthorizedResponse)
|
1322
|
-
throw obj
|
1323
|
-
else
|
1324
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1325
|
-
end
|
1326
|
-
elsif Utils.match_status_code(http_response.status, ['403'])
|
1327
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1328
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1329
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1330
|
-
hook_ctx: hook_ctx
|
1331
|
-
),
|
1332
|
-
response: http_response
|
1333
|
-
)
|
1334
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ForbiddenResponse)
|
1335
|
-
throw obj
|
1336
|
-
else
|
1337
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1338
|
-
end
|
1339
|
-
elsif Utils.match_status_code(http_response.status, ['404'])
|
1340
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1341
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1342
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1343
|
-
hook_ctx: hook_ctx
|
1344
|
-
),
|
1345
|
-
response: http_response
|
1346
|
-
)
|
1347
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotFoundResponse)
|
1348
|
-
throw obj
|
1349
|
-
else
|
1350
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1351
|
-
end
|
1352
|
-
elsif Utils.match_status_code(http_response.status, ['408'])
|
1353
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1354
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1355
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1356
|
-
hook_ctx: hook_ctx
|
1357
|
-
),
|
1358
|
-
response: http_response
|
1359
|
-
)
|
1360
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::RequestTimedOutResponse)
|
1361
|
-
throw obj
|
1362
|
-
else
|
1363
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1364
|
-
end
|
1365
|
-
elsif Utils.match_status_code(http_response.status, ['409'])
|
1366
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1367
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1368
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1369
|
-
hook_ctx: hook_ctx
|
1370
|
-
),
|
1371
|
-
response: http_response
|
1372
|
-
)
|
1373
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ConflictResponse)
|
1374
|
-
throw obj
|
1375
|
-
else
|
1376
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1377
|
-
end
|
1378
|
-
elsif Utils.match_status_code(http_response.status, ['412'])
|
1379
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1380
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1381
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1382
|
-
hook_ctx: hook_ctx
|
1383
|
-
),
|
1384
|
-
response: http_response
|
1385
|
-
)
|
1386
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::PreconditionFailedResponse)
|
1387
|
-
throw obj
|
1388
|
-
else
|
1389
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1390
|
-
end
|
1391
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
1392
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1393
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1394
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1395
|
-
hook_ctx: hook_ctx
|
1396
|
-
),
|
1397
|
-
response: http_response
|
1398
|
-
)
|
1399
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnprocessableEntityResponse)
|
1400
|
-
throw obj
|
1401
|
-
else
|
1402
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1403
|
-
end
|
1404
|
-
elsif Utils.match_status_code(http_response.status, ['429'])
|
1405
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1406
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1407
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1408
|
-
hook_ctx: hook_ctx
|
1409
|
-
),
|
1410
|
-
response: http_response
|
1411
|
-
)
|
1412
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::TooManyRequestsResponse)
|
1413
|
-
throw obj
|
1414
|
-
else
|
1415
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1416
|
-
end
|
1417
|
-
elsif Utils.match_status_code(http_response.status, ['500'])
|
1418
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1419
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1420
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1421
|
-
hook_ctx: hook_ctx
|
1422
|
-
),
|
1423
|
-
response: http_response
|
1424
|
-
)
|
1425
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::InternalServerErrorResponse)
|
1426
|
-
throw obj
|
1427
|
-
else
|
1428
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1429
|
-
end
|
1430
|
-
elsif Utils.match_status_code(http_response.status, ['501'])
|
1431
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1432
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1433
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1434
|
-
hook_ctx: hook_ctx
|
1435
|
-
),
|
1436
|
-
response: http_response
|
1437
|
-
)
|
1438
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotImplementedResponse)
|
1439
|
-
throw obj
|
1440
|
-
else
|
1441
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1442
|
-
end
|
1443
|
-
elsif Utils.match_status_code(http_response.status, ['502'])
|
1444
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1445
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1446
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1447
|
-
hook_ctx: hook_ctx
|
1448
|
-
),
|
1449
|
-
response: http_response
|
1450
|
-
)
|
1451
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadGatewayResponse)
|
1452
|
-
throw obj
|
1453
|
-
else
|
1454
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1455
|
-
end
|
1456
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
1457
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
1458
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
1459
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
1460
|
-
else
|
1461
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
1462
|
-
|
1463
|
-
end
|
1464
|
-
end
|
1465
|
-
|
1466
|
-
|
1467
|
-
sig { params(id: ::String, sub_resource_id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsDeleteUserCompletionResponse) }
|
1468
|
-
def delete_user_completion(id, sub_resource_id, x_account_id, retries = nil, timeout_ms = nil)
|
1469
|
-
# delete_user_completion - Delete User Completion
|
1470
|
-
request = Models::Operations::LmsDeleteUserCompletionRequest.new(
|
1471
|
-
|
1472
|
-
id: id,
|
1473
|
-
sub_resource_id: sub_resource_id,
|
1474
|
-
x_account_id: x_account_id
|
1475
|
-
)
|
1476
|
-
url, params = @sdk_configuration.get_server_details
|
1477
|
-
base_url = Utils.template_url(url, params)
|
1478
|
-
url = Utils.generate_url(
|
1479
|
-
Models::Operations::LmsDeleteUserCompletionRequest,
|
1480
|
-
base_url,
|
1481
|
-
'/unified/lms/users/{id}/completions/{subResourceId}',
|
1482
|
-
request
|
1483
|
-
)
|
1484
|
-
headers = Utils.get_headers(request)
|
1485
|
-
headers['Accept'] = 'application/json'
|
1486
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
1487
|
-
retries ||= @sdk_configuration.retry_config
|
1488
|
-
retries ||= Utils::RetryConfig.new(
|
1489
|
-
backoff: Utils::BackoffStrategy.new(
|
1490
|
-
exponent: 1.5,
|
1491
|
-
initial_interval: 500,
|
1492
|
-
max_elapsed_time: 3_600_000,
|
1493
|
-
max_interval: 60_000
|
1494
|
-
),
|
1495
|
-
retry_connection_errors: true,
|
1496
|
-
strategy: 'backoff'
|
1497
|
-
)
|
1498
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
1499
|
-
retry_options[:retry_statuses] = [429, 408]
|
1500
|
-
|
1501
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1502
|
-
|
1503
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1504
|
-
timeout ||= @sdk_configuration.timeout
|
1505
|
-
|
1506
|
-
connection = @sdk_configuration.client.dup
|
1507
|
-
connection.request :retry, retry_options
|
1508
|
-
|
1509
|
-
hook_ctx = SDKHooks::HookContext.new(
|
1510
|
-
base_url: base_url,
|
1511
|
-
oauth2_scopes: [],
|
1512
|
-
operation_id: 'lms_delete_user_completion',
|
1513
|
-
security_source: @sdk_configuration.security_source
|
1514
|
-
)
|
1515
|
-
|
1516
|
-
error = T.let(nil, T.nilable(StandardError))
|
1517
|
-
http_response = T.let(nil, T.nilable(Faraday::Response))
|
1518
|
-
|
1519
|
-
|
1520
|
-
begin
|
1521
|
-
http_response = connection.delete(url) do |req|
|
1522
|
-
req.headers.merge!(headers)
|
1523
|
-
req.options.timeout = timeout unless timeout.nil?
|
1524
|
-
Utils.configure_request_security(req, security)
|
1525
|
-
|
1526
|
-
@sdk_configuration.hooks.before_request(
|
1527
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1528
|
-
hook_ctx: hook_ctx
|
1529
|
-
),
|
1530
|
-
request: req
|
1531
|
-
)
|
1532
|
-
end
|
1533
|
-
rescue StandardError => e
|
1534
|
-
error = e
|
1535
|
-
ensure
|
1536
|
-
if http_response.nil? || Utils.error_status?(http_response.status)
|
1537
|
-
http_response = @sdk_configuration.hooks.after_error(
|
1538
|
-
error: error,
|
1539
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1540
|
-
hook_ctx: hook_ctx
|
1541
|
-
),
|
1542
|
-
response: http_response
|
1543
|
-
)
|
1544
|
-
else
|
1545
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1546
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1547
|
-
hook_ctx: hook_ctx
|
1548
|
-
),
|
1549
|
-
response: http_response
|
1550
|
-
)
|
1551
|
-
end
|
1552
|
-
|
1553
|
-
if http_response.nil?
|
1554
|
-
raise error if !error.nil?
|
1555
|
-
raise 'no response'
|
1556
|
-
end
|
1557
|
-
end
|
1558
|
-
|
1559
|
-
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
1560
|
-
if Utils.match_status_code(http_response.status, ['200'])
|
1561
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1562
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1563
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1564
|
-
hook_ctx: hook_ctx
|
1565
|
-
),
|
1566
|
-
response: http_response
|
1567
|
-
)
|
1568
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::DeleteResult)
|
1569
|
-
response = Models::Operations::LmsDeleteUserCompletionResponse.new(
|
1570
|
-
status_code: http_response.status,
|
1571
|
-
content_type: content_type,
|
1572
|
-
raw_response: http_response,
|
1573
|
-
delete_result: obj
|
1574
|
-
)
|
1575
|
-
|
1576
|
-
return response
|
1577
|
-
else
|
1578
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1579
|
-
end
|
1580
|
-
elsif Utils.match_status_code(http_response.status, ['204'])
|
1581
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1582
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1583
|
-
hook_ctx: hook_ctx
|
1584
|
-
),
|
1585
|
-
response: http_response
|
1586
|
-
)
|
1587
|
-
return Models::Operations::LmsDeleteUserCompletionResponse.new(
|
1588
|
-
status_code: http_response.status,
|
1589
|
-
content_type: content_type,
|
1590
|
-
raw_response: http_response
|
1591
|
-
)
|
1592
|
-
elsif Utils.match_status_code(http_response.status, ['400'])
|
1593
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1594
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1595
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1596
|
-
hook_ctx: hook_ctx
|
1597
|
-
),
|
1598
|
-
response: http_response
|
1599
|
-
)
|
1600
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadRequestResponse)
|
1601
|
-
throw obj
|
1602
|
-
else
|
1603
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1604
|
-
end
|
1605
|
-
elsif Utils.match_status_code(http_response.status, ['401'])
|
1606
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1607
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1608
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1609
|
-
hook_ctx: hook_ctx
|
1610
|
-
),
|
1611
|
-
response: http_response
|
1612
|
-
)
|
1613
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnauthorizedResponse)
|
1614
|
-
throw obj
|
1615
|
-
else
|
1616
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1617
|
-
end
|
1618
|
-
elsif Utils.match_status_code(http_response.status, ['403'])
|
1619
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1620
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1621
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1622
|
-
hook_ctx: hook_ctx
|
1623
|
-
),
|
1624
|
-
response: http_response
|
1625
|
-
)
|
1626
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ForbiddenResponse)
|
1627
|
-
throw obj
|
1628
|
-
else
|
1629
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1630
|
-
end
|
1631
|
-
elsif Utils.match_status_code(http_response.status, ['404'])
|
1632
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1633
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1634
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1635
|
-
hook_ctx: hook_ctx
|
1636
|
-
),
|
1637
|
-
response: http_response
|
1638
|
-
)
|
1639
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotFoundResponse)
|
1640
|
-
throw obj
|
1641
|
-
else
|
1642
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1643
|
-
end
|
1644
|
-
elsif Utils.match_status_code(http_response.status, ['408'])
|
1645
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1646
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1647
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1648
|
-
hook_ctx: hook_ctx
|
1649
|
-
),
|
1650
|
-
response: http_response
|
1651
|
-
)
|
1652
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::RequestTimedOutResponse)
|
1653
|
-
throw obj
|
1654
|
-
else
|
1655
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1656
|
-
end
|
1657
|
-
elsif Utils.match_status_code(http_response.status, ['409'])
|
1658
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1659
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1660
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1661
|
-
hook_ctx: hook_ctx
|
1662
|
-
),
|
1663
|
-
response: http_response
|
1664
|
-
)
|
1665
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::ConflictResponse)
|
1666
|
-
throw obj
|
1667
|
-
else
|
1668
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1669
|
-
end
|
1670
|
-
elsif Utils.match_status_code(http_response.status, ['412'])
|
1671
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1672
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1673
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1674
|
-
hook_ctx: hook_ctx
|
1675
|
-
),
|
1676
|
-
response: http_response
|
1677
|
-
)
|
1678
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::PreconditionFailedResponse)
|
1679
|
-
throw obj
|
1680
|
-
else
|
1681
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1682
|
-
end
|
1683
|
-
elsif Utils.match_status_code(http_response.status, ['422'])
|
1684
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1685
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1686
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1687
|
-
hook_ctx: hook_ctx
|
1688
|
-
),
|
1689
|
-
response: http_response
|
1690
|
-
)
|
1691
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::UnprocessableEntityResponse)
|
1692
|
-
throw obj
|
1693
|
-
else
|
1694
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1695
|
-
end
|
1696
|
-
elsif Utils.match_status_code(http_response.status, ['429'])
|
1697
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1698
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1699
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1700
|
-
hook_ctx: hook_ctx
|
1701
|
-
),
|
1702
|
-
response: http_response
|
1703
|
-
)
|
1704
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::TooManyRequestsResponse)
|
1705
|
-
throw obj
|
1706
|
-
else
|
1707
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1708
|
-
end
|
1709
|
-
elsif Utils.match_status_code(http_response.status, ['500'])
|
1710
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1711
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1712
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1713
|
-
hook_ctx: hook_ctx
|
1714
|
-
),
|
1715
|
-
response: http_response
|
1716
|
-
)
|
1717
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::InternalServerErrorResponse)
|
1718
|
-
throw obj
|
1719
|
-
else
|
1720
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1721
|
-
end
|
1722
|
-
elsif Utils.match_status_code(http_response.status, ['501'])
|
1723
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1724
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1725
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1726
|
-
hook_ctx: hook_ctx
|
1727
|
-
),
|
1728
|
-
response: http_response
|
1729
|
-
)
|
1730
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::NotImplementedResponse)
|
1731
|
-
throw obj
|
1732
|
-
else
|
1733
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1734
|
-
end
|
1735
|
-
elsif Utils.match_status_code(http_response.status, ['502'])
|
1736
|
-
if Utils.match_content_type(content_type, 'application/json')
|
1737
|
-
http_response = @sdk_configuration.hooks.after_success(
|
1738
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1739
|
-
hook_ctx: hook_ctx
|
1740
|
-
),
|
1741
|
-
response: http_response
|
1742
|
-
)
|
1743
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Errors::BadGatewayResponse)
|
1744
|
-
throw obj
|
1745
|
-
else
|
1746
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
1747
|
-
end
|
1748
|
-
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
1749
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
1750
|
-
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
1751
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
1752
|
-
else
|
1753
|
-
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
1754
|
-
|
1755
|
-
end
|
1756
|
-
end
|
1757
|
-
|
1758
|
-
|
1759
|
-
sig { params(request: T.nilable(Models::Operations::LmsGetAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetAssignmentResponse) }
|
1760
|
-
def get_assignment(request, retries = nil, timeout_ms = nil)
|
1761
|
-
# get_assignment - Get Assignment
|
1762
|
-
url, params = @sdk_configuration.get_server_details
|
1763
|
-
base_url = Utils.template_url(url, params)
|
1764
614
|
url = Utils.generate_url(
|
1765
|
-
Models::Operations::
|
615
|
+
Models::Operations::LmsCreateUserCompletionRequest,
|
1766
616
|
base_url,
|
1767
|
-
'/unified/lms/
|
617
|
+
'/unified/lms/users/{id}/completions',
|
1768
618
|
request
|
1769
619
|
)
|
1770
620
|
headers = Utils.get_headers(request)
|
1771
|
-
|
621
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_completion_request_dto, :json)
|
622
|
+
headers['content-type'] = req_content_type
|
623
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
624
|
+
|
625
|
+
if form
|
626
|
+
body = Utils.encode_form(form)
|
627
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
628
|
+
body = URI.encode_www_form(data)
|
629
|
+
else
|
630
|
+
body = data
|
631
|
+
end
|
1772
632
|
headers['Accept'] = 'application/json'
|
1773
633
|
headers['user-agent'] = @sdk_configuration.user_agent
|
1774
634
|
retries ||= @sdk_configuration.retry_config
|
@@ -1796,7 +656,7 @@ module StackOne
|
|
1796
656
|
hook_ctx = SDKHooks::HookContext.new(
|
1797
657
|
base_url: base_url,
|
1798
658
|
oauth2_scopes: [],
|
1799
|
-
operation_id: '
|
659
|
+
operation_id: 'lms_create_user_completion',
|
1800
660
|
security_source: @sdk_configuration.security_source
|
1801
661
|
)
|
1802
662
|
|
@@ -1805,10 +665,10 @@ module StackOne
|
|
1805
665
|
|
1806
666
|
|
1807
667
|
begin
|
1808
|
-
http_response = connection.
|
668
|
+
http_response = connection.post(url) do |req|
|
669
|
+
req.body = body
|
1809
670
|
req.headers.merge!(headers)
|
1810
671
|
req.options.timeout = timeout unless timeout.nil?
|
1811
|
-
req.params = query_params
|
1812
672
|
Utils.configure_request_security(req, security)
|
1813
673
|
|
1814
674
|
@sdk_configuration.hooks.before_request(
|
@@ -1845,7 +705,7 @@ module StackOne
|
|
1845
705
|
end
|
1846
706
|
|
1847
707
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
1848
|
-
if Utils.match_status_code(http_response.status, ['
|
708
|
+
if Utils.match_status_code(http_response.status, ['201'])
|
1849
709
|
if Utils.match_content_type(content_type, 'application/json')
|
1850
710
|
http_response = @sdk_configuration.hooks.after_success(
|
1851
711
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
@@ -1853,12 +713,12 @@ module StackOne
|
|
1853
713
|
),
|
1854
714
|
response: http_response
|
1855
715
|
)
|
1856
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
1857
|
-
response = Models::Operations::
|
716
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CreateResult)
|
717
|
+
response = Models::Operations::LmsCreateUserCompletionResponse.new(
|
1858
718
|
status_code: http_response.status,
|
1859
719
|
content_type: content_type,
|
1860
720
|
raw_response: http_response,
|
1861
|
-
|
721
|
+
create_result: obj
|
1862
722
|
)
|
1863
723
|
|
1864
724
|
return response
|
@@ -2032,19 +892,24 @@ module StackOne
|
|
2032
892
|
end
|
2033
893
|
|
2034
894
|
|
2035
|
-
sig { params(
|
2036
|
-
def
|
2037
|
-
#
|
895
|
+
sig { params(id: ::String, sub_resource_id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsDeleteUserCompletionResponse) }
|
896
|
+
def delete_user_completion(id, sub_resource_id, x_account_id, retries = nil, timeout_ms = nil)
|
897
|
+
# delete_user_completion - Delete User Completion
|
898
|
+
request = Models::Operations::LmsDeleteUserCompletionRequest.new(
|
899
|
+
|
900
|
+
id: id,
|
901
|
+
sub_resource_id: sub_resource_id,
|
902
|
+
x_account_id: x_account_id
|
903
|
+
)
|
2038
904
|
url, params = @sdk_configuration.get_server_details
|
2039
905
|
base_url = Utils.template_url(url, params)
|
2040
906
|
url = Utils.generate_url(
|
2041
|
-
Models::Operations::
|
907
|
+
Models::Operations::LmsDeleteUserCompletionRequest,
|
2042
908
|
base_url,
|
2043
|
-
'/unified/lms/
|
909
|
+
'/unified/lms/users/{id}/completions/{subResourceId}',
|
2044
910
|
request
|
2045
911
|
)
|
2046
912
|
headers = Utils.get_headers(request)
|
2047
|
-
query_params = Utils.get_query_params(Models::Operations::LmsGetCategoryRequest, request)
|
2048
913
|
headers['Accept'] = 'application/json'
|
2049
914
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2050
915
|
retries ||= @sdk_configuration.retry_config
|
@@ -2072,7 +937,7 @@ module StackOne
|
|
2072
937
|
hook_ctx = SDKHooks::HookContext.new(
|
2073
938
|
base_url: base_url,
|
2074
939
|
oauth2_scopes: [],
|
2075
|
-
operation_id: '
|
940
|
+
operation_id: 'lms_delete_user_completion',
|
2076
941
|
security_source: @sdk_configuration.security_source
|
2077
942
|
)
|
2078
943
|
|
@@ -2081,10 +946,9 @@ module StackOne
|
|
2081
946
|
|
2082
947
|
|
2083
948
|
begin
|
2084
|
-
http_response = connection.
|
949
|
+
http_response = connection.delete(url) do |req|
|
2085
950
|
req.headers.merge!(headers)
|
2086
951
|
req.options.timeout = timeout unless timeout.nil?
|
2087
|
-
req.params = query_params
|
2088
952
|
Utils.configure_request_security(req, security)
|
2089
953
|
|
2090
954
|
@sdk_configuration.hooks.before_request(
|
@@ -2129,18 +993,30 @@ module StackOne
|
|
2129
993
|
),
|
2130
994
|
response: http_response
|
2131
995
|
)
|
2132
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
2133
|
-
response = Models::Operations::
|
996
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::DeleteResult)
|
997
|
+
response = Models::Operations::LmsDeleteUserCompletionResponse.new(
|
2134
998
|
status_code: http_response.status,
|
2135
999
|
content_type: content_type,
|
2136
1000
|
raw_response: http_response,
|
2137
|
-
|
1001
|
+
delete_result: obj
|
2138
1002
|
)
|
2139
1003
|
|
2140
1004
|
return response
|
2141
1005
|
else
|
2142
1006
|
raise ::StackOne::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
2143
1007
|
end
|
1008
|
+
elsif Utils.match_status_code(http_response.status, ['204'])
|
1009
|
+
http_response = @sdk_configuration.hooks.after_success(
|
1010
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1011
|
+
hook_ctx: hook_ctx
|
1012
|
+
),
|
1013
|
+
response: http_response
|
1014
|
+
)
|
1015
|
+
return Models::Operations::LmsDeleteUserCompletionResponse.new(
|
1016
|
+
status_code: http_response.status,
|
1017
|
+
content_type: content_type,
|
1018
|
+
raw_response: http_response
|
1019
|
+
)
|
2144
1020
|
elsif Utils.match_status_code(http_response.status, ['400'])
|
2145
1021
|
if Utils.match_content_type(content_type, 'application/json')
|
2146
1022
|
http_response = @sdk_configuration.hooks.after_success(
|
@@ -2308,19 +1184,19 @@ module StackOne
|
|
2308
1184
|
end
|
2309
1185
|
|
2310
1186
|
|
2311
|
-
sig { params(request: T.nilable(Models::Operations::
|
2312
|
-
def
|
2313
|
-
#
|
1187
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetAssignmentResponse) }
|
1188
|
+
def get_assignment(request, retries = nil, timeout_ms = nil)
|
1189
|
+
# get_assignment - Get Assignment
|
2314
1190
|
url, params = @sdk_configuration.get_server_details
|
2315
1191
|
base_url = Utils.template_url(url, params)
|
2316
1192
|
url = Utils.generate_url(
|
2317
|
-
Models::Operations::
|
1193
|
+
Models::Operations::LmsGetAssignmentRequest,
|
2318
1194
|
base_url,
|
2319
|
-
'/unified/lms/
|
1195
|
+
'/unified/lms/assignments/{id}',
|
2320
1196
|
request
|
2321
1197
|
)
|
2322
1198
|
headers = Utils.get_headers(request)
|
2323
|
-
query_params = Utils.get_query_params(Models::Operations::
|
1199
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetAssignmentRequest, request)
|
2324
1200
|
headers['Accept'] = 'application/json'
|
2325
1201
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2326
1202
|
retries ||= @sdk_configuration.retry_config
|
@@ -2348,7 +1224,7 @@ module StackOne
|
|
2348
1224
|
hook_ctx = SDKHooks::HookContext.new(
|
2349
1225
|
base_url: base_url,
|
2350
1226
|
oauth2_scopes: [],
|
2351
|
-
operation_id: '
|
1227
|
+
operation_id: 'lms_get_assignment',
|
2352
1228
|
security_source: @sdk_configuration.security_source
|
2353
1229
|
)
|
2354
1230
|
|
@@ -2405,12 +1281,12 @@ module StackOne
|
|
2405
1281
|
),
|
2406
1282
|
response: http_response
|
2407
1283
|
)
|
2408
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
2409
|
-
response = Models::Operations::
|
1284
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::AssignmentResult)
|
1285
|
+
response = Models::Operations::LmsGetAssignmentResponse.new(
|
2410
1286
|
status_code: http_response.status,
|
2411
1287
|
content_type: content_type,
|
2412
1288
|
raw_response: http_response,
|
2413
|
-
|
1289
|
+
assignment_result: obj
|
2414
1290
|
)
|
2415
1291
|
|
2416
1292
|
return response
|
@@ -2584,19 +1460,19 @@ module StackOne
|
|
2584
1460
|
end
|
2585
1461
|
|
2586
1462
|
|
2587
|
-
sig { params(request: T.nilable(Models::Operations::
|
2588
|
-
def
|
2589
|
-
#
|
1463
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetCategoryRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetCategoryResponse) }
|
1464
|
+
def get_category(request, retries = nil, timeout_ms = nil)
|
1465
|
+
# get_category - Get Category
|
2590
1466
|
url, params = @sdk_configuration.get_server_details
|
2591
1467
|
base_url = Utils.template_url(url, params)
|
2592
1468
|
url = Utils.generate_url(
|
2593
|
-
Models::Operations::
|
1469
|
+
Models::Operations::LmsGetCategoryRequest,
|
2594
1470
|
base_url,
|
2595
|
-
'/unified/lms/
|
1471
|
+
'/unified/lms/categories/{id}',
|
2596
1472
|
request
|
2597
1473
|
)
|
2598
1474
|
headers = Utils.get_headers(request)
|
2599
|
-
query_params = Utils.get_query_params(Models::Operations::
|
1475
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetCategoryRequest, request)
|
2600
1476
|
headers['Accept'] = 'application/json'
|
2601
1477
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2602
1478
|
retries ||= @sdk_configuration.retry_config
|
@@ -2624,7 +1500,7 @@ module StackOne
|
|
2624
1500
|
hook_ctx = SDKHooks::HookContext.new(
|
2625
1501
|
base_url: base_url,
|
2626
1502
|
oauth2_scopes: [],
|
2627
|
-
operation_id: '
|
1503
|
+
operation_id: 'lms_get_category',
|
2628
1504
|
security_source: @sdk_configuration.security_source
|
2629
1505
|
)
|
2630
1506
|
|
@@ -2681,12 +1557,12 @@ module StackOne
|
|
2681
1557
|
),
|
2682
1558
|
response: http_response
|
2683
1559
|
)
|
2684
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
2685
|
-
response = Models::Operations::
|
1560
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CategoryResult)
|
1561
|
+
response = Models::Operations::LmsGetCategoryResponse.new(
|
2686
1562
|
status_code: http_response.status,
|
2687
1563
|
content_type: content_type,
|
2688
1564
|
raw_response: http_response,
|
2689
|
-
|
1565
|
+
category_result: obj
|
2690
1566
|
)
|
2691
1567
|
|
2692
1568
|
return response
|
@@ -2860,19 +1736,19 @@ module StackOne
|
|
2860
1736
|
end
|
2861
1737
|
|
2862
1738
|
|
2863
|
-
sig { params(request: T.nilable(Models::Operations::
|
2864
|
-
def
|
2865
|
-
#
|
1739
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetCompletionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetCompletionResponse) }
|
1740
|
+
def get_completion(request, retries = nil, timeout_ms = nil)
|
1741
|
+
# get_completion - Get Completion
|
2866
1742
|
url, params = @sdk_configuration.get_server_details
|
2867
1743
|
base_url = Utils.template_url(url, params)
|
2868
1744
|
url = Utils.generate_url(
|
2869
|
-
Models::Operations::
|
1745
|
+
Models::Operations::LmsGetCompletionRequest,
|
2870
1746
|
base_url,
|
2871
|
-
'/unified/lms/
|
1747
|
+
'/unified/lms/completions/{id}',
|
2872
1748
|
request
|
2873
1749
|
)
|
2874
1750
|
headers = Utils.get_headers(request)
|
2875
|
-
query_params = Utils.get_query_params(Models::Operations::
|
1751
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetCompletionRequest, request)
|
2876
1752
|
headers['Accept'] = 'application/json'
|
2877
1753
|
headers['user-agent'] = @sdk_configuration.user_agent
|
2878
1754
|
retries ||= @sdk_configuration.retry_config
|
@@ -2900,7 +1776,7 @@ module StackOne
|
|
2900
1776
|
hook_ctx = SDKHooks::HookContext.new(
|
2901
1777
|
base_url: base_url,
|
2902
1778
|
oauth2_scopes: [],
|
2903
|
-
operation_id: '
|
1779
|
+
operation_id: 'lms_get_completion',
|
2904
1780
|
security_source: @sdk_configuration.security_source
|
2905
1781
|
)
|
2906
1782
|
|
@@ -2957,12 +1833,12 @@ module StackOne
|
|
2957
1833
|
),
|
2958
1834
|
response: http_response
|
2959
1835
|
)
|
2960
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
2961
|
-
response = Models::Operations::
|
1836
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CompletionResult)
|
1837
|
+
response = Models::Operations::LmsGetCompletionResponse.new(
|
2962
1838
|
status_code: http_response.status,
|
2963
1839
|
content_type: content_type,
|
2964
1840
|
raw_response: http_response,
|
2965
|
-
|
1841
|
+
completion_result: obj
|
2966
1842
|
)
|
2967
1843
|
|
2968
1844
|
return response
|
@@ -3136,19 +2012,19 @@ module StackOne
|
|
3136
2012
|
end
|
3137
2013
|
|
3138
2014
|
|
3139
|
-
sig { params(request: T.nilable(Models::Operations::
|
3140
|
-
def
|
3141
|
-
#
|
2015
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetContentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetContentResponse) }
|
2016
|
+
def get_content(request, retries = nil, timeout_ms = nil)
|
2017
|
+
# get_content - Get Content
|
3142
2018
|
url, params = @sdk_configuration.get_server_details
|
3143
2019
|
base_url = Utils.template_url(url, params)
|
3144
2020
|
url = Utils.generate_url(
|
3145
|
-
Models::Operations::
|
2021
|
+
Models::Operations::LmsGetContentRequest,
|
3146
2022
|
base_url,
|
3147
|
-
'/unified/lms/
|
2023
|
+
'/unified/lms/content/{id}',
|
3148
2024
|
request
|
3149
2025
|
)
|
3150
2026
|
headers = Utils.get_headers(request)
|
3151
|
-
query_params = Utils.get_query_params(Models::Operations::
|
2027
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetContentRequest, request)
|
3152
2028
|
headers['Accept'] = 'application/json'
|
3153
2029
|
headers['user-agent'] = @sdk_configuration.user_agent
|
3154
2030
|
retries ||= @sdk_configuration.retry_config
|
@@ -3176,7 +2052,7 @@ module StackOne
|
|
3176
2052
|
hook_ctx = SDKHooks::HookContext.new(
|
3177
2053
|
base_url: base_url,
|
3178
2054
|
oauth2_scopes: [],
|
3179
|
-
operation_id: '
|
2055
|
+
operation_id: 'lms_get_content',
|
3180
2056
|
security_source: @sdk_configuration.security_source
|
3181
2057
|
)
|
3182
2058
|
|
@@ -3233,12 +2109,12 @@ module StackOne
|
|
3233
2109
|
),
|
3234
2110
|
response: http_response
|
3235
2111
|
)
|
3236
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
3237
|
-
response = Models::Operations::
|
2112
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::ContentResult)
|
2113
|
+
response = Models::Operations::LmsGetContentResponse.new(
|
3238
2114
|
status_code: http_response.status,
|
3239
2115
|
content_type: content_type,
|
3240
2116
|
raw_response: http_response,
|
3241
|
-
|
2117
|
+
content_result: obj
|
3242
2118
|
)
|
3243
2119
|
|
3244
2120
|
return response
|
@@ -3412,19 +2288,19 @@ module StackOne
|
|
3412
2288
|
end
|
3413
2289
|
|
3414
2290
|
|
3415
|
-
sig { params(request: T.nilable(Models::Operations::
|
3416
|
-
def
|
3417
|
-
#
|
2291
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetCourseRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetCourseResponse) }
|
2292
|
+
def get_course(request, retries = nil, timeout_ms = nil)
|
2293
|
+
# get_course - Get Course
|
3418
2294
|
url, params = @sdk_configuration.get_server_details
|
3419
2295
|
base_url = Utils.template_url(url, params)
|
3420
2296
|
url = Utils.generate_url(
|
3421
|
-
Models::Operations::
|
2297
|
+
Models::Operations::LmsGetCourseRequest,
|
3422
2298
|
base_url,
|
3423
|
-
'/unified/lms/
|
2299
|
+
'/unified/lms/courses/{id}',
|
3424
2300
|
request
|
3425
2301
|
)
|
3426
2302
|
headers = Utils.get_headers(request)
|
3427
|
-
query_params = Utils.get_query_params(Models::Operations::
|
2303
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetCourseRequest, request)
|
3428
2304
|
headers['Accept'] = 'application/json'
|
3429
2305
|
headers['user-agent'] = @sdk_configuration.user_agent
|
3430
2306
|
retries ||= @sdk_configuration.retry_config
|
@@ -3452,7 +2328,7 @@ module StackOne
|
|
3452
2328
|
hook_ctx = SDKHooks::HookContext.new(
|
3453
2329
|
base_url: base_url,
|
3454
2330
|
oauth2_scopes: [],
|
3455
|
-
operation_id: '
|
2331
|
+
operation_id: 'lms_get_course',
|
3456
2332
|
security_source: @sdk_configuration.security_source
|
3457
2333
|
)
|
3458
2334
|
|
@@ -3509,12 +2385,12 @@ module StackOne
|
|
3509
2385
|
),
|
3510
2386
|
response: http_response
|
3511
2387
|
)
|
3512
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
3513
|
-
response = Models::Operations::
|
2388
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CourseResult)
|
2389
|
+
response = Models::Operations::LmsGetCourseResponse.new(
|
3514
2390
|
status_code: http_response.status,
|
3515
2391
|
content_type: content_type,
|
3516
2392
|
raw_response: http_response,
|
3517
|
-
|
2393
|
+
course_result: obj
|
3518
2394
|
)
|
3519
2395
|
|
3520
2396
|
return response
|
@@ -3688,19 +2564,19 @@ module StackOne
|
|
3688
2564
|
end
|
3689
2565
|
|
3690
2566
|
|
3691
|
-
sig { params(request: T.nilable(Models::Operations::
|
3692
|
-
def
|
3693
|
-
#
|
2567
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetSkillRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetSkillResponse) }
|
2568
|
+
def get_skill(request, retries = nil, timeout_ms = nil)
|
2569
|
+
# get_skill - Get Skill
|
3694
2570
|
url, params = @sdk_configuration.get_server_details
|
3695
2571
|
base_url = Utils.template_url(url, params)
|
3696
2572
|
url = Utils.generate_url(
|
3697
|
-
Models::Operations::
|
2573
|
+
Models::Operations::LmsGetSkillRequest,
|
3698
2574
|
base_url,
|
3699
|
-
'/unified/lms/
|
2575
|
+
'/unified/lms/skills/{id}',
|
3700
2576
|
request
|
3701
2577
|
)
|
3702
2578
|
headers = Utils.get_headers(request)
|
3703
|
-
query_params = Utils.get_query_params(Models::Operations::
|
2579
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetSkillRequest, request)
|
3704
2580
|
headers['Accept'] = 'application/json'
|
3705
2581
|
headers['user-agent'] = @sdk_configuration.user_agent
|
3706
2582
|
retries ||= @sdk_configuration.retry_config
|
@@ -3728,7 +2604,7 @@ module StackOne
|
|
3728
2604
|
hook_ctx = SDKHooks::HookContext.new(
|
3729
2605
|
base_url: base_url,
|
3730
2606
|
oauth2_scopes: [],
|
3731
|
-
operation_id: '
|
2607
|
+
operation_id: 'lms_get_skill',
|
3732
2608
|
security_source: @sdk_configuration.security_source
|
3733
2609
|
)
|
3734
2610
|
|
@@ -3785,12 +2661,12 @@ module StackOne
|
|
3785
2661
|
),
|
3786
2662
|
response: http_response
|
3787
2663
|
)
|
3788
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
3789
|
-
response = Models::Operations::
|
2664
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::SkillResult)
|
2665
|
+
response = Models::Operations::LmsGetSkillResponse.new(
|
3790
2666
|
status_code: http_response.status,
|
3791
2667
|
content_type: content_type,
|
3792
2668
|
raw_response: http_response,
|
3793
|
-
|
2669
|
+
skill_result: obj
|
3794
2670
|
)
|
3795
2671
|
|
3796
2672
|
return response
|
@@ -3964,19 +2840,19 @@ module StackOne
|
|
3964
2840
|
end
|
3965
2841
|
|
3966
2842
|
|
3967
|
-
sig { params(request: T.nilable(Models::Operations::
|
3968
|
-
def
|
3969
|
-
#
|
2843
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetUserRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetUserResponse) }
|
2844
|
+
def get_user(request, retries = nil, timeout_ms = nil)
|
2845
|
+
# get_user - Get User
|
3970
2846
|
url, params = @sdk_configuration.get_server_details
|
3971
2847
|
base_url = Utils.template_url(url, params)
|
3972
2848
|
url = Utils.generate_url(
|
3973
|
-
Models::Operations::
|
2849
|
+
Models::Operations::LmsGetUserRequest,
|
3974
2850
|
base_url,
|
3975
|
-
'/unified/lms/users/{id}
|
2851
|
+
'/unified/lms/users/{id}',
|
3976
2852
|
request
|
3977
2853
|
)
|
3978
2854
|
headers = Utils.get_headers(request)
|
3979
|
-
query_params = Utils.get_query_params(Models::Operations::
|
2855
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetUserRequest, request)
|
3980
2856
|
headers['Accept'] = 'application/json'
|
3981
2857
|
headers['user-agent'] = @sdk_configuration.user_agent
|
3982
2858
|
retries ||= @sdk_configuration.retry_config
|
@@ -4004,7 +2880,7 @@ module StackOne
|
|
4004
2880
|
hook_ctx = SDKHooks::HookContext.new(
|
4005
2881
|
base_url: base_url,
|
4006
2882
|
oauth2_scopes: [],
|
4007
|
-
operation_id: '
|
2883
|
+
operation_id: 'lms_get_user',
|
4008
2884
|
security_source: @sdk_configuration.security_source
|
4009
2885
|
)
|
4010
2886
|
|
@@ -4061,12 +2937,12 @@ module StackOne
|
|
4061
2937
|
),
|
4062
2938
|
response: http_response
|
4063
2939
|
)
|
4064
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
4065
|
-
response = Models::Operations::
|
2940
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::UserResult)
|
2941
|
+
response = Models::Operations::LmsGetUserResponse.new(
|
4066
2942
|
status_code: http_response.status,
|
4067
2943
|
content_type: content_type,
|
4068
2944
|
raw_response: http_response,
|
4069
|
-
|
2945
|
+
user_result: obj
|
4070
2946
|
)
|
4071
2947
|
|
4072
2948
|
return response
|
@@ -4240,14 +3116,19 @@ module StackOne
|
|
4240
3116
|
end
|
4241
3117
|
|
4242
3118
|
|
4243
|
-
sig { params(request: T.nilable(Models::Operations::
|
4244
|
-
def
|
4245
|
-
#
|
3119
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetUserAssignmentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetUserAssignmentResponse) }
|
3120
|
+
def get_user_assignment(request, retries = nil, timeout_ms = nil)
|
3121
|
+
# get_user_assignment - Get User Assignment
|
4246
3122
|
url, params = @sdk_configuration.get_server_details
|
4247
3123
|
base_url = Utils.template_url(url, params)
|
4248
|
-
url =
|
3124
|
+
url = Utils.generate_url(
|
3125
|
+
Models::Operations::LmsGetUserAssignmentRequest,
|
3126
|
+
base_url,
|
3127
|
+
'/unified/lms/users/{id}/assignments/{subResourceId}',
|
3128
|
+
request
|
3129
|
+
)
|
4249
3130
|
headers = Utils.get_headers(request)
|
4250
|
-
query_params = Utils.get_query_params(Models::Operations::
|
3131
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetUserAssignmentRequest, request)
|
4251
3132
|
headers['Accept'] = 'application/json'
|
4252
3133
|
headers['user-agent'] = @sdk_configuration.user_agent
|
4253
3134
|
retries ||= @sdk_configuration.retry_config
|
@@ -4275,7 +3156,7 @@ module StackOne
|
|
4275
3156
|
hook_ctx = SDKHooks::HookContext.new(
|
4276
3157
|
base_url: base_url,
|
4277
3158
|
oauth2_scopes: [],
|
4278
|
-
operation_id: '
|
3159
|
+
operation_id: 'lms_get_user_assignment',
|
4279
3160
|
security_source: @sdk_configuration.security_source
|
4280
3161
|
)
|
4281
3162
|
|
@@ -4332,12 +3213,12 @@ module StackOne
|
|
4332
3213
|
),
|
4333
3214
|
response: http_response
|
4334
3215
|
)
|
4335
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
4336
|
-
response = Models::Operations::
|
3216
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::AssignmentResult)
|
3217
|
+
response = Models::Operations::LmsGetUserAssignmentResponse.new(
|
4337
3218
|
status_code: http_response.status,
|
4338
3219
|
content_type: content_type,
|
4339
3220
|
raw_response: http_response,
|
4340
|
-
|
3221
|
+
assignment_result: obj
|
4341
3222
|
)
|
4342
3223
|
|
4343
3224
|
return response
|
@@ -4511,14 +3392,19 @@ module StackOne
|
|
4511
3392
|
end
|
4512
3393
|
|
4513
3394
|
|
4514
|
-
sig { params(request: T.nilable(Models::Operations::
|
4515
|
-
def
|
4516
|
-
#
|
3395
|
+
sig { params(request: T.nilable(Models::Operations::LmsGetUserCompletionRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsGetUserCompletionResponse) }
|
3396
|
+
def get_user_completion(request, retries = nil, timeout_ms = nil)
|
3397
|
+
# get_user_completion - Get User Completion
|
4517
3398
|
url, params = @sdk_configuration.get_server_details
|
4518
3399
|
base_url = Utils.template_url(url, params)
|
4519
|
-
url =
|
3400
|
+
url = Utils.generate_url(
|
3401
|
+
Models::Operations::LmsGetUserCompletionRequest,
|
3402
|
+
base_url,
|
3403
|
+
'/unified/lms/users/{id}/completions/{subResourceId}',
|
3404
|
+
request
|
3405
|
+
)
|
4520
3406
|
headers = Utils.get_headers(request)
|
4521
|
-
query_params = Utils.get_query_params(Models::Operations::
|
3407
|
+
query_params = Utils.get_query_params(Models::Operations::LmsGetUserCompletionRequest, request)
|
4522
3408
|
headers['Accept'] = 'application/json'
|
4523
3409
|
headers['user-agent'] = @sdk_configuration.user_agent
|
4524
3410
|
retries ||= @sdk_configuration.retry_config
|
@@ -4546,7 +3432,7 @@ module StackOne
|
|
4546
3432
|
hook_ctx = SDKHooks::HookContext.new(
|
4547
3433
|
base_url: base_url,
|
4548
3434
|
oauth2_scopes: [],
|
4549
|
-
operation_id: '
|
3435
|
+
operation_id: 'lms_get_user_completion',
|
4550
3436
|
security_source: @sdk_configuration.security_source
|
4551
3437
|
)
|
4552
3438
|
|
@@ -4603,12 +3489,12 @@ module StackOne
|
|
4603
3489
|
),
|
4604
3490
|
response: http_response
|
4605
3491
|
)
|
4606
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
4607
|
-
response = Models::Operations::
|
3492
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CompletionResult)
|
3493
|
+
response = Models::Operations::LmsGetUserCompletionResponse.new(
|
4608
3494
|
status_code: http_response.status,
|
4609
3495
|
content_type: content_type,
|
4610
3496
|
raw_response: http_response,
|
4611
|
-
|
3497
|
+
completion_result: obj
|
4612
3498
|
)
|
4613
3499
|
|
4614
3500
|
return response
|
@@ -4781,15 +3667,15 @@ module StackOne
|
|
4781
3667
|
end
|
4782
3668
|
end
|
4783
3669
|
|
4784
|
-
|
4785
|
-
sig { params(request: T.nilable(Models::Operations::
|
4786
|
-
def
|
4787
|
-
#
|
3670
|
+
|
3671
|
+
sig { params(request: T.nilable(Models::Operations::LmsListAssignmentsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListAssignmentsResponse) }
|
3672
|
+
def list_assignments(request, retries = nil, timeout_ms = nil)
|
3673
|
+
# list_assignments - List Assignments
|
4788
3674
|
url, params = @sdk_configuration.get_server_details
|
4789
3675
|
base_url = Utils.template_url(url, params)
|
4790
|
-
url = "#{base_url}/unified/lms/
|
3676
|
+
url = "#{base_url}/unified/lms/assignments"
|
4791
3677
|
headers = Utils.get_headers(request)
|
4792
|
-
query_params = Utils.get_query_params(Models::Operations::
|
3678
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListAssignmentsRequest, request)
|
4793
3679
|
headers['Accept'] = 'application/json'
|
4794
3680
|
headers['user-agent'] = @sdk_configuration.user_agent
|
4795
3681
|
retries ||= @sdk_configuration.retry_config
|
@@ -4817,7 +3703,7 @@ module StackOne
|
|
4817
3703
|
hook_ctx = SDKHooks::HookContext.new(
|
4818
3704
|
base_url: base_url,
|
4819
3705
|
oauth2_scopes: [],
|
4820
|
-
operation_id: '
|
3706
|
+
operation_id: 'lms_list_assignments',
|
4821
3707
|
security_source: @sdk_configuration.security_source
|
4822
3708
|
)
|
4823
3709
|
|
@@ -4874,12 +3760,12 @@ module StackOne
|
|
4874
3760
|
),
|
4875
3761
|
response: http_response
|
4876
3762
|
)
|
4877
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
4878
|
-
response = Models::Operations::
|
3763
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::AssignmentsPaginated)
|
3764
|
+
response = Models::Operations::LmsListAssignmentsResponse.new(
|
4879
3765
|
status_code: http_response.status,
|
4880
3766
|
content_type: content_type,
|
4881
3767
|
raw_response: http_response,
|
4882
|
-
|
3768
|
+
assignments_paginated: obj
|
4883
3769
|
)
|
4884
3770
|
|
4885
3771
|
return response
|
@@ -5053,14 +3939,14 @@ module StackOne
|
|
5053
3939
|
end
|
5054
3940
|
|
5055
3941
|
|
5056
|
-
sig { params(request: T.nilable(Models::Operations::
|
5057
|
-
def
|
5058
|
-
#
|
3942
|
+
sig { params(request: T.nilable(Models::Operations::LmsListCategoriesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListCategoriesResponse) }
|
3943
|
+
def list_categories(request, retries = nil, timeout_ms = nil)
|
3944
|
+
# list_categories - List Categories
|
5059
3945
|
url, params = @sdk_configuration.get_server_details
|
5060
3946
|
base_url = Utils.template_url(url, params)
|
5061
|
-
url = "#{base_url}/unified/lms/
|
3947
|
+
url = "#{base_url}/unified/lms/categories"
|
5062
3948
|
headers = Utils.get_headers(request)
|
5063
|
-
query_params = Utils.get_query_params(Models::Operations::
|
3949
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListCategoriesRequest, request)
|
5064
3950
|
headers['Accept'] = 'application/json'
|
5065
3951
|
headers['user-agent'] = @sdk_configuration.user_agent
|
5066
3952
|
retries ||= @sdk_configuration.retry_config
|
@@ -5088,7 +3974,7 @@ module StackOne
|
|
5088
3974
|
hook_ctx = SDKHooks::HookContext.new(
|
5089
3975
|
base_url: base_url,
|
5090
3976
|
oauth2_scopes: [],
|
5091
|
-
operation_id: '
|
3977
|
+
operation_id: 'lms_list_categories',
|
5092
3978
|
security_source: @sdk_configuration.security_source
|
5093
3979
|
)
|
5094
3980
|
|
@@ -5145,12 +4031,12 @@ module StackOne
|
|
5145
4031
|
),
|
5146
4032
|
response: http_response
|
5147
4033
|
)
|
5148
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
5149
|
-
response = Models::Operations::
|
4034
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CategoriesPaginated)
|
4035
|
+
response = Models::Operations::LmsListCategoriesResponse.new(
|
5150
4036
|
status_code: http_response.status,
|
5151
4037
|
content_type: content_type,
|
5152
4038
|
raw_response: http_response,
|
5153
|
-
|
4039
|
+
categories_paginated: obj
|
5154
4040
|
)
|
5155
4041
|
|
5156
4042
|
return response
|
@@ -5324,14 +4210,14 @@ module StackOne
|
|
5324
4210
|
end
|
5325
4211
|
|
5326
4212
|
|
5327
|
-
sig { params(request: T.nilable(Models::Operations::
|
5328
|
-
def
|
5329
|
-
#
|
4213
|
+
sig { params(request: T.nilable(Models::Operations::LmsListCompletionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListCompletionsResponse) }
|
4214
|
+
def list_completions(request, retries = nil, timeout_ms = nil)
|
4215
|
+
# list_completions - List Completions
|
5330
4216
|
url, params = @sdk_configuration.get_server_details
|
5331
4217
|
base_url = Utils.template_url(url, params)
|
5332
|
-
url = "#{base_url}/unified/lms/
|
4218
|
+
url = "#{base_url}/unified/lms/completions"
|
5333
4219
|
headers = Utils.get_headers(request)
|
5334
|
-
query_params = Utils.get_query_params(Models::Operations::
|
4220
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListCompletionsRequest, request)
|
5335
4221
|
headers['Accept'] = 'application/json'
|
5336
4222
|
headers['user-agent'] = @sdk_configuration.user_agent
|
5337
4223
|
retries ||= @sdk_configuration.retry_config
|
@@ -5359,7 +4245,7 @@ module StackOne
|
|
5359
4245
|
hook_ctx = SDKHooks::HookContext.new(
|
5360
4246
|
base_url: base_url,
|
5361
4247
|
oauth2_scopes: [],
|
5362
|
-
operation_id: '
|
4248
|
+
operation_id: 'lms_list_completions',
|
5363
4249
|
security_source: @sdk_configuration.security_source
|
5364
4250
|
)
|
5365
4251
|
|
@@ -5416,12 +4302,12 @@ module StackOne
|
|
5416
4302
|
),
|
5417
4303
|
response: http_response
|
5418
4304
|
)
|
5419
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
5420
|
-
response = Models::Operations::
|
4305
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CompletionsPaginated)
|
4306
|
+
response = Models::Operations::LmsListCompletionsResponse.new(
|
5421
4307
|
status_code: http_response.status,
|
5422
4308
|
content_type: content_type,
|
5423
4309
|
raw_response: http_response,
|
5424
|
-
|
4310
|
+
completions_paginated: obj
|
5425
4311
|
)
|
5426
4312
|
|
5427
4313
|
return response
|
@@ -5595,14 +4481,14 @@ module StackOne
|
|
5595
4481
|
end
|
5596
4482
|
|
5597
4483
|
|
5598
|
-
sig { params(request: T.nilable(Models::Operations::
|
5599
|
-
def
|
5600
|
-
#
|
4484
|
+
sig { params(request: T.nilable(Models::Operations::LmsListContentRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListContentResponse) }
|
4485
|
+
def list_content(request, retries = nil, timeout_ms = nil)
|
4486
|
+
# list_content - List Content
|
5601
4487
|
url, params = @sdk_configuration.get_server_details
|
5602
4488
|
base_url = Utils.template_url(url, params)
|
5603
|
-
url = "#{base_url}/unified/lms/
|
4489
|
+
url = "#{base_url}/unified/lms/content"
|
5604
4490
|
headers = Utils.get_headers(request)
|
5605
|
-
query_params = Utils.get_query_params(Models::Operations::
|
4491
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListContentRequest, request)
|
5606
4492
|
headers['Accept'] = 'application/json'
|
5607
4493
|
headers['user-agent'] = @sdk_configuration.user_agent
|
5608
4494
|
retries ||= @sdk_configuration.retry_config
|
@@ -5630,7 +4516,7 @@ module StackOne
|
|
5630
4516
|
hook_ctx = SDKHooks::HookContext.new(
|
5631
4517
|
base_url: base_url,
|
5632
4518
|
oauth2_scopes: [],
|
5633
|
-
operation_id: '
|
4519
|
+
operation_id: 'lms_list_content',
|
5634
4520
|
security_source: @sdk_configuration.security_source
|
5635
4521
|
)
|
5636
4522
|
|
@@ -5687,12 +4573,12 @@ module StackOne
|
|
5687
4573
|
),
|
5688
4574
|
response: http_response
|
5689
4575
|
)
|
5690
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
5691
|
-
response = Models::Operations::
|
4576
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::ContentPaginated)
|
4577
|
+
response = Models::Operations::LmsListContentResponse.new(
|
5692
4578
|
status_code: http_response.status,
|
5693
4579
|
content_type: content_type,
|
5694
4580
|
raw_response: http_response,
|
5695
|
-
|
4581
|
+
content_paginated: obj
|
5696
4582
|
)
|
5697
4583
|
|
5698
4584
|
return response
|
@@ -5866,19 +4752,14 @@ module StackOne
|
|
5866
4752
|
end
|
5867
4753
|
|
5868
4754
|
|
5869
|
-
sig { params(request: T.nilable(Models::Operations::
|
5870
|
-
def
|
5871
|
-
#
|
4755
|
+
sig { params(request: T.nilable(Models::Operations::LmsListCoursesRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListCoursesResponse) }
|
4756
|
+
def list_courses(request, retries = nil, timeout_ms = nil)
|
4757
|
+
# list_courses - List Courses
|
5872
4758
|
url, params = @sdk_configuration.get_server_details
|
5873
4759
|
base_url = Utils.template_url(url, params)
|
5874
|
-
url =
|
5875
|
-
Models::Operations::LmsListUserAssignmentsRequest,
|
5876
|
-
base_url,
|
5877
|
-
'/unified/lms/users/{id}/assignments',
|
5878
|
-
request
|
5879
|
-
)
|
4760
|
+
url = "#{base_url}/unified/lms/courses"
|
5880
4761
|
headers = Utils.get_headers(request)
|
5881
|
-
query_params = Utils.get_query_params(Models::Operations::
|
4762
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListCoursesRequest, request)
|
5882
4763
|
headers['Accept'] = 'application/json'
|
5883
4764
|
headers['user-agent'] = @sdk_configuration.user_agent
|
5884
4765
|
retries ||= @sdk_configuration.retry_config
|
@@ -5906,7 +4787,7 @@ module StackOne
|
|
5906
4787
|
hook_ctx = SDKHooks::HookContext.new(
|
5907
4788
|
base_url: base_url,
|
5908
4789
|
oauth2_scopes: [],
|
5909
|
-
operation_id: '
|
4790
|
+
operation_id: 'lms_list_courses',
|
5910
4791
|
security_source: @sdk_configuration.security_source
|
5911
4792
|
)
|
5912
4793
|
|
@@ -5963,12 +4844,12 @@ module StackOne
|
|
5963
4844
|
),
|
5964
4845
|
response: http_response
|
5965
4846
|
)
|
5966
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
5967
|
-
response = Models::Operations::
|
4847
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CoursePaginated)
|
4848
|
+
response = Models::Operations::LmsListCoursesResponse.new(
|
5968
4849
|
status_code: http_response.status,
|
5969
4850
|
content_type: content_type,
|
5970
4851
|
raw_response: http_response,
|
5971
|
-
|
4852
|
+
course_paginated: obj
|
5972
4853
|
)
|
5973
4854
|
|
5974
4855
|
return response
|
@@ -6142,19 +5023,14 @@ module StackOne
|
|
6142
5023
|
end
|
6143
5024
|
|
6144
5025
|
|
6145
|
-
sig { params(request: T.nilable(Models::Operations::
|
6146
|
-
def
|
6147
|
-
#
|
5026
|
+
sig { params(request: T.nilable(Models::Operations::LmsListSkillsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListSkillsResponse) }
|
5027
|
+
def list_skills(request, retries = nil, timeout_ms = nil)
|
5028
|
+
# list_skills - List Skills
|
6148
5029
|
url, params = @sdk_configuration.get_server_details
|
6149
5030
|
base_url = Utils.template_url(url, params)
|
6150
|
-
url =
|
6151
|
-
Models::Operations::LmsListUserCompletionsRequest,
|
6152
|
-
base_url,
|
6153
|
-
'/unified/lms/users/{id}/completions',
|
6154
|
-
request
|
6155
|
-
)
|
5031
|
+
url = "#{base_url}/unified/lms/skills"
|
6156
5032
|
headers = Utils.get_headers(request)
|
6157
|
-
query_params = Utils.get_query_params(Models::Operations::
|
5033
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListSkillsRequest, request)
|
6158
5034
|
headers['Accept'] = 'application/json'
|
6159
5035
|
headers['user-agent'] = @sdk_configuration.user_agent
|
6160
5036
|
retries ||= @sdk_configuration.retry_config
|
@@ -6182,7 +5058,7 @@ module StackOne
|
|
6182
5058
|
hook_ctx = SDKHooks::HookContext.new(
|
6183
5059
|
base_url: base_url,
|
6184
5060
|
oauth2_scopes: [],
|
6185
|
-
operation_id: '
|
5061
|
+
operation_id: 'lms_list_skills',
|
6186
5062
|
security_source: @sdk_configuration.security_source
|
6187
5063
|
)
|
6188
5064
|
|
@@ -6239,12 +5115,12 @@ module StackOne
|
|
6239
5115
|
),
|
6240
5116
|
response: http_response
|
6241
5117
|
)
|
6242
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
6243
|
-
response = Models::Operations::
|
5118
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::SkillsPaginated)
|
5119
|
+
response = Models::Operations::LmsListSkillsResponse.new(
|
6244
5120
|
status_code: http_response.status,
|
6245
5121
|
content_type: content_type,
|
6246
5122
|
raw_response: http_response,
|
6247
|
-
|
5123
|
+
skills_paginated: obj
|
6248
5124
|
)
|
6249
5125
|
|
6250
5126
|
return response
|
@@ -6418,14 +5294,19 @@ module StackOne
|
|
6418
5294
|
end
|
6419
5295
|
|
6420
5296
|
|
6421
|
-
sig { params(request: T.nilable(Models::Operations::
|
6422
|
-
def
|
6423
|
-
#
|
5297
|
+
sig { params(request: T.nilable(Models::Operations::LmsListUserAssignmentsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListUserAssignmentsResponse) }
|
5298
|
+
def list_user_assignments(request, retries = nil, timeout_ms = nil)
|
5299
|
+
# list_user_assignments - List User Assignments
|
6424
5300
|
url, params = @sdk_configuration.get_server_details
|
6425
5301
|
base_url = Utils.template_url(url, params)
|
6426
|
-
url =
|
5302
|
+
url = Utils.generate_url(
|
5303
|
+
Models::Operations::LmsListUserAssignmentsRequest,
|
5304
|
+
base_url,
|
5305
|
+
'/unified/lms/users/{id}/assignments',
|
5306
|
+
request
|
5307
|
+
)
|
6427
5308
|
headers = Utils.get_headers(request)
|
6428
|
-
query_params = Utils.get_query_params(Models::Operations::
|
5309
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListUserAssignmentsRequest, request)
|
6429
5310
|
headers['Accept'] = 'application/json'
|
6430
5311
|
headers['user-agent'] = @sdk_configuration.user_agent
|
6431
5312
|
retries ||= @sdk_configuration.retry_config
|
@@ -6453,7 +5334,7 @@ module StackOne
|
|
6453
5334
|
hook_ctx = SDKHooks::HookContext.new(
|
6454
5335
|
base_url: base_url,
|
6455
5336
|
oauth2_scopes: [],
|
6456
|
-
operation_id: '
|
5337
|
+
operation_id: 'lms_list_user_assignments',
|
6457
5338
|
security_source: @sdk_configuration.security_source
|
6458
5339
|
)
|
6459
5340
|
|
@@ -6510,12 +5391,12 @@ module StackOne
|
|
6510
5391
|
),
|
6511
5392
|
response: http_response
|
6512
5393
|
)
|
6513
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
6514
|
-
response = Models::Operations::
|
5394
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::AssignmentsPaginated)
|
5395
|
+
response = Models::Operations::LmsListUserAssignmentsResponse.new(
|
6515
5396
|
status_code: http_response.status,
|
6516
5397
|
content_type: content_type,
|
6517
5398
|
raw_response: http_response,
|
6518
|
-
|
5399
|
+
assignments_paginated: obj
|
6519
5400
|
)
|
6520
5401
|
|
6521
5402
|
return response
|
@@ -6689,35 +5570,19 @@ module StackOne
|
|
6689
5570
|
end
|
6690
5571
|
|
6691
5572
|
|
6692
|
-
sig { params(
|
6693
|
-
def
|
6694
|
-
#
|
6695
|
-
request = Models::Operations::LmsUpdateCollectionRequest.new(
|
6696
|
-
|
6697
|
-
lms_create_collection_request_dto: lms_create_collection_request_dto,
|
6698
|
-
id: id,
|
6699
|
-
x_account_id: x_account_id
|
6700
|
-
)
|
5573
|
+
sig { params(request: T.nilable(Models::Operations::LmsListUserCompletionsRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListUserCompletionsResponse) }
|
5574
|
+
def list_user_completions(request, retries = nil, timeout_ms = nil)
|
5575
|
+
# list_user_completions - List User Completions
|
6701
5576
|
url, params = @sdk_configuration.get_server_details
|
6702
5577
|
base_url = Utils.template_url(url, params)
|
6703
5578
|
url = Utils.generate_url(
|
6704
|
-
Models::Operations::
|
5579
|
+
Models::Operations::LmsListUserCompletionsRequest,
|
6705
5580
|
base_url,
|
6706
|
-
'/unified/lms/
|
5581
|
+
'/unified/lms/users/{id}/completions',
|
6707
5582
|
request
|
6708
5583
|
)
|
6709
5584
|
headers = Utils.get_headers(request)
|
6710
|
-
|
6711
|
-
headers['content-type'] = req_content_type
|
6712
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
6713
|
-
|
6714
|
-
if form
|
6715
|
-
body = Utils.encode_form(form)
|
6716
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
6717
|
-
body = URI.encode_www_form(data)
|
6718
|
-
else
|
6719
|
-
body = data
|
6720
|
-
end
|
5585
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListUserCompletionsRequest, request)
|
6721
5586
|
headers['Accept'] = 'application/json'
|
6722
5587
|
headers['user-agent'] = @sdk_configuration.user_agent
|
6723
5588
|
retries ||= @sdk_configuration.retry_config
|
@@ -6745,7 +5610,7 @@ module StackOne
|
|
6745
5610
|
hook_ctx = SDKHooks::HookContext.new(
|
6746
5611
|
base_url: base_url,
|
6747
5612
|
oauth2_scopes: [],
|
6748
|
-
operation_id: '
|
5613
|
+
operation_id: 'lms_list_user_completions',
|
6749
5614
|
security_source: @sdk_configuration.security_source
|
6750
5615
|
)
|
6751
5616
|
|
@@ -6754,10 +5619,10 @@ module StackOne
|
|
6754
5619
|
|
6755
5620
|
|
6756
5621
|
begin
|
6757
|
-
http_response = connection.
|
6758
|
-
req.body = body
|
5622
|
+
http_response = connection.get(url) do |req|
|
6759
5623
|
req.headers.merge!(headers)
|
6760
5624
|
req.options.timeout = timeout unless timeout.nil?
|
5625
|
+
req.params = query_params
|
6761
5626
|
Utils.configure_request_security(req, security)
|
6762
5627
|
|
6763
5628
|
@sdk_configuration.hooks.before_request(
|
@@ -6794,7 +5659,7 @@ module StackOne
|
|
6794
5659
|
end
|
6795
5660
|
|
6796
5661
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
6797
|
-
if Utils.match_status_code(http_response.status, ['
|
5662
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
6798
5663
|
if Utils.match_content_type(content_type, 'application/json')
|
6799
5664
|
http_response = @sdk_configuration.hooks.after_success(
|
6800
5665
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
@@ -6802,12 +5667,12 @@ module StackOne
|
|
6802
5667
|
),
|
6803
5668
|
response: http_response
|
6804
5669
|
)
|
6805
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
6806
|
-
response = Models::Operations::
|
5670
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::CompletionsPaginated)
|
5671
|
+
response = Models::Operations::LmsListUserCompletionsResponse.new(
|
6807
5672
|
status_code: http_response.status,
|
6808
5673
|
content_type: content_type,
|
6809
5674
|
raw_response: http_response,
|
6810
|
-
|
5675
|
+
completions_paginated: obj
|
6811
5676
|
)
|
6812
5677
|
|
6813
5678
|
return response
|
@@ -6981,35 +5846,14 @@ module StackOne
|
|
6981
5846
|
end
|
6982
5847
|
|
6983
5848
|
|
6984
|
-
sig { params(
|
6985
|
-
def
|
6986
|
-
#
|
6987
|
-
request = Models::Operations::LmsUpdateContentRequest.new(
|
6988
|
-
|
6989
|
-
lms_create_content_request_dto: lms_create_content_request_dto,
|
6990
|
-
id: id,
|
6991
|
-
x_account_id: x_account_id
|
6992
|
-
)
|
5849
|
+
sig { params(request: T.nilable(Models::Operations::LmsListUsersRequest), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsListUsersResponse) }
|
5850
|
+
def list_users(request, retries = nil, timeout_ms = nil)
|
5851
|
+
# list_users - List Users
|
6993
5852
|
url, params = @sdk_configuration.get_server_details
|
6994
5853
|
base_url = Utils.template_url(url, params)
|
6995
|
-
url =
|
6996
|
-
Models::Operations::LmsUpdateContentRequest,
|
6997
|
-
base_url,
|
6998
|
-
'/unified/lms/content/{id}',
|
6999
|
-
request
|
7000
|
-
)
|
5854
|
+
url = "#{base_url}/unified/lms/users"
|
7001
5855
|
headers = Utils.get_headers(request)
|
7002
|
-
|
7003
|
-
headers['content-type'] = req_content_type
|
7004
|
-
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
7005
|
-
|
7006
|
-
if form
|
7007
|
-
body = Utils.encode_form(form)
|
7008
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
7009
|
-
body = URI.encode_www_form(data)
|
7010
|
-
else
|
7011
|
-
body = data
|
7012
|
-
end
|
5856
|
+
query_params = Utils.get_query_params(Models::Operations::LmsListUsersRequest, request)
|
7013
5857
|
headers['Accept'] = 'application/json'
|
7014
5858
|
headers['user-agent'] = @sdk_configuration.user_agent
|
7015
5859
|
retries ||= @sdk_configuration.retry_config
|
@@ -7037,7 +5881,7 @@ module StackOne
|
|
7037
5881
|
hook_ctx = SDKHooks::HookContext.new(
|
7038
5882
|
base_url: base_url,
|
7039
5883
|
oauth2_scopes: [],
|
7040
|
-
operation_id: '
|
5884
|
+
operation_id: 'lms_list_users',
|
7041
5885
|
security_source: @sdk_configuration.security_source
|
7042
5886
|
)
|
7043
5887
|
|
@@ -7046,10 +5890,10 @@ module StackOne
|
|
7046
5890
|
|
7047
5891
|
|
7048
5892
|
begin
|
7049
|
-
http_response = connection.
|
7050
|
-
req.body = body
|
5893
|
+
http_response = connection.get(url) do |req|
|
7051
5894
|
req.headers.merge!(headers)
|
7052
5895
|
req.options.timeout = timeout unless timeout.nil?
|
5896
|
+
req.params = query_params
|
7053
5897
|
Utils.configure_request_security(req, security)
|
7054
5898
|
|
7055
5899
|
@sdk_configuration.hooks.before_request(
|
@@ -7086,7 +5930,7 @@ module StackOne
|
|
7086
5930
|
end
|
7087
5931
|
|
7088
5932
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
7089
|
-
if Utils.match_status_code(http_response.status, ['
|
5933
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
7090
5934
|
if Utils.match_content_type(content_type, 'application/json')
|
7091
5935
|
http_response = @sdk_configuration.hooks.after_success(
|
7092
5936
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
@@ -7094,12 +5938,12 @@ module StackOne
|
|
7094
5938
|
),
|
7095
5939
|
response: http_response
|
7096
5940
|
)
|
7097
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
7098
|
-
response = Models::Operations::
|
5941
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::UsersPaginated)
|
5942
|
+
response = Models::Operations::LmsListUsersResponse.new(
|
7099
5943
|
status_code: http_response.status,
|
7100
5944
|
content_type: content_type,
|
7101
5945
|
raw_response: http_response,
|
7102
|
-
|
5946
|
+
users_paginated: obj
|
7103
5947
|
)
|
7104
5948
|
|
7105
5949
|
return response
|
@@ -7273,19 +6117,25 @@ module StackOne
|
|
7273
6117
|
end
|
7274
6118
|
|
7275
6119
|
|
7276
|
-
sig { params(
|
7277
|
-
def
|
7278
|
-
#
|
7279
|
-
request = Models::Operations::
|
6120
|
+
sig { params(lms_create_content_request_dto: Models::Shared::LmsCreateContentRequestDto, id: ::String, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsUpdateContentResponse) }
|
6121
|
+
def update_content(lms_create_content_request_dto, id, x_account_id, retries = nil, timeout_ms = nil)
|
6122
|
+
# update_content - Update Content
|
6123
|
+
request = Models::Operations::LmsUpdateContentRequest.new(
|
7280
6124
|
|
7281
|
-
|
6125
|
+
lms_create_content_request_dto: lms_create_content_request_dto,
|
6126
|
+
id: id,
|
7282
6127
|
x_account_id: x_account_id
|
7283
6128
|
)
|
7284
6129
|
url, params = @sdk_configuration.get_server_details
|
7285
6130
|
base_url = Utils.template_url(url, params)
|
7286
|
-
url =
|
6131
|
+
url = Utils.generate_url(
|
6132
|
+
Models::Operations::LmsUpdateContentRequest,
|
6133
|
+
base_url,
|
6134
|
+
'/unified/lms/content/{id}',
|
6135
|
+
request
|
6136
|
+
)
|
7287
6137
|
headers = Utils.get_headers(request)
|
7288
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :
|
6138
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :lms_create_content_request_dto, :json)
|
7289
6139
|
headers['content-type'] = req_content_type
|
7290
6140
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
7291
6141
|
|
@@ -7323,7 +6173,7 @@ module StackOne
|
|
7323
6173
|
hook_ctx = SDKHooks::HookContext.new(
|
7324
6174
|
base_url: base_url,
|
7325
6175
|
oauth2_scopes: [],
|
7326
|
-
operation_id: '
|
6176
|
+
operation_id: 'lms_update_content',
|
7327
6177
|
security_source: @sdk_configuration.security_source
|
7328
6178
|
)
|
7329
6179
|
|
@@ -7332,7 +6182,7 @@ module StackOne
|
|
7332
6182
|
|
7333
6183
|
|
7334
6184
|
begin
|
7335
|
-
http_response = connection.
|
6185
|
+
http_response = connection.patch(url) do |req|
|
7336
6186
|
req.body = body
|
7337
6187
|
req.headers.merge!(headers)
|
7338
6188
|
req.options.timeout = timeout unless timeout.nil?
|
@@ -7380,12 +6230,12 @@ module StackOne
|
|
7380
6230
|
),
|
7381
6231
|
response: http_response
|
7382
6232
|
)
|
7383
|
-
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::
|
7384
|
-
response = Models::Operations::
|
6233
|
+
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::UpdateResult)
|
6234
|
+
response = Models::Operations::LmsUpdateContentResponse.new(
|
7385
6235
|
status_code: http_response.status,
|
7386
6236
|
content_type: content_type,
|
7387
6237
|
raw_response: http_response,
|
7388
|
-
|
6238
|
+
update_result: obj
|
7389
6239
|
)
|
7390
6240
|
|
7391
6241
|
return response
|
@@ -7559,19 +6409,19 @@ module StackOne
|
|
7559
6409
|
end
|
7560
6410
|
|
7561
6411
|
|
7562
|
-
sig { params(
|
7563
|
-
def
|
7564
|
-
#
|
7565
|
-
request = Models::Operations::
|
6412
|
+
sig { params(lms_upsert_content_request_dto: Models::Shared::LmsUpsertContentRequestDto, x_account_id: ::String, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(Models::Operations::LmsUpsertContentResponse) }
|
6413
|
+
def upsert_content(lms_upsert_content_request_dto, x_account_id, retries = nil, timeout_ms = nil)
|
6414
|
+
# upsert_content - Upsert Content
|
6415
|
+
request = Models::Operations::LmsUpsertContentRequest.new(
|
7566
6416
|
|
7567
|
-
|
6417
|
+
lms_upsert_content_request_dto: lms_upsert_content_request_dto,
|
7568
6418
|
x_account_id: x_account_id
|
7569
6419
|
)
|
7570
6420
|
url, params = @sdk_configuration.get_server_details
|
7571
6421
|
base_url = Utils.template_url(url, params)
|
7572
|
-
url = "#{base_url}/unified/lms/
|
6422
|
+
url = "#{base_url}/unified/lms/content"
|
7573
6423
|
headers = Utils.get_headers(request)
|
7574
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :
|
6424
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :lms_upsert_content_request_dto, :json)
|
7575
6425
|
headers['content-type'] = req_content_type
|
7576
6426
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
7577
6427
|
|
@@ -7609,7 +6459,7 @@ module StackOne
|
|
7609
6459
|
hook_ctx = SDKHooks::HookContext.new(
|
7610
6460
|
base_url: base_url,
|
7611
6461
|
oauth2_scopes: [],
|
7612
|
-
operation_id: '
|
6462
|
+
operation_id: 'lms_upsert_content',
|
7613
6463
|
security_source: @sdk_configuration.security_source
|
7614
6464
|
)
|
7615
6465
|
|
@@ -7667,7 +6517,7 @@ module StackOne
|
|
7667
6517
|
response: http_response
|
7668
6518
|
)
|
7669
6519
|
obj = Crystalline.unmarshal_json(JSON.parse(http_response.env.response_body), Models::Shared::UpsertResult)
|
7670
|
-
response = Models::Operations::
|
6520
|
+
response = Models::Operations::LmsUpsertContentResponse.new(
|
7671
6521
|
status_code: http_response.status,
|
7672
6522
|
content_type: content_type,
|
7673
6523
|
raw_response: http_response,
|