oneaccess 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c33c036b76dd4e04030e1fbddeab3e1712b3310d
4
- data.tar.gz: 3536eb9fd5be517e69b1babc00e9a5242ec34f84
3
+ metadata.gz: 9345968033df9754320ae59b779ee0a12fa1da66
4
+ data.tar.gz: 87cd0f91f5de14cf0c3774fa514187a1f3fd0c25
5
5
  SHA512:
6
- metadata.gz: 5db803a6ca78402d935b9916fb4ab8996bc7e1e7507cf5f768978155b1e51fff84356f7a775749766d70475c18d668414f66679d44822763a3a0a3f628e8d09e
7
- data.tar.gz: de218538bf247fe54e6beea9aeee31b3479b18dfc3729f58a7a9c828c93f395a2ecfe8df446c69692bac14a6e850ecafaeae7ca4549afbe9c27351443896462c
6
+ metadata.gz: 6164fd7a024bd81e6963bd82b9e9808c0cc67a38098cea3e6f45c4f175a4c511b742e274f6bf6524fd1d37eac1a3179f957b05b79df3b0c7f9326c663bd15a41
7
+ data.tar.gz: a4b9c4f1a6c9a336eb03c2d832f0aefb8974fe2352d1ce1511bf4d7e66cd6bfe410b466438aac8d0f8bf5713aaee686a97f36ba788edaf7f6323743ee77a9684
data/README.md CHANGED
@@ -41,6 +41,8 @@ Not all the methods in the API are currently supported, here's a list of all sup
41
41
  - Organization: _/organizations/id_
42
42
  - User's Product Groups: _/entitlement/user/productgroup/getList_
43
43
  - User Entitlement Requests: _/entitlement/research/userRequests/getListWithEntitlementsStatus_
44
+ - Subscribe to Entitlements Updates: _/entitlement/userSubscription/subscribeToUpdates_
45
+ - Get User ids which entitlements have changed _/entitlement/userSubscription/subscribeToUpdates/changedUsers/getList_
44
46
 
45
47
  ### User by Email _(/user/getByEmail)_
46
48
  Official Documentation: http://apidocs.oneaccess.io/docs/usergetorcreate
@@ -189,3 +191,42 @@ rescue ONEAccess::Error::APIError => e
189
191
  puts "Error listing the available user entitlement requests"
190
192
  end
191
193
  ```
194
+
195
+ ### Subscribe to Entitlements Updates _(/entitlement/userSubscription/subscribeToUpdates)_
196
+ Official Documentation: http://apidocs.oneaccess.io/docs/entitlmentusersubscriptionsubscribetoupdates
197
+
198
+ This method allows to subscribe for user entitlement updates providing the list of users that one wishes
199
+ to receive updates from. Returns the API Status Code as the result of the subscription operation.
200
+
201
+ #### How to use:
202
+ ```ruby
203
+ begin
204
+ resp = ONEAccess::API::Entitlement::UserSubscription.subscribe(user_ids: [<user_ids>])
205
+
206
+ resp #=> instance of ONEAcess::Response::SubscribeToUpdatesResponse
207
+ rescue ONEAccess::Error::APIError => e
208
+ puts "Error subscribing users for entitlements updates"
209
+ end
210
+ ```
211
+
212
+ ### Get User ids which entitlements have changed _(/entitlement/userSubscription/subscribeToUpdates/changedUsers/getList)_
213
+ Official Documentation: http://apidocs.oneaccess.io/docs/entitlementusersubscriptionsubscribetoupdateschangedusersgetlist
214
+
215
+ This method allows to get the list of user ids which the entitlements have changed.
216
+ Can be provided a date to get the users who have changed entitlements after the provided date. If the date is not provided then it returns the user ids in which the entitlements have changed after the last call to this method. For example:
217
+
218
+ First call at 08/22/2016 11:55:00.
219
+ Next call at 08/22/2016 15:55:00. Returns the user ids who have changed entitlements after 08/22/2016 11:55:00.
220
+
221
+ Use UTC time zone for date parameter.
222
+
223
+ #### How to use:
224
+ ```ruby
225
+ begin
226
+ resp = ONEAccess::API::Entitlement::UserSubscription.changed_users(from_date: <utc_string_date>)
227
+
228
+ resp #=> instance of ONEAcess::Response::ChangedUsersResponse
229
+ rescue ONEAccess::Error::APIError => e
230
+ puts "Error getting the list of user ids which entitlements have changed"
231
+ end
232
+ ```
@@ -16,6 +16,7 @@ require_relative "./oneaccess/api/research"
16
16
  require_relative "./oneaccess/api/organizations"
17
17
  require_relative "./oneaccess/api/symbology"
18
18
  require_relative "./oneaccess/api/references"
19
+ require_relative "./oneaccess/api/entitlement/user_subscription"
19
20
  require_relative "./oneaccess/api/entitlement/organization/product_group"
20
21
  require_relative "./oneaccess/api/entitlement/user/product_group"
21
22
  require_relative "./oneaccess/api/entitlement/research/user_requests"
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../response/subscribe_to_updates_response"
4
+ require_relative "../../response/changed_users_response"
5
+
6
+ module ONEAccess
7
+ module API
8
+ module Entitlement
9
+ class UserSubscription < Base
10
+ api_path "/entitlement/userSubscription"
11
+
12
+ def self.subscribe(user_ids:)
13
+ response = send_post("subscribeToUpdates", user_ids)
14
+
15
+ Response::SubscribeToUpdatesResponse.from_json(response.body)
16
+ end
17
+
18
+ def self.changed_users(from_date: nil)
19
+ params = { dateFrom: from_date }.reject { |_, v| v.nil? }
20
+ response = send_get("subscribeToUpdates/changedUsers/getList", params)
21
+
22
+ Response::ChangedUsersResponse.from_json(response.body)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./base_response"
4
+ require_relative "./representer/changed_users_response"
5
+
6
+ module ONEAccess
7
+ module Response
8
+ class ChangedUsersResponse < BaseResponse
9
+ represented_by Representer::ChangedUsersResponse
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./base_response"
4
+
5
+ module ONEAccess
6
+ module Response
7
+ module Representer
8
+ class ChangedUsersResponse < BaseResponse
9
+ property :data, as: :Data
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./base_response"
4
+
5
+ module ONEAccess
6
+ module Response
7
+ module Representer
8
+ class SubscribeToUpdatesResponse < BaseResponse
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./base_response"
4
+ require_relative "./representer/subscribe_to_updates_response"
5
+
6
+ module ONEAccess
7
+ module Response
8
+ class SubscribeToUpdatesResponse < BaseResponse
9
+ represented_by Representer::SubscribeToUpdatesResponse
10
+ end
11
+ end
12
+ end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "oneaccess"
4
- s.version = "0.1.8"
5
- s.date = "2018-01-10"
4
+ s.version = "0.1.9"
5
+ s.date = "2018-01-29"
6
6
  s.summary = "ONEAccess API wrapper"
7
7
  s.description = "Easily communicate with ONEAccess API"
8
8
  s.homepage = "https://github.com/AlphaExchange/rixml"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oneaccess
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Correia Santos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -190,6 +190,7 @@ files:
190
190
  - lib/oneaccess/api/entitlement/organization/product_group.rb
191
191
  - lib/oneaccess/api/entitlement/research/user_requests.rb
192
192
  - lib/oneaccess/api/entitlement/user/product_group.rb
193
+ - lib/oneaccess/api/entitlement/user_subscription.rb
193
194
  - lib/oneaccess/api/organizations.rb
194
195
  - lib/oneaccess/api/references.rb
195
196
  - lib/oneaccess/api/research.rb
@@ -237,6 +238,7 @@ files:
237
238
  - lib/oneaccess/error/api_error.rb
238
239
  - lib/oneaccess/response/api_error.rb
239
240
  - lib/oneaccess/response/base_response.rb
241
+ - lib/oneaccess/response/changed_users_response.rb
240
242
  - lib/oneaccess/response/companies_response.rb
241
243
  - lib/oneaccess/response/company_response.rb
242
244
  - lib/oneaccess/response/countries_response.rb
@@ -246,6 +248,7 @@ files:
246
248
  - lib/oneaccess/response/product_groups_response.rb
247
249
  - lib/oneaccess/response/representer/api_error.rb
248
250
  - lib/oneaccess/response/representer/base_response.rb
251
+ - lib/oneaccess/response/representer/changed_users_response.rb
249
252
  - lib/oneaccess/response/representer/companies_response.rb
250
253
  - lib/oneaccess/response/representer/company_response.rb
251
254
  - lib/oneaccess/response/representer/countries_response.rb
@@ -254,10 +257,12 @@ files:
254
257
  - lib/oneaccess/response/representer/paginated_response.rb
255
258
  - lib/oneaccess/response/representer/product_groups_response.rb
256
259
  - lib/oneaccess/response/representer/research_document_response.rb
260
+ - lib/oneaccess/response/representer/subscribe_to_updates_response.rb
257
261
  - lib/oneaccess/response/representer/user_entitlement_requests_response.rb
258
262
  - lib/oneaccess/response/representer/user_requests_response.rb
259
263
  - lib/oneaccess/response/representer/user_response.rb
260
264
  - lib/oneaccess/response/research_document_response.rb
265
+ - lib/oneaccess/response/subscribe_to_updates_response.rb
261
266
  - lib/oneaccess/response/user_entitlement_requests_response.rb
262
267
  - lib/oneaccess/response/user_requests_response.rb
263
268
  - lib/oneaccess/response/user_response.rb