bridge_api 0.1.14 → 0.1.15

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
  SHA1:
3
- metadata.gz: 32715294cbf0a4012da38a0664923ac8a5f9560e
4
- data.tar.gz: 30dc2aacd810e8387cf3d1ad5354680219772970
3
+ metadata.gz: abfc687839f0adc703d282a7f9b8b079de360f12
4
+ data.tar.gz: 7cba8884fe6500153c69e1090a19c5f5a2815ee9
5
5
  SHA512:
6
- metadata.gz: 450207f9fc4039e3740540a3f1076fa3a3eb5ff4b1688aa66470e2df6b9d1154dd9af2d8231f14e778b3a830c3e3cc7104ae79b78f644de77c8d0053b813ee9d
7
- data.tar.gz: 3fcba14431b03b2ec2102d9d59c35741d93c564bc0c90841bb8eab56c59a8a877c2965abdd4295b4a64e07710af245053eb31110098eb7bd0d06fce961a676d0
6
+ metadata.gz: c2afb3a1c7d64b8fdabfc1706cf617817040aac1909f854758692681e2d22c2e81658d2807cb72ac1bb1f9f193b21921c1523ad511149a7572da03b1437dca50
7
+ data.tar.gz: 5811fea00009061b064e8a1ea3b7b48be15c89c7774779ff4aa0cdf7b0df76901a33667202028cd9a5f6a9a655d502b0b439b9e782a919f0eea307d40eedc0bc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.0.14)
4
+ bridge_api (0.1.15)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -9,16 +9,16 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (4.2.7.1)
12
+ activesupport (5.1.2)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
14
  i18n (~> 0.7)
14
- json (~> 1.7, >= 1.7.7)
15
15
  minitest (~> 5.1)
16
- thread_safe (~> 0.3, >= 0.3.4)
17
16
  tzinfo (~> 1.1)
18
17
  addressable (2.5.1)
19
18
  public_suffix (~> 2.0, >= 2.0.2)
20
19
  byebug (8.2.5)
21
20
  coderay (1.1.1)
21
+ concurrent-ruby (1.0.5)
22
22
  crack (0.4.3)
23
23
  safe_yaml (~> 1.0.0)
24
24
  diff-lcs (1.3)
@@ -32,7 +32,6 @@ GEM
32
32
  link_header (>= 0.0.7)
33
33
  hashdiff (0.3.2)
34
34
  i18n (0.8.6)
35
- json (1.8.6)
36
35
  link_header (0.0.8)
37
36
  method_source (0.8.2)
38
37
  minitest (5.10.2)
@@ -23,6 +23,7 @@ module BridgeAPI
23
23
  AUTHOR_PATH = "/author"
24
24
  LEARNER_PATH = "/learner"
25
25
  CUSTOM_FIELD_PATH = "/custom_fields"
26
+ SUB_ACCOUNT_PATH = '/sub_accounts'
26
27
  API_VERSION = 1
27
28
  API_PATH = '/api'
28
29
  RESULT_MAPPING = {}
@@ -0,0 +1,9 @@
1
+ module BridgeAPI
2
+ class Client
3
+ module SubAccount
4
+ def get_sub_accounts(params = {})
5
+ get("#{API_PATH}#{ADMIN_PATH}#{SUB_ACCOUNT_PATH}", params)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.14' unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.15' unless defined?(BridgeAPI::VERSION)
3
3
  end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ describe BridgeAPI::Client::SubAccount do
4
+
5
+ before do
6
+ @client = BridgeAPI::Client.new(prefix: "http://test.bridge.com", token: "test_token")
7
+ end
8
+
9
+ it 'should get all subaccounts' do
10
+ response = @client.get_sub_accounts
11
+ expect(response.first['id']).to(eq("141"))
12
+ end
13
+
14
+ end
@@ -0,0 +1,68 @@
1
+ {
2
+ "meta": {},
3
+ "sub_accounts": [
4
+ {
5
+ "id": "141",
6
+ "administrators": "",
7
+ "branding_enabled": true,
8
+ "contact_email": "",
9
+ "contact_name": "",
10
+ "contact_phone": "",
11
+ "limited_authoring": false,
12
+ "bridge_retain": true,
13
+ "locale": "en",
14
+ "name": "Customers",
15
+ "subdomain": "customer",
16
+ "time_zone": "America/Denver",
17
+ "notifications": true,
18
+ "chat_notifications": false,
19
+ "from_label": "Training.",
20
+ "reply_to": "",
21
+ "support_level": "adminsOnly",
22
+ "show_custom_support_info": true,
23
+ "support_name": "Education Info",
24
+ "support_phone": null,
25
+ "support_email": "",
26
+ "use_custom_support": false,
27
+ "products": [
28
+ {
29
+ "product_name": "learn",
30
+ "subscription_type": "paid"
31
+ }
32
+ ],
33
+ "created_at": "2017-05-31T15:29:06.060-06:00",
34
+ "is_active": true,
35
+ "course_count": 1,
36
+ "user_count": 26,
37
+ "import_passwords": false,
38
+ "tac_type": "domestic",
39
+ "tac_custom_body": null,
40
+ "lynda_org_id": null,
41
+ "auto_csv": false,
42
+ "password_reset_allowed": true,
43
+ "password_minimum_length": null,
44
+ "password_requires_numbers": false,
45
+ "password_requires_symbols": false,
46
+ "password_requires_uppercase": false,
47
+ "import_profile": {
48
+ "csv_days": [
49
+ false,
50
+ false,
51
+ false,
52
+ false,
53
+ false,
54
+ false,
55
+ false
56
+ ],
57
+ "csv_time": null,
58
+ "csv_url": null,
59
+ "csv_user": null
60
+ },
61
+ "auth": {
62
+ "provider": "Basic",
63
+ "model": "User"
64
+ },
65
+ "create_user_from_auth_hash": true
66
+ }
67
+ ]
68
+ }
@@ -154,6 +154,10 @@ class FakeBridge < Sinatra::Base
154
154
  get_json_data 200, 'live_course_enrollments.json'
155
155
  end
156
156
 
157
+ #Sub Accounts
158
+ get %r{/api/admin/sub_accounts} do
159
+ get_json_data 200, 'sub_accounts.json'
160
+ end
157
161
 
158
162
  private
159
163
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -199,6 +199,7 @@ files:
199
199
  - lib/bridge_api/client/live_course_enrollment.rb
200
200
  - lib/bridge_api/client/manager.rb
201
201
  - lib/bridge_api/client/program_enrollment.rb
202
+ - lib/bridge_api/client/sub_account.rb
202
203
  - lib/bridge_api/client/user.rb
203
204
  - lib/bridge_api/version.rb
204
205
  - spec/bridge_api/client/course_template_spec.rb
@@ -210,6 +211,7 @@ files:
210
211
  - spec/bridge_api/client/live_course_spec.rb
211
212
  - spec/bridge_api/client/manager_spec.rb
212
213
  - spec/bridge_api/client/program_enrollment_spec.rb
214
+ - spec/bridge_api/client/sub_account_spec.rb
213
215
  - spec/bridge_api/client/user_spec.rb
214
216
  - spec/bridge_api/client_spec.rb
215
217
  - spec/fixtures/course.json
@@ -226,6 +228,7 @@ files:
226
228
  - spec/fixtures/managers.json
227
229
  - spec/fixtures/program_enrollments.json
228
230
  - spec/fixtures/programs.json
231
+ - spec/fixtures/sub_accounts.json
229
232
  - spec/fixtures/user.json
230
233
  - spec/fixtures/users.json
231
234
  - spec/support/fake_bridge.rb
@@ -264,6 +267,7 @@ test_files:
264
267
  - spec/bridge_api/client/live_course_spec.rb
265
268
  - spec/bridge_api/client/manager_spec.rb
266
269
  - spec/bridge_api/client/program_enrollment_spec.rb
270
+ - spec/bridge_api/client/sub_account_spec.rb
267
271
  - spec/bridge_api/client/user_spec.rb
268
272
  - spec/bridge_api/client_spec.rb
269
273
  - spec/fixtures/course.json
@@ -280,6 +284,7 @@ test_files:
280
284
  - spec/fixtures/managers.json
281
285
  - spec/fixtures/program_enrollments.json
282
286
  - spec/fixtures/programs.json
287
+ - spec/fixtures/sub_accounts.json
283
288
  - spec/fixtures/user.json
284
289
  - spec/fixtures/users.json
285
290
  - spec/support/fake_bridge.rb