oneaccess 0.4.5 → 0.5.0
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 +4 -4
- data/.rubocop.yml +4 -0
- data/README.md +14 -0
- data/lib/oneaccess/api/v1_1/entitlement/research/user_requests.rb +1 -1
- data/lib/oneaccess/api/v3_0/providers.rb +47 -0
- data/lib/oneaccess/data_object/providers_user_details.rb +21 -0
- data/lib/oneaccess/data_object/providers_user_details_vendor.rb +19 -0
- data/lib/oneaccess/data_object/providers_users_details.rb +22 -0
- data/lib/oneaccess/data_object/representer/providers_user_details.rb +22 -0
- data/lib/oneaccess/data_object/representer/providers_user_details_vendor.rb +17 -0
- data/lib/oneaccess/data_object/representer/providers_users_details.rb +23 -0
- data/lib/oneaccess/response/collection_response.rb +17 -0
- data/lib/oneaccess/response/providers_users_details_response.rb +12 -0
- data/lib/oneaccess/response/representer/collection_response.rb +11 -0
- data/lib/oneaccess/response/representer/providers_users_details_response.rb +15 -0
- data/lib/oneaccess/serializable.rb +15 -3
- data/oneaccess.gemspec +2 -2
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bebd929f809465f9ab5a529dc6ac4192016f59c5
|
4
|
+
data.tar.gz: 129cc7733676fc2e395ee8b55d6e9c1609d60b5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7917796d561f384e34cdf4b62c17da2e651ba856563dff9983d6ad055b1bad485dd0e5999f6d69e3caf0bb0f6dfbf40af2b2defaf63e5960bc5dcc85416c8d2
|
7
|
+
data.tar.gz: bb5f64a8d3834ce5d74f2a5cfad290a5d8341180889b994329fda2d9e2182b32eab101fa34313d7d9500f4344e72f093986d43285f3b1cef454764691c6703a1
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -261,3 +261,17 @@ rescue ONEAccess::Error::APIError => e
|
|
261
261
|
puts "Error creating the inducement"
|
262
262
|
end
|
263
263
|
```
|
264
|
+
|
265
|
+
### Get Providers Users Details _(/providers/GetProviderUserDetails)_
|
266
|
+
|
267
|
+
Reference endpoint to get providers users details information.
|
268
|
+
|
269
|
+
#### How to use:
|
270
|
+
```ruby
|
271
|
+
begin
|
272
|
+
resp = ONEAccess::API::V3_0::Providers.users_details(buy_side_org_id: 1, provider_id: 1, contract_status_id: 1, user_id: 1, user_email: 'hello@example.com', user_reverse_entitlement_status: 1, vendor_id: 1, reverse_entitlement_status: 1)
|
273
|
+
resp #=> instance of Array containing ONEAccess::DataObject::ProvidersUsersDetails
|
274
|
+
rescue ONEAccess::Error::APIError => e
|
275
|
+
puts "Error getting providers users details"
|
276
|
+
end
|
277
|
+
```
|
@@ -25,7 +25,7 @@ module ONEAccess
|
|
25
25
|
Response::UserRequestsResponse.from_json(response.body)
|
26
26
|
end
|
27
27
|
|
28
|
-
def self.get_list( # rubocop:disable Metrics/
|
28
|
+
def self.get_list( # rubocop:disable Metrics/MethodLength
|
29
29
|
user_ids: [],
|
30
30
|
page_number: 0,
|
31
31
|
page_size: 20,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../../response/inducement_response"
|
4
|
+
require_relative "../../response/providers_users_details_response"
|
4
5
|
|
5
6
|
module ONEAccess
|
6
7
|
module API
|
@@ -22,6 +23,52 @@ module ONEAccess
|
|
22
23
|
|
23
24
|
Response::InducementResponse.from_json(resp.body)
|
24
25
|
end
|
26
|
+
|
27
|
+
def users_details( # rubocop:disable Metrics/MethodLength
|
28
|
+
buy_side_org_id:,
|
29
|
+
provider_id:,
|
30
|
+
contract_status_id: nil,
|
31
|
+
user_id: nil,
|
32
|
+
user_email: nil,
|
33
|
+
user_reverse_entitlement_status: nil,
|
34
|
+
vendor_id: nil,
|
35
|
+
reverse_entitlement_status: nil
|
36
|
+
)
|
37
|
+
|
38
|
+
provider_id = comma_separated_values(provider_id)
|
39
|
+
|
40
|
+
params = {
|
41
|
+
buysideorgid: buy_side_org_id,
|
42
|
+
contractstatusid: contract_status_id,
|
43
|
+
userid: user_id,
|
44
|
+
useremail: user_email,
|
45
|
+
userreverseentitlementstatus: user_reverse_entitlement_status,
|
46
|
+
vendorid: vendor_id,
|
47
|
+
reverseentitlementstatus: reverse_entitlement_status
|
48
|
+
}.reject { |_, value| value.nil? }
|
49
|
+
|
50
|
+
resp = send_get("GetProviderUserDetails?providerid=#{provider_id}", params)
|
51
|
+
|
52
|
+
Response::ProvidersUsersDetailsResponse.from_json(resp.body)
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# We need to diffently handle comma separated values since the RestClient,
|
58
|
+
# gem URI encode the commas and this is not supported by the API.
|
59
|
+
#
|
60
|
+
# Examples:
|
61
|
+
# [1,2$,3] => '1,2%24,3'
|
62
|
+
# '1,2$,3' => '1,2%24,3'
|
63
|
+
def comma_separated_values(values)
|
64
|
+
values = values.split(",") if values.is_a?(String)
|
65
|
+
if values.is_a?(Array)
|
66
|
+
values = values.map do |value|
|
67
|
+
URI.encode_www_form_component(value)
|
68
|
+
end.join(",")
|
69
|
+
end
|
70
|
+
values
|
71
|
+
end
|
25
72
|
end
|
26
73
|
end
|
27
74
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/providers_user_details"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
class ProvidersUserDetails
|
8
|
+
extend Serializable
|
9
|
+
|
10
|
+
represented_by Representer::ProvidersUserDetails
|
11
|
+
|
12
|
+
attr_accessor :id
|
13
|
+
attr_accessor :user_rev_ent_status
|
14
|
+
attr_accessor :first_name
|
15
|
+
attr_accessor :last_name
|
16
|
+
attr_accessor :email
|
17
|
+
attr_accessor :vendors_count
|
18
|
+
attr_accessor :vendors
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/providers_user_details_vendor"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
class ProvidersUserDetailsVendor
|
8
|
+
extend Serializable
|
9
|
+
|
10
|
+
represented_by Representer::ProvidersUserDetailsVendor
|
11
|
+
|
12
|
+
attr_accessor :id
|
13
|
+
attr_accessor :rev_ent_status
|
14
|
+
attr_accessor :name
|
15
|
+
attr_accessor :short_name
|
16
|
+
attr_accessor :ent_level
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/providers_users_details"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
class ProvidersUsersDetails
|
8
|
+
extend Serializable
|
9
|
+
|
10
|
+
represented_by Representer::ProvidersUsersDetails
|
11
|
+
|
12
|
+
attr_accessor :provider_id
|
13
|
+
attr_accessor :buy_side_org_id
|
14
|
+
attr_accessor :provider_name
|
15
|
+
attr_accessor :contract_status
|
16
|
+
attr_accessor :contract_status_id
|
17
|
+
attr_accessor :buy_side_org_name
|
18
|
+
attr_accessor :users_count
|
19
|
+
attr_accessor :users
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../providers_user_details_vendor"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
module Representer
|
8
|
+
class ProvidersUserDetails < Representable::Decorator
|
9
|
+
include Representable::JSON
|
10
|
+
|
11
|
+
property :id, type: Integer
|
12
|
+
property :user_rev_ent_status, as: :userreventstatus, type: String
|
13
|
+
property :first_name, as: :firstname, type: String
|
14
|
+
property :last_name, as: :lastname, type: String
|
15
|
+
property :email, type: String
|
16
|
+
property :vendors_count, as: :vendorscount, type: Integer
|
17
|
+
collection :vendors, decorator: Representer::ProvidersUserDetailsVendor,
|
18
|
+
class: DataObject::ProvidersUserDetailsVendor
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ONEAccess
|
4
|
+
module DataObject
|
5
|
+
module Representer
|
6
|
+
class ProvidersUserDetailsVendor < Representable::Decorator
|
7
|
+
include Representable::JSON
|
8
|
+
|
9
|
+
property :id, type: Integer
|
10
|
+
property :rev_ent_status, as: :reventstatus, type: String
|
11
|
+
property :name, type: String
|
12
|
+
property :short_name, as: :shortname, type: String
|
13
|
+
property :ent_level, as: :entlevel, type: String
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../providers_user_details"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
module Representer
|
8
|
+
class ProvidersUsersDetails < Representable::Decorator
|
9
|
+
include Representable::JSON
|
10
|
+
|
11
|
+
property :provider_id, as: :providerid, type: Integer
|
12
|
+
property :buy_side_org_id, as: :buysideorgid, type: Integer
|
13
|
+
property :provider_name, as: :providername, type: String
|
14
|
+
property :contract_status, as: :contractstatus, type: String
|
15
|
+
property :contract_status_id, as: :contractstatusid, type: String
|
16
|
+
property :buy_side_org_name, as: :buysideorgname, type: String
|
17
|
+
property :users_count, as: :userscount, type: Integer
|
18
|
+
collection :users, decorator: Representer::ProvidersUserDetails,
|
19
|
+
class: DataObject::ProvidersUserDetails
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./collection_response"
|
4
|
+
require_relative "./representer/providers_users_details_response"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module Response
|
8
|
+
class ProvidersUsersDetailsResponse < CollectionResponse
|
9
|
+
represented_by Representer::ProvidersUsersDetailsResponse
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./collection_response"
|
4
|
+
require_relative "../../data_object/providers_users_details"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module Response
|
8
|
+
module Representer
|
9
|
+
class ProvidersUsersDetailsResponse < CollectionResponse
|
10
|
+
items decorator: DataObject::Representer::ProvidersUsersDetails,
|
11
|
+
class: DataObject::ProvidersUsersDetails
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -7,9 +7,21 @@ module ONEAccess
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def from_json(json)
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
if collection?
|
11
|
+
collection = []
|
12
|
+
@representer_class.new(collection).from_json(json)
|
13
|
+
collection
|
14
|
+
else
|
15
|
+
obj = new
|
16
|
+
@representer_class.new(obj).from_json(json)
|
17
|
+
obj
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def collection?
|
24
|
+
false
|
13
25
|
end
|
14
26
|
end
|
15
27
|
end
|
data/oneaccess.gemspec
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "oneaccess"
|
5
|
-
s.version = "0.
|
6
|
-
s.date = "2018-
|
5
|
+
s.version = "0.5.0"
|
6
|
+
s.date = "2018-04-18"
|
7
7
|
s.summary = "ONEAccess API wrapper"
|
8
8
|
s.description = "Easily communicate with ONEAccess API"
|
9
9
|
s.homepage = "https://github.com/AlphaExchange/oneaccess-rb"
|
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.
|
4
|
+
version: 0.5.0
|
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-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -215,6 +215,9 @@ files:
|
|
215
215
|
- lib/oneaccess/data_object/organization.rb
|
216
216
|
- lib/oneaccess/data_object/organization_light.rb
|
217
217
|
- lib/oneaccess/data_object/product_group.rb
|
218
|
+
- lib/oneaccess/data_object/providers_user_details.rb
|
219
|
+
- lib/oneaccess/data_object/providers_user_details_vendor.rb
|
220
|
+
- lib/oneaccess/data_object/providers_users_details.rb
|
218
221
|
- lib/oneaccess/data_object/region.rb
|
219
222
|
- lib/oneaccess/data_object/representer/address.rb
|
220
223
|
- lib/oneaccess/data_object/representer/city.rb
|
@@ -230,6 +233,9 @@ files:
|
|
230
233
|
- lib/oneaccess/data_object/representer/organization.rb
|
231
234
|
- lib/oneaccess/data_object/representer/organization_light.rb
|
232
235
|
- lib/oneaccess/data_object/representer/product_group.rb
|
236
|
+
- lib/oneaccess/data_object/representer/providers_user_details.rb
|
237
|
+
- lib/oneaccess/data_object/representer/providers_user_details_vendor.rb
|
238
|
+
- lib/oneaccess/data_object/representer/providers_users_details.rb
|
233
239
|
- lib/oneaccess/data_object/representer/region.rb
|
234
240
|
- lib/oneaccess/data_object/representer/research_document_info.rb
|
235
241
|
- lib/oneaccess/data_object/representer/saml_info.rb
|
@@ -254,6 +260,7 @@ files:
|
|
254
260
|
- lib/oneaccess/response/api_error.rb
|
255
261
|
- lib/oneaccess/response/base_response.rb
|
256
262
|
- lib/oneaccess/response/changed_users_response.rb
|
263
|
+
- lib/oneaccess/response/collection_response.rb
|
257
264
|
- lib/oneaccess/response/companies_response.rb
|
258
265
|
- lib/oneaccess/response/company_response.rb
|
259
266
|
- lib/oneaccess/response/contributors_response.rb
|
@@ -264,9 +271,11 @@ files:
|
|
264
271
|
- lib/oneaccess/response/organization_response.rb
|
265
272
|
- lib/oneaccess/response/paginated_response.rb
|
266
273
|
- lib/oneaccess/response/product_groups_response.rb
|
274
|
+
- lib/oneaccess/response/providers_users_details_response.rb
|
267
275
|
- lib/oneaccess/response/representer/api_error.rb
|
268
276
|
- lib/oneaccess/response/representer/base_response.rb
|
269
277
|
- lib/oneaccess/response/representer/changed_users_response.rb
|
278
|
+
- lib/oneaccess/response/representer/collection_response.rb
|
270
279
|
- lib/oneaccess/response/representer/companies_response.rb
|
271
280
|
- lib/oneaccess/response/representer/company_response.rb
|
272
281
|
- lib/oneaccess/response/representer/contributors_response.rb
|
@@ -277,6 +286,7 @@ files:
|
|
277
286
|
- lib/oneaccess/response/representer/organization_response.rb
|
278
287
|
- lib/oneaccess/response/representer/paginated_response.rb
|
279
288
|
- lib/oneaccess/response/representer/product_groups_response.rb
|
289
|
+
- lib/oneaccess/response/representer/providers_users_details_response.rb
|
280
290
|
- lib/oneaccess/response/representer/research_document_response.rb
|
281
291
|
- lib/oneaccess/response/representer/subscribe_to_updates_response.rb
|
282
292
|
- lib/oneaccess/response/representer/user_entitlement_requests_response.rb
|