strongmind-platform-sdk 3.19.40 → 3.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee2be3c848418419cea2a1d187bf078b190bd75e1d360b6b4aa43e4fc89bb108
4
- data.tar.gz: 849f7708af58cdb82750110475af64de26669b8751c234e097f10612e6e11538
3
+ metadata.gz: ef2c1f39c7709840909cc6c0f5e964b84af95f4142eedd486e1369d8a76c04f9
4
+ data.tar.gz: 43c052396585ea17ec2e5c699aae6591b1eca551e309742ce6a65ba427165f1a
5
5
  SHA512:
6
- metadata.gz: e1e74f391bc54c3b3c81349a26d1f87e55f785f8415c5abf0345446ab8305f36152732ab9e9f308c9a28ec7cf37adec1592bd15d49c79ac24c53265e2052d78d
7
- data.tar.gz: f73619d9d0145bb4e6565a874109134ed478e1644171df76bc2077eeab65f9e3ebab0c179133087a69caa009d3b0c20aa4cf59cd264f61f88601f8b72c711f7e
6
+ metadata.gz: d976bbb6744a71ffc58a0a176721fd3c6512b03cf99512b04d3b978c4bd77ad660f8ffaded388805709a41c16754909b46198ca80de306572b0f868d5b99b731
7
+ data.tar.gz: 9b4e005717bea48f34f0f1beb0b2efb9a5dcfea7f8017c22547494d6108c03780178aa86d15639d44df60a6411e5f724308612fcf48a458f487020198c8f76d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.19.0)
4
+ strongmind-platform-sdk (3.20.0)
5
5
  activesupport (~> 7.1)
6
6
  asset_sync
7
7
  aws-sdk-cloudwatch
@@ -489,6 +489,24 @@ module PlatformSdk
489
489
  end
490
490
  end
491
491
 
492
+ def retrieve_discussion_topic(course_id:, topic_id:)
493
+ uri = "/api/v1/courses/#{course_id}/discussion_topics/#{topic_id}"
494
+ response = @connection.get(uri) do |req|
495
+ req.headers['Content-Type'] = 'application/json'
496
+ end
497
+ handle_rate_limiting response
498
+ result = MultiJson.load response.body, symbolize_keys: true
499
+ if success?(response.status)
500
+ result
501
+ else
502
+ error_messages = String.new
503
+ result[:errors]&.each do |error|
504
+ error_messages << "#{error[:message]} "
505
+ end
506
+ raise "Error retrieving discussion topic: #{error_messages}"
507
+ end
508
+ end
509
+
492
510
  private
493
511
 
494
512
  # @param headers [Faraday::Utils::Headers]
@@ -15,6 +15,19 @@ module PlatformSdk
15
15
  response.body
16
16
  end
17
17
 
18
+ def teacher_enrollments(external_course_id = nil)
19
+ resource_path = '/api/teacher_enrollments'
20
+ resource_path += "?external_course_id=#{external_course_id}" if external_course_id
21
+ response = get(resource_path)
22
+ response.body
23
+ end
24
+
25
+ def create_message(message_params: {})
26
+ resource_path = '/api/messages'
27
+ response = post(resource_path, message_params)
28
+ response.body
29
+ end
30
+
18
31
  private
19
32
 
20
33
  def build_connection
@@ -28,8 +41,8 @@ module PlatformSdk
28
41
 
29
42
  def default_headers
30
43
  {
31
- "Content-Type" => "application/json",
32
- "Authorization" => "Bearer #{access_token}"
44
+ 'Content-Type' => 'application/json',
45
+ 'Authorization' => "Bearer #{access_token}"
33
46
  }
34
47
  end
35
48
 
@@ -37,6 +50,10 @@ module PlatformSdk
37
50
  @conn.get(path, params)
38
51
  end
39
52
 
53
+ def post(path, params = {})
54
+ @conn.post(path, params.to_json)
55
+ end
56
+
40
57
  end
41
58
  end
42
59
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module PlatformSdk
4
4
  MAJOR = 3
5
- MINOR = 19
6
- PATCH = 40
5
+ MINOR = 20
6
+ PATCH = 1
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.19.40
4
+ version: 3.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-27 00:00:00.000000000 Z
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday