bridge_api 0.1.27 → 0.1.29

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: 6fe6414fe4379427b35d713bcb22215bcaaac955
4
- data.tar.gz: ef6af928d02d5e9d3c55da7a89f82cbfc862a066
3
+ metadata.gz: 714ebb0ae6cc3228e944e53ec5deb352bec2881c
4
+ data.tar.gz: 3be3ac1bb97b2ef0f252c526a9dbee364455a9f0
5
5
  SHA512:
6
- metadata.gz: c99339c9dcb18858fbdb2ac8163ffd0aaebd62c70624c59d503475bb4ad895bca604a378a0c6a826fbde3af1a1a184f0a42889e2e25def866b9abbc4da738121
7
- data.tar.gz: 6c36f3dbf2f26e641172f301c04210f8c8eef5e625aeaa66e635967c0d2e9f0d09f5e1be81b2dea69d73d1328cf701ccb9ef0ffe248c2e41de37f75eaa854454
6
+ metadata.gz: 3c8e9e43b293e203687f58a8bbed1757b14571fa026fb78bdfbb747b6e19d249986344c4e2dc043e7f14c98b572699b5ed485664be30e3860eaa20d76be7d8c6
7
+ data.tar.gz: a4ed080334833e1d52ed7ef83cff466167341c1261c90fe8872082ea5fbbc3d80b59d57afa5d395a622a0fddd9781f6277bb7e45bd43eeecf9335b18c90844ab
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.1.27)
4
+ bridge_api (0.1.28)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -30,6 +30,7 @@ module BridgeAPI
30
30
  API_VERSION = 1
31
31
  API_PATH = '/api'.freeze
32
32
  ROLE_PATH = '/roles'.freeze
33
+ AFFILIATED_SUBACCOUNTS = '/affiliated_sub_accounts'
33
34
  RESULT_MAPPING = {}
34
35
 
35
36
  require 'bridge_api/api_array'
@@ -0,0 +1,14 @@
1
+ module BridgeAPI
2
+ class Client
3
+ module Affiliation
4
+ def revoke_affiliations_batch(params = {})
5
+ put("#{API_PATH}#{AUTHOR_PATH}#{AFFILIATED_SUBACCOUNTS}/revoke_batch", params)
6
+ end
7
+
8
+ def share_affiliations_batch(course_template_id, params = {})
9
+ put("#{API_PATH}#{AUTHOR_PATH}#{AFFILIATED_SUBACCOUNTS}/share_batch", params)
10
+ end
11
+ end
12
+ end
13
+ end
14
+
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.27'.freeze unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.29'.freeze unless defined?(BridgeAPI::VERSION)
3
3
  end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ describe BridgeAPI::Client::Affiliation do
4
+ before do
5
+ @client = BridgeAPI::Client.new(prefix: 'http://test.bridge.com', token: 'test_token')
6
+ end
7
+
8
+ it 'should share the affiliation in bulk' do
9
+ response = @client.share_affiliations_batch.first
10
+ expect(response['id']).to(eq('12'))
11
+ end
12
+
13
+ end
@@ -0,0 +1,13 @@
1
+ {
2
+ "meta": {},
3
+ "sub_accounts": [
4
+ {
5
+ "id": "1",
6
+ "name": "SubAccount",
7
+ "affiliated": false,
8
+ "has_enrollments": false,
9
+ "has_foreign_sources": false,
10
+ "user_count": 1
11
+ }
12
+ ]
13
+ }
@@ -214,6 +214,11 @@ class FakeBridge < Sinatra::Base
214
214
  get_json_data 204, 'roles.json'
215
215
  end
216
216
 
217
+ #Affiliations
218
+ put %r{/api/author/affiliated_sub_accounts} do
219
+ get_json_data 204, 'affiliations.json'
220
+ end
221
+
217
222
  private
218
223
 
219
224
  def get_json_data(response_code, file_name)
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.27
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-24 00:00:00.000000000 Z
11
+ date: 2018-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -195,6 +195,7 @@ files:
195
195
  - lib/bridge_api/api_array.rb
196
196
  - lib/bridge_api/client.rb
197
197
  - lib/bridge_api/client/account.rb
198
+ - lib/bridge_api/client/affiliation.rb
198
199
  - lib/bridge_api/client/clone_object.rb
199
200
  - lib/bridge_api/client/course_template.rb
200
201
  - lib/bridge_api/client/custom_field.rb
@@ -210,6 +211,7 @@ files:
210
211
  - lib/bridge_api/client/user.rb
211
212
  - lib/bridge_api/version.rb
212
213
  - spec/bridge_api/client/account_spec.rb
214
+ - spec/bridge_api/client/affiliations.rb
213
215
  - spec/bridge_api/client/clone_object_spec.rb
214
216
  - spec/bridge_api/client/course_template_spec.rb
215
217
  - spec/bridge_api/client/custom_field_spec.rb
@@ -225,6 +227,7 @@ files:
225
227
  - spec/bridge_api/client/user_spec.rb
226
228
  - spec/bridge_api/client_spec.rb
227
229
  - spec/fixtures/accounts.json
230
+ - spec/fixtures/affiliations.json
228
231
  - spec/fixtures/clone_objects.json
229
232
  - spec/fixtures/course.json
230
233
  - spec/fixtures/courses.json
@@ -275,6 +278,7 @@ specification_version: 4
275
278
  summary: Bridge API
276
279
  test_files:
277
280
  - spec/bridge_api/client/account_spec.rb
281
+ - spec/bridge_api/client/affiliations.rb
278
282
  - spec/bridge_api/client/clone_object_spec.rb
279
283
  - spec/bridge_api/client/course_template_spec.rb
280
284
  - spec/bridge_api/client/custom_field_spec.rb
@@ -290,6 +294,7 @@ test_files:
290
294
  - spec/bridge_api/client/user_spec.rb
291
295
  - spec/bridge_api/client_spec.rb
292
296
  - spec/fixtures/accounts.json
297
+ - spec/fixtures/affiliations.json
293
298
  - spec/fixtures/clone_objects.json
294
299
  - spec/fixtures/course.json
295
300
  - spec/fixtures/courses.json