oneaccess 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/oneaccess.rb +2 -0
- data/lib/oneaccess/api/base.rb +8 -1
- data/lib/oneaccess/api/entitlement/research/user_requests.rb +28 -0
- data/lib/oneaccess/response/representer/user_requests_response.rb +13 -0
- data/lib/oneaccess/response/user_requests_response.rb +12 -0
- data/oneaccess.gemspec +2 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e961f9529c6796c037eff64b226f0db1e78763ed
|
4
|
+
data.tar.gz: 45cad12764af3ceb1267acb38620c79ba82c3126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1407474d5289150000ba88aa0e6bb5bc842c7a83187ba945a5ad22dab1b0a1bf61730432c55be0945a6fd5743ca7c68b6e2f6ef82a135bc64e21c85ed53b327a
|
7
|
+
data.tar.gz: ab59f14656af75386669744314147a0ce4805a803b3a64a4b3d8d06e6a0add59be3f3dc39e0df471cbb7b13b4f8d1826562ec54e7409e768109a94a4407d146c
|
data/README.md
CHANGED
@@ -152,3 +152,23 @@ resp.data.type #=> type of the Organization (Unspecified = 0, Buyside = 1, Sells
|
|
152
152
|
resp.data.main_address #=> instance of ONEAccess::DataObject::Address
|
153
153
|
resp.data.addresses #=> Array of instances of ONEAccess::DataObject::Address
|
154
154
|
```
|
155
|
+
|
156
|
+
### Research Entitlement
|
157
|
+
|
158
|
+
### Create an Research Entitlement request
|
159
|
+
|
160
|
+
Official documentation: http://apidocs.oneaccess.io/docs/entitlmentresearchuserrequestscreate
|
161
|
+
|
162
|
+
Creates a new Research Entitlement Request for the given User.
|
163
|
+
|
164
|
+
#### How to use
|
165
|
+
```ruby
|
166
|
+
begin
|
167
|
+
resp = ONEAccess::API::Entitlement::Research::UserRequests.create(user_id:'123', sell_side_org_id:'456',
|
168
|
+
sales_contact_first_name:'John', sales_contact_last_name:'Doe', sales_contact_email:'john.doe@example.com')
|
169
|
+
|
170
|
+
resp.data #=> ID of the new Request
|
171
|
+
rescue ONEAccess::Error::APIError => e
|
172
|
+
puts "Error creating the Research Entitlement Request: #{e}"
|
173
|
+
end
|
174
|
+
```
|
data/lib/oneaccess.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "representable"
|
3
4
|
|
4
5
|
require_relative "./oneaccess/configuration"
|
@@ -16,6 +17,7 @@ require_relative "./oneaccess/api/symbology"
|
|
16
17
|
require_relative "./oneaccess/api/references"
|
17
18
|
require_relative "./oneaccess/api/entitlement/organization/product_group"
|
18
19
|
require_relative "./oneaccess/api/entitlement/user/product_group"
|
20
|
+
require_relative "./oneaccess/api/entitlement/research/user_requests"
|
19
21
|
|
20
22
|
module ONEAccess
|
21
23
|
def self.configure
|
data/lib/oneaccess/api/base.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "rest-client"
|
3
4
|
require "json"
|
4
5
|
require_relative "../response/api_error"
|
@@ -14,9 +15,15 @@ module ONEAccess
|
|
14
15
|
raise create_api_error(e)
|
15
16
|
end
|
16
17
|
|
18
|
+
def send_post(method, body)
|
19
|
+
RestClient.post(api_url(method), body.to_json, { content_type: :json }.merge(auth_headers))
|
20
|
+
rescue RestClient::Exception => e
|
21
|
+
raise create_api_error(e)
|
22
|
+
end
|
23
|
+
|
17
24
|
def resource_api_path
|
18
25
|
const_get("RESOURCE_API_PATH")
|
19
|
-
rescue
|
26
|
+
rescue StandardError
|
20
27
|
nil
|
21
28
|
end
|
22
29
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../response/user_requests_response"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module API
|
7
|
+
module Entitlement
|
8
|
+
module Research
|
9
|
+
class UserRequests < Base
|
10
|
+
api_path "/entitlement/research/userRequests"
|
11
|
+
|
12
|
+
def self.create(user_id:, sell_side_org_id:, sales_contact_first_name: nil, sales_contact_last_name: nil,
|
13
|
+
sales_contact_email: nil)
|
14
|
+
response = send_post("create",
|
15
|
+
UserId: user_id,
|
16
|
+
SellSideOrgId: sell_side_org_id,
|
17
|
+
SalesContact: {
|
18
|
+
FirstName: sales_contact_first_name,
|
19
|
+
LastName: sales_contact_last_name,
|
20
|
+
Email: sales_contact_email
|
21
|
+
}.reject { |_, value| value.nil? })
|
22
|
+
Response::UserRequestsResponse.from_json(response.body)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
4
|
+
require_relative "./representer/user_requests_response"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module Response
|
8
|
+
class UserRequestsResponse < BaseResponse
|
9
|
+
represented_by Representer::UserRequestsResponse
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/oneaccess.gemspec
CHANGED
@@ -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.
|
5
|
-
s.date = "
|
4
|
+
s.version = "0.1.7"
|
5
|
+
s.date = "2018-01-08"
|
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.
|
4
|
+
version: 0.1.7
|
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:
|
11
|
+
date: 2018-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- lib/oneaccess.rb
|
184
184
|
- lib/oneaccess/api/base.rb
|
185
185
|
- lib/oneaccess/api/entitlement/organization/product_group.rb
|
186
|
+
- lib/oneaccess/api/entitlement/research/user_requests.rb
|
186
187
|
- lib/oneaccess/api/entitlement/user/product_group.rb
|
187
188
|
- lib/oneaccess/api/organizations.rb
|
188
189
|
- lib/oneaccess/api/references.rb
|
@@ -241,8 +242,10 @@ files:
|
|
241
242
|
- lib/oneaccess/response/representer/paginated_response.rb
|
242
243
|
- lib/oneaccess/response/representer/product_groups_response.rb
|
243
244
|
- lib/oneaccess/response/representer/research_document_response.rb
|
245
|
+
- lib/oneaccess/response/representer/user_requests_response.rb
|
244
246
|
- lib/oneaccess/response/representer/user_response.rb
|
245
247
|
- lib/oneaccess/response/research_document_response.rb
|
248
|
+
- lib/oneaccess/response/user_requests_response.rb
|
246
249
|
- lib/oneaccess/response/user_response.rb
|
247
250
|
- lib/oneaccess/serializable.rb
|
248
251
|
- oneaccess.gemspec
|