d2l_sdk 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +43 -0
- data/README.md +112 -107
- data/lib/d2l_sdk/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a6e8ed075f1d0e73100f4d1da16fd39626b49b3
|
4
|
+
data.tar.gz: 7fa70c1917e6c0a4aeb4f9cb853df0e68da0689e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81d1fe998f56240a5af90ab20402589278ddce187048b09c16ce87454550c262e4959b1dd4d5fcec9ce6ab73d0bce65b0aa5fc468e30065866368d65b2121027
|
7
|
+
data.tar.gz: 499ce6508d9320c0c3daeb4f641dee939e30dd41ebf4ff1cb811798227764357016364952e0b28930275b854d56d8e882f14a54bb5d4e4f23db9a05e26580d79
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.5.0)
|
5
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
6
|
+
awesome_print (1.7.0)
|
7
|
+
colorize (0.8.1)
|
8
|
+
domain_name (0.5.20161129)
|
9
|
+
unf (>= 0.0.5, < 1.0.0)
|
10
|
+
http-cookie (1.0.3)
|
11
|
+
domain_name (~> 0.5)
|
12
|
+
json (1.8.3)
|
13
|
+
json-schema (2.7.0)
|
14
|
+
addressable (>= 2.4)
|
15
|
+
mime-types (3.1)
|
16
|
+
mime-types-data (~> 3.2015)
|
17
|
+
mime-types-data (3.2016.0521)
|
18
|
+
netrc (0.11.0)
|
19
|
+
power_assert (0.2.6)
|
20
|
+
public_suffix (2.0.4)
|
21
|
+
rest-client (2.0.0)
|
22
|
+
http-cookie (>= 1.0.2, < 2.0)
|
23
|
+
mime-types (>= 1.16, < 4.0)
|
24
|
+
netrc (~> 0.8)
|
25
|
+
test-unit (3.1.5)
|
26
|
+
power_assert
|
27
|
+
unf (0.1.4)
|
28
|
+
unf_ext
|
29
|
+
unf_ext (0.0.7.2)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
awesome_print
|
36
|
+
colorize
|
37
|
+
json
|
38
|
+
json-schema
|
39
|
+
rest-client
|
40
|
+
test-unit
|
41
|
+
|
42
|
+
BUNDLED WITH
|
43
|
+
1.13.6
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Ruby Valence SDK
|
2
|
-
[![Gem Version](https://badge.fury.io/rb/
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/d2l_sdk.svg)](https://badge.fury.io/rb/d2l_sdk)
|
3
3
|
|
4
|
-
The Ruby Valence
|
4
|
+
The Ruby Valence SDK utilizes a CRUD based API that facilitates HTTP methods coinciding with Brightspace's routing table to perform common CRUD functions.
|
5
5
|
|
6
6
|
You can:
|
7
7
|
- create, get, update, and delete users, courses, semesters, org_units, and course_templates.
|
@@ -9,7 +9,7 @@ You can:
|
|
9
9
|
|
10
10
|
The Valence sdk
|
11
11
|
|
12
|
-
> The Valence
|
12
|
+
> The Valence API is Rest-like, allowing interactions through HTTP with the back-end of a host. Most all of the Learning Platform functions that comprise D2L's Rest-like API are usable through this Ruby SDK implementation.
|
13
13
|
|
14
14
|
While not all functions have been implemented for the Learning Platform of the Valence sdk, all critical CRUD functionalities have been implemented.
|
15
15
|
|
@@ -48,143 +48,147 @@ Ruby Valence sdk can be installed using the following statement at a later date
|
|
48
48
|
$ gem install d2l_sdk
|
49
49
|
```
|
50
50
|
|
51
|
-
Once installed, the config file of the gem must be setup.
|
51
|
+
Once installed, the config file of the gem must be setup. This will be done upon the first use.
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
Of course, if a proper `d2l_config.json` is created within the current directory, the setup will not be required. Here is the format of this file, should you wish to pre-create it:
|
54
|
+
|
55
|
+
```
|
56
|
+
{
|
57
|
+
"hostname": "YOUR HOSTNAME",
|
58
|
+
"user_id": "YOUR USER ID",
|
59
|
+
"user_key": "YOUR USER KEY",
|
60
|
+
"app_id": "YOUR APP ID",
|
61
|
+
"app_key": "YOUR APP KEY"
|
62
|
+
}
|
58
63
|
```
|
59
64
|
|
65
|
+
|
60
66
|
### Usage
|
61
67
|
Complete the installation, require the 'd2l_sdk' library in your ruby file, and use the many functions supported by the api to perform CRUD methods.
|
62
68
|
Example:
|
63
69
|
|
64
70
|
```sh
|
65
71
|
$ irb
|
66
|
-
$
|
72
|
+
$ require "d2l_sdk"
|
67
73
|
$ x = multithreaded_user_search("FirstName", "test", 17) #searches using 17 threads for a user based on 'test' being in the first name.
|
68
74
|
$ get_user_by_user_id(x[0])
|
69
75
|
$ update_user_data(x[0]["Identifier"], x[0].merge!('FirstName'=>"Test2"))
|
70
76
|
```
|
71
77
|
|
72
|
-
One may also simply
|
78
|
+
One may also simply install the gem via `gem install d2l_sdk`. Once this is done, just require it in your script using `require 'd2l_sdk'` and utilize a number of the methods to streamline your app development process for D2L.
|
73
79
|
|
74
|
-
```sh
|
75
|
-
$ git clone -b master git@gitlab.wiu.edu:ajk142/valence_testing.git
|
76
|
-
```
|
77
|
-
Edit the config.rb for your api keys, version, and hostname
|
78
80
|
|
79
|
-
```sh
|
80
|
-
$ rake build
|
81
|
-
$ gem install d2l_sdk pkg/d2l_sdk-[VERSION].gem
|
82
|
-
```
|
83
81
|
Uninstalling the previous version can be done by this command:
|
84
82
|
```sh
|
85
83
|
$ gem uninstall d2l_sdk --version [PREVIOUS-VERSION]
|
86
84
|
```
|
87
85
|
|
86
|
+
or
|
87
|
+
|
88
|
+
```sh
|
89
|
+
$ gem cleanup d2l_sdk
|
90
|
+
```
|
91
|
+
|
88
92
|
|
89
93
|
|
90
94
|
|
91
95
|
### List of Methods
|
92
96
|
|
93
97
|
1. Users
|
94
|
-
* create_user_data(JSON user_data)
|
95
|
-
* get_whoami
|
96
|
-
* get_users(String org_defined_id, String username, String bookmark)
|
97
|
-
* get_user_by_username(String username)
|
98
|
-
* get_users_by_bookmark(String bookmark)
|
99
|
-
* does_user_exist(String username)
|
100
|
-
* multithreaded_user_search(String parameter, String search_string, Int num_of_threads, Boolean regex)
|
101
|
-
* get_user_by_user_id(String user_id)
|
102
|
-
* update_user_data(String user_id, JSON new_data)
|
103
|
-
* delete_user_data(String user_id)
|
98
|
+
* `create_user_data(JSON user_data)`
|
99
|
+
* `get_whoami`
|
100
|
+
* `get_users(String org_defined_id, String username, String bookmark)`
|
101
|
+
* `get_user_by_username(String username)`
|
102
|
+
* `get_users_by_bookmark(String bookmark)`
|
103
|
+
* `does_user_exist(String username)`
|
104
|
+
* `multithreaded_user_search(String parameter, String search_string, Int num_of_threads, Boolean regex)`
|
105
|
+
* `get_user_by_user_id(String user_id)`
|
106
|
+
* `update_user_data(String user_id, JSON new_data)`
|
107
|
+
* `delete_user_data(String user_id)`
|
104
108
|
2. Semesters
|
105
|
-
* create_semester_data(JSON semester_data)
|
106
|
-
* get_all_semesters
|
107
|
-
* get_semester_by_id(String org_unit_id)
|
108
|
-
* add_course_to_semester(Int course_id, Int semester_id)
|
109
|
-
* remove_course_from_semester(Int course_id, Int semester_id)
|
110
|
-
* get_semester_by_name(String search_string)
|
111
|
-
* update_semester_data(String org_unit_id, JSON semester_data)
|
112
|
-
* recycle_semester_data(String org_unit_id)
|
113
|
-
* recycle_semester_by_name(String name)
|
109
|
+
* `create_semester_data(JSON semester_data)`
|
110
|
+
* `get_all_semesters`
|
111
|
+
* `get_semester_by_id(String org_unit_id)`
|
112
|
+
* `add_course_to_semester(Int course_id, Int semester_id)`
|
113
|
+
* `remove_course_from_semester(Int course_id, Int semester_id)`
|
114
|
+
* `get_semester_by_name(String search_string)`
|
115
|
+
* `update_semester_data(String org_unit_id, JSON semester_data)`
|
116
|
+
* `recycle_semester_data(String org_unit_id)`
|
117
|
+
* `recycle_semester_by_name(String name)`
|
114
118
|
3. Courses
|
115
|
-
* create_course_data(JSON course_data)
|
116
|
-
* get_org_department_classes(String org_unit_id)
|
117
|
-
* get_course_by_id(String org_unit_id)
|
118
|
-
* get_all_courses
|
119
|
-
* get_courses_by_name(String org_unit_name)
|
120
|
-
* get_courses_by_property_by_string(String property, String search_string)
|
121
|
-
* get_courses_by_property_by_regex(String property, regular-expression regex)
|
122
|
-
* update_course_data(String course_id, JSON new_data)
|
123
|
-
* delete_course_by_id(String org_unit_id)
|
119
|
+
* `create_course_data(JSON course_data)`
|
120
|
+
* `get_org_department_classes(String org_unit_id)`
|
121
|
+
* `get_course_by_id(String org_unit_id)`
|
122
|
+
* `get_all_courses`
|
123
|
+
* `get_courses_by_name(String org_unit_name)`
|
124
|
+
* `get_courses_by_property_by_string(String property, String search_string)`
|
125
|
+
* `get_courses_by_property_by_regex(String property, regular-expression regex)`
|
126
|
+
* `update_course_data(String course_id, JSON new_data)`
|
127
|
+
* `delete_course_by_id(String org_unit_id)`
|
124
128
|
4. Course Templates
|
125
|
-
* create_course_template(JSON course_template_data)
|
126
|
-
* get_course_template(String org_unit_id)
|
127
|
-
* get_all_course_templates
|
128
|
-
* get_course_template_by_name(String org_unit_name)
|
129
|
-
* get_course_templates_by_schema
|
130
|
-
* update_course_template(String org_unit_id, JSON new_data)
|
131
|
-
* delete_course_template(String org_unit_id)
|
132
|
-
* delete_all_course_templates_with_name(String name)
|
129
|
+
* `create_course_template(JSON course_template_data)`
|
130
|
+
* `get_course_template(String org_unit_id)`
|
131
|
+
* `get_all_course_templates`
|
132
|
+
* `get_course_template_by_name(String org_unit_name)`
|
133
|
+
* `get_course_templates_by_schema`
|
134
|
+
* `update_course_template(String org_unit_id, JSON new_data)`
|
135
|
+
* `delete_course_template(String org_unit_id)`
|
136
|
+
* `delete_all_course_templates_with_name(String name)`
|
133
137
|
5. Org Units
|
134
|
-
* get_org_unit_descendants(String org_unit_id, Int ou_type_id)
|
135
|
-
* get_paged_org_unit_descendants(String org_unit_id, Int ou_type_id, String bookmark)
|
136
|
-
* get_org_unit_parents(String org_unit_id, Int ou_type_id)
|
137
|
-
* add_parent_to_org_unit(Int parent_ou_id, Int child_ou_id)
|
138
|
-
* get_org_unit_ancestors(String org_unit_id, Int ou_type_id)
|
139
|
-
* get_org_unit_children(String org_unit_id, Int ou_type_id)
|
140
|
-
* get_paged_org_unit_children(String org_unit_id, String bookmark)
|
141
|
-
* get_org_unit_properties(String org_unit_id)
|
142
|
-
* delete_relationship_of_child_with_parent(Int parent_ou_id, Int child_ou_id)
|
143
|
-
* delete_relationship_of_parent_with_child(Int parent_ou_id, Int child_ou_id)
|
144
|
-
* get_all_childless_org_units(String org_unit_type String org_unit_code, String org_unit_name, String bookmark)
|
145
|
-
* get_all_orphans(String org_unit_type String org_unit_code, String org_unit_name, String bookmark)
|
146
|
-
* add_child_org_unit(String org_unit_id, Int child_org_unit_id)
|
147
|
-
* get_recycled_org_units(String bookmark)
|
148
|
-
* recycle_org_unit(String org_unit_id)
|
149
|
-
* delete_recycled_org_unit(String org_unit_id)
|
150
|
-
* restore_recyced_org_unit(string org_unit_id)
|
151
|
-
* create_custom_org_unit(JSON org_unit_data)
|
152
|
-
* update_org_unit(String org_unit_id, JSON org_unit_data)
|
153
|
-
* get_organization_info
|
154
|
-
* get_all_org_units_by_type_id(Int outype_id)
|
155
|
-
* get_outype(Int outype_id)
|
156
|
-
* get_all_outypes
|
138
|
+
* `get_org_unit_descendants(String org_unit_id, Int ou_type_id)`
|
139
|
+
* `get_paged_org_unit_descendants(String org_unit_id, Int ou_type_id, String bookmark)`
|
140
|
+
* `get_org_unit_parents(String org_unit_id, Int ou_type_id)`
|
141
|
+
* `add_parent_to_org_unit(Int parent_ou_id, Int child_ou_id)`
|
142
|
+
* `get_org_unit_ancestors(String org_unit_id, Int ou_type_id)`
|
143
|
+
* `get_org_unit_children(String org_unit_id, Int ou_type_id)`
|
144
|
+
* `get_paged_org_unit_children(String org_unit_id, String bookmark)`
|
145
|
+
* `get_org_unit_properties(String org_unit_id)`
|
146
|
+
* `delete_relationship_of_child_with_parent(Int parent_ou_id, Int child_ou_id)`
|
147
|
+
* `delete_relationship_of_parent_with_child(Int parent_ou_id, Int child_ou_id)`
|
148
|
+
* `get_all_childless_org_units(String org_unit_type String org_unit_code, String org_unit_name, String bookmark)`
|
149
|
+
* `get_all_orphans(String org_unit_type String org_unit_code, String org_unit_name, String bookmark)`
|
150
|
+
* `add_child_org_unit(String org_unit_id, Int child_org_unit_id)`
|
151
|
+
* `get_recycled_org_units(String bookmark)`
|
152
|
+
* `recycle_org_unit(String org_unit_id)`
|
153
|
+
* `delete_recycled_org_unit(String org_unit_id)`
|
154
|
+
* `restore_recyced_org_unit(string org_unit_id)`
|
155
|
+
* `create_custom_org_unit(JSON org_unit_data)`
|
156
|
+
* `update_org_unit(String org_unit_id, JSON org_unit_data)`
|
157
|
+
* `get_organization_info`
|
158
|
+
* `get_all_org_units_by_type_id(Int outype_id)`
|
159
|
+
* `get_outype(Int outype_id)`
|
160
|
+
* `get_all_outypes`
|
157
161
|
6. Enrollments
|
158
|
-
* create_user_enrollment(JSON course_enrollment_data)
|
159
|
-
* get_user_enrollment_data_by_org_unit(String user_id, String org_unit_id)
|
160
|
-
* get_all_enrollments_of_user(String user_id, optional String org_unit_type_id, optional String role_d, optional String bookmark)
|
161
|
-
* get_org_unit_enrollment_data_by_user(String org_unit_id, String user_id)
|
162
|
-
* get_enrollments_details_of_current_user
|
163
|
-
* get_all_enrollments_of_current_user(optional String bookmark, optional String sort_by, optional boolean is_active, optional UTCDATETIME start_date_time, optional UTCDATETIME end_date_time, optional boolean can_access)
|
164
|
-
* get_enrolled_users_in_classlist(String org_unit_id)
|
165
|
-
* delete_user_enrollment(String user_id, String org_unit_id)
|
162
|
+
* `create_user_enrollment(JSON course_enrollment_data)`
|
163
|
+
* `get_user_enrollment_data_by_org_unit(String user_id, String org_unit_id)`
|
164
|
+
* `get_all_enrollments_of_user(String user_id, optional String org_unit_type_id, optional String role_d, optional String bookmark)`
|
165
|
+
* `get_org_unit_enrollment_data_by_user(String org_unit_id, String user_id)`
|
166
|
+
* `get_enrollments_details_of_current_user`
|
167
|
+
* `get_all_enrollments_of_current_user(optional String bookmark, optional String sort_by, optional boolean is_active, optional UTCDATETIME start_date_time, optional UTCDATETIME end_date_time, optional boolean can_access)`
|
168
|
+
* `get_enrolled_users_in_classlist(String org_unit_id)`
|
169
|
+
* `delete_user_enrollment(String user_id, String org_unit_id)`
|
166
170
|
7. Groups
|
167
|
-
* delete_group_category(String org_unit_id, String group_category_id)
|
168
|
-
* delete_group(String org_unit_id, String group_category_id, String group_id)
|
169
|
-
* remove_user_from_group(String org_unit_id, String group_category_id, String group_id, String user_id)
|
170
|
-
* get_all_org_unit_group_categories(String org_unit_id)
|
171
|
-
* get_org_unit_group_category(String org_unit_id, String group_category_id)
|
172
|
-
* get_all_group_category_groups(String org_unit_id, String group_category_id)
|
173
|
-
* get_org_unit_group(String org_unit_id, String group_category_id, String group_id)
|
174
|
-
* create_org_unit_group_category(String org_unit_id, JSON group_category_data)
|
175
|
-
* create_org_unit_group(String org_unit_id String group_category_id, JSON group_data)
|
176
|
-
* update_org_unit_group(String org_unit_id, String group_category_id, String group_id, JSON group_data)
|
177
|
-
* enroll_user_in_group(String org_unit_id, String group_category_id, String group_id, String user_id)
|
178
|
-
* update_org_unit_group_category(String org_unit_id, String group_category_id, JSON group_category_data)
|
171
|
+
* `delete_group_category(String org_unit_id, String group_category_id)`
|
172
|
+
* `delete_group(String org_unit_id, String group_category_id, String group_id)`
|
173
|
+
* `remove_user_from_group(String org_unit_id, String group_category_id, String group_id, String user_id)`
|
174
|
+
* `get_all_org_unit_group_categories(String org_unit_id)`
|
175
|
+
* `get_org_unit_group_category(String org_unit_id, String group_category_id)`
|
176
|
+
* `get_all_group_category_groups(String org_unit_id, String group_category_id)`
|
177
|
+
* `get_org_unit_group(String org_unit_id, String group_category_id, String group_id)`
|
178
|
+
* `create_org_unit_group_category(String org_unit_id, JSON group_category_data)`
|
179
|
+
* `create_org_unit_group(String org_unit_id String group_category_id, JSON group_data)`
|
180
|
+
* `update_org_unit_group(String org_unit_id, String group_category_id, String group_id, JSON group_data)`
|
181
|
+
* `enroll_user_in_group(String org_unit_id, String group_category_id, String group_id, String user_id)`
|
182
|
+
* `update_org_unit_group_category(String org_unit_id, String group_category_id, JSON group_category_data)`
|
179
183
|
8. Sections
|
180
|
-
* delete_section(String org_unit_id, String section_id)
|
181
|
-
* get_org_unit_sections(String org_unit_id)
|
182
|
-
* get_org_unit_section_property_data(String org_unit_id)
|
183
|
-
* get_section_data(String org_unit_id, String section_id)
|
184
|
-
* create_org_unit_section(String org_unit_id JSON section_data)
|
185
|
-
* enroll_user_in_org_section(String org_unit_id, String section_id, JSON section_data)
|
186
|
-
* update_org_unit_section_properties(String org_unit_id, JSON section_property_data)
|
187
|
-
* update_org_unit_section_info(String org_unit_id, String section_id, JSON section_data)
|
184
|
+
* `delete_section(String org_unit_id, String section_id)`
|
185
|
+
* `get_org_unit_sections(String org_unit_id)`
|
186
|
+
* `get_org_unit_section_property_data(String org_unit_id)`
|
187
|
+
* `get_section_data(String org_unit_id, String section_id)`
|
188
|
+
* `create_org_unit_section(String org_unit_id JSON section_data)`
|
189
|
+
* `enroll_user_in_org_section(String org_unit_id, String section_id, JSON section_data)`
|
190
|
+
* `update_org_unit_section_properties(String org_unit_id, JSON section_property_data)`
|
191
|
+
* `update_org_unit_section_info(String org_unit_id, String section_id, JSON section_data)`
|
188
192
|
|
189
193
|
## Contributing
|
190
194
|
1. Fork it!
|
@@ -195,7 +199,8 @@ $ gem uninstall d2l_sdk --version [PREVIOUS-VERSION]
|
|
195
199
|
|
196
200
|
## History
|
197
201
|
* December 1, 2016: Project began
|
198
|
-
* December 20, 2016: Release version 0.1.2 published to RubyGems.org
|
202
|
+
* December 20, 2016: Release version 0.1.2 published to RubyGems.org as `d2l_api`
|
203
|
+
* March 7, 2017: Release version 0.1.7 published to RubyGems.org as `d2l_sdk`
|
199
204
|
|
200
205
|
## Credits
|
201
206
|
Matt Mencel: Assigning and assisting in this project.
|
data/lib/d2l_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: d2l_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kulpa
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- ".travis.yml"
|
150
150
|
- CODE_OF_CONDUCT.md
|
151
151
|
- Gemfile
|
152
|
+
- Gemfile.lock
|
152
153
|
- LICENSE.txt
|
153
154
|
- README.md
|
154
155
|
- Rakefile
|