strongmind-platform-sdk 3.26.18 → 3.26.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e787da55ed9d3e05e9916cd46580af4b19090b38016578cc071e72f51c6e78fb
4
- data.tar.gz: 1be74a7a9e224dc83c1f25edcf220d7d0b85e7881c4c9d8d08d9c58a1261c1e6
3
+ metadata.gz: 4a5f98f47523575eb0e450bc04688676977448114a7d59abfb110f4a8f2d5a11
4
+ data.tar.gz: 114beae04bc91739a562f527680458ec0930bb6cbf272e7c2f84ec95517fa86d
5
5
  SHA512:
6
- metadata.gz: 3111dc1ef21c0881a8e4ddfa62e9dd901f676e073c3ea067c5cf156e11a06551ad137ff158bc44c776c7b753d30265db887fa3cd44534b1300595bf8be9b2dd7
7
- data.tar.gz: 7d40c13fc85a7dacf0a6b91ce01f074c9a18e6b4cc86be7446e8bd2e548c8ede6847d317e846cef3be2f812ef408a3fefc7ff18ed5013ca5f1deec3734aa2afa
6
+ metadata.gz: d4a35a64ae9f49f12c555f2bcbd918ebcdf03630a2b02eafd6c8c65c809283d00c2b9988de202cbef54bc0fa139a4894f6f9af8b8642fb832c50849436c2bb90
7
+ data.tar.gz: 2ca5b0723281e9a84a8135baca5a8fe4f8549a1075731953cf9e8138c00f6719082f8c6509564b9c8c807f5fffcc312fbeb6775e8e891b2640153c3dd06ee6e3
@@ -471,6 +471,58 @@ module PlatformSdk
471
471
  end
472
472
  end
473
473
 
474
+ # @param course_id [Integer]
475
+ # @param body [Hash]
476
+ # @option body [String] 'module[name]' The name of the module
477
+ # @option body [Integer] 'module[position]' The position of this module in the course (1-based)
478
+ # @return [Hash]
479
+ def create_module(course_id:, body:)
480
+ uri = "/api/v1/courses/#{course_id}/modules"
481
+ response = @connection.post(uri) do |req|
482
+ req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
483
+ req.body = body
484
+ end
485
+ handle_rate_limiting response
486
+ result = MultiJson.load response.body, symbolize_keys: true
487
+ if success?(response.status)
488
+ result
489
+ else
490
+ error_messages = String.new
491
+ result[:errors]&.each do |error|
492
+ error_messages << "#{error[:message]} "
493
+ end
494
+ raise "Error creating module: #{error_messages}"
495
+ end
496
+ end
497
+
498
+ # @param course_id [Integer]
499
+ # @param module_id [Integer]
500
+ # @param body [Hash]
501
+ # @option body [String] 'module[name]' The name of the module
502
+ # @option body [Boolean] 'module[published]' Whether the module is published
503
+ # @option body [String] 'module[unlock_at]' When to unlock the module
504
+ # @option body [Boolean] 'module[require_sequential_progress]' Require sequential progress
505
+ # @option body [Boolean] 'module[publish_final_grade]' Publish final grade
506
+ # @return [Hash]
507
+ def update_module(course_id:, module_id:, body:)
508
+ uri = "/api/v1/courses/#{course_id}/modules/#{module_id}"
509
+ response = @connection.put(uri) do |req|
510
+ req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
511
+ req.body = body
512
+ end
513
+ handle_rate_limiting response
514
+ result = MultiJson.load response.body, symbolize_keys: true
515
+ if success?(response.status)
516
+ result
517
+ else
518
+ error_messages = String.new
519
+ result[:errors]&.each do |error|
520
+ error_messages << "#{error[:message]} "
521
+ end
522
+ raise "Error updating module: #{error_messages}"
523
+ end
524
+ end
525
+
474
526
  # @param course_id [Integer]
475
527
  # @param module_id [Integer]
476
528
  # @param body [Hash]
@@ -3,7 +3,7 @@
3
3
  module PlatformSdk
4
4
  MAJOR = 3
5
5
  MINOR = 26
6
- PATCH = 18
6
+ PATCH = 19
7
7
 
8
8
  VERSION = "#{PlatformSdk::MAJOR}.#{PlatformSdk::MINOR}.#{PlatformSdk::PATCH}"
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-platform-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.26.18
4
+ version: 3.26.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-10 00:00:00.000000000 Z
11
+ date: 2025-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday