easyllama-client 0.2.0 → 0.2.2

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: e1ffbbb8a0986c23d5f09b3d8550629f028d2d97589ff462f134c5a4368fd8d8
4
- data.tar.gz: 7be45f553af3491b6b5c15b7da1caaac5893259d3a8972b392e9aa2a1f445de1
3
+ metadata.gz: e5d38f0ff660ed2744a84dbfd7397e8c1449f9ba783900bd5c87f8c783274712
4
+ data.tar.gz: 49685a461195dad89aa66713b1f8e6e9914fdc643001ffcf83546cd95e35d1e7
5
5
  SHA512:
6
- metadata.gz: 629a934fa5ccfb8a8dad78ac51501844d3283c8ef670be906964e5aef6816594b9c2f468c55c92bdd6d56a2d47c67a42280d5d829ad839008898e1c0fde2351f
7
- data.tar.gz: 7e8e4ecdc91a01704c4636a6e52f9331d7e5a902480441d7c435658cd75efa6d0acde4c1fe08dbf93737804f035f4520d8f490cc3cb7956f0a3f71fe135fceec
6
+ metadata.gz: 7ef08ef8712c7a293b89b7b5042d1e7724b8735030f70d0c11a980efcb546b344b6e6ff74d4a5a48a2faaa9e1cfe9a11a0030f6f828b3c3d675f7edd3e4d82a8
7
+ data.tar.gz: 5b40765a317c5d28a6f3e7803a65f3a0594ca07613ab35fd0d5bbd410b60fc244d24d552f4999fe0841017bf1a13b09e6925fbb7698768e55816e23de6afdc1d
@@ -2,6 +2,6 @@
2
2
 
3
3
  module EasyLlama
4
4
  module Client
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.2'
6
6
  end
7
7
  end
@@ -48,7 +48,7 @@ module EasyLlama
48
48
  #
49
49
  # @param training_id [Integer] The ID of the training.
50
50
  # @param learner_id [Integer] The ID of the learner.
51
- # @return [Object] The training assignment details or an error message.
51
+ # @return [Object] The learner training or an error message.
52
52
  def assign_training_to_learner(training_id:, learner_id:)
53
53
  response = send_request(
54
54
  path: "/learners/#{learner_id}/learner_trainings",
@@ -56,13 +56,28 @@ module EasyLlama
56
56
  body: { learner_id:, training_id: }
57
57
  )
58
58
 
59
+ parse_response!(response, 'learner_training')
60
+ end
61
+
62
+ # Sends a DELETE request to unassign a training from a learner.
63
+ #
64
+ # @param learner_training_id [Integer] The ID of the learner training.
65
+ # @param learner_id [Integer] The ID of the learner.
66
+ # @return [Object] An error message or an empty hash.
67
+ def unassign_training_from_learner(learner_training_id:, learner_id:)
68
+ response = send_request(
69
+ path: "/learners/#{learner_id}/learner_trainings/#{learner_training_id}",
70
+ method: :delete,
71
+ body: { learner_id:, learner_training_id: }
72
+ )
73
+
59
74
  parse_response!(response)
60
75
  end
61
76
 
62
77
  # Sends a DELETE request to archive a learner by ID.
63
78
  #
64
79
  # @param id [Integer] The ID of the learner.
65
- # @return [Object] The updated learner or an error message.
80
+ # @return [Object] An error message or an empty hash.
66
81
  def archive(id)
67
82
  response = send_request(path: "/learners/#{id}", method: :delete)
68
83
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyllama-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitalii Kashoid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-17 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json