oneaccess 0.4.0 → 0.4.1

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: 98c49abcbd54c5f94a0cae5a674d32fcf2b01fe5
4
- data.tar.gz: a3c7d2c25eb637b21b7cf29016f1cafd8b3a631e
3
+ metadata.gz: 2868f20c852ab78bc620e29bb61851b66103066f
4
+ data.tar.gz: 62edeb280cb450557256e792342826724c85594f
5
5
  SHA512:
6
- metadata.gz: c66c7f5f83dd83ac954b25df379d02c21b6cc6728365f5d74af08b56cb5bac04660b357f84731fe7fa21c529e8a6c8dda4d3f745e11eb95c66dc9230c9f9cebe
7
- data.tar.gz: 008d4f2c2f77d91158727aab68100abcd66c753692a2d8e103ca5bf13b11b5bd878371dbf2f7274261ba3bc3f22e2dd261400a5c406cadbe6be5e3d33c8644ac
6
+ metadata.gz: a14734ffc4bf1541f592f0950459f42f88801100554ff8e61cffe37b268c1312f6a035db83360209c57661e3fc5592d238d1438407a3db702968a6e4460b7141
7
+ data.tar.gz: ca38b4812ca8e1ceb42368e8578cf5b87f6dafb74dce1dcd26bc63521a9a7adcade373c0b8a591b6943578b5160a04b632fe3c143aee2677324413d738c7d436
data/Dockerfile CHANGED
@@ -4,7 +4,7 @@ ENV APP_HOME oneaccess-rb
4
4
  ENV PATH=$APP_HOME/bin:$PATH
5
5
 
6
6
  RUN gem install bundler
7
- ENV BUNDLE_JOBS=4
7
+ ENV BUNDLE_PATH=/bundle BUNDLE_JOBS=4
8
8
 
9
9
  ADD . $APP_HOME
10
10
  WORKDIR $APP_HOME
data/README.md CHANGED
@@ -246,3 +246,17 @@ rescue ONEAccess::Error::APIError => e
246
246
  puts "Error getting the list of contributors"
247
247
  end
248
248
  ```
249
+
250
+ ### Create Inducement _(/providers/inducements)_
251
+
252
+ Reference endpoint to create inducements for a given research.
253
+
254
+ #### How to use:
255
+ ```ruby
256
+ begin
257
+ resp = ONEAccess::API::V3_0::Providers.inducements(recipient_user_id: 186, sender_email: "admin@admin.com", subject: "Inducement", email_body: "This email is an inducement.", receive_date: "2018-02-21 19:03:12" )
258
+ resp #=> instance of ONEAccess::Response::InducementResponse
259
+ rescue ONEAccess::Error::APIError => e
260
+ puts "Error creating the inducement"
261
+ end
262
+ ```
data/docker-compose.yml CHANGED
@@ -3,10 +3,15 @@ version: '3'
3
3
  services:
4
4
  test:
5
5
  build: .
6
- command: bash -c 'rubocop && rspec'
6
+ command: bash -c 'bundle install && rubocop && rspec'
7
7
  volumes:
8
8
  - .:/oneaccess-rb
9
- - bundler-cache:/usr/local/bundle
9
+ - bundler-cache:/bundle
10
+
11
+ bundle:
12
+ image: tianon/true
13
+ volumes:
14
+ - bundler-cache:/bundle
10
15
 
11
16
  volumes:
12
17
  bundler-cache:
data/lib/oneaccess.rb CHANGED
@@ -27,6 +27,7 @@ require_relative "./oneaccess/api/v1_1/entitlement/research/user_requests"
27
27
 
28
28
  require_relative "./oneaccess/api/v3_0/base"
29
29
  require_relative "./oneaccess/api/v3_0/references"
30
+ require_relative "./oneaccess/api/v3_0/providers"
30
31
 
31
32
  module ONEAccess
32
33
  def self.configure
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "rest-client"
4
4
  require "json"
5
+ require_relative "../response/response_factory"
5
6
  require_relative "../response/api_error"
6
7
  require_relative "../error/api_error"
7
8
 
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../response/inducement_response"
4
+
5
+ module ONEAccess
6
+ module API
7
+ module V3_0 # rubocop:disable Style/ClassAndModuleCamelCase
8
+ class Providers < Base
9
+ api_path "/providers"
10
+
11
+ class << self
12
+ def inducements(recipient_user_id:, sender_email:, subject:, email_body:, receive_date:)
13
+ params = {
14
+ recipientuserid: recipient_user_id,
15
+ senderemail: sender_email,
16
+ subject: subject,
17
+ emailbody: email_body,
18
+ receivedate: receive_date
19
+ }.reject { |_, v| v.nil? }
20
+
21
+ resp = send_post("inducements", params)
22
+
23
+ Response::InducementResponse.from_json(resp.body)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+ require_relative "./representer/inducement"
3
+
4
+ module ONEAccess
5
+ module DataObject
6
+ class Inducement
7
+ extend Serializable
8
+
9
+ represented_by Representer::Inducement
10
+
11
+ attr_accessor :receive_date
12
+ attr_accessor :provider_org_id
13
+ attr_accessor :email_inducement_id
14
+ attr_accessor :recipient_user_id
15
+ attr_accessor :sender_user_id
16
+ attr_accessor :email_inducement_status_id
17
+ attr_accessor :body
18
+ attr_accessor :processed_date
19
+ attr_accessor :subject
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ONEAccess
4
+ module DataObject
5
+ module Representer
6
+ class Inducement < Representable::Decorator
7
+ include Representable::JSON
8
+
9
+ property :receive_date, as: :ReceiveDate, type: Time,
10
+ parse_filter: ->(value, _) { value && value.size.positive? ? Time.parse(value) : nil }
11
+ property :provider_org_id, as: :ProviderOrgId, type: Integer
12
+ property :email_inducement_id, as: :EmailInducementId, type: Integer
13
+ property :recipient_user_id, as: :RecipientUserId, type: Integer
14
+ property :sender_user_id, as: :SenderUserId, type: Integer
15
+ property :email_inducement_status_id, as: :EmailInducementStatusId, type: Integer
16
+ property :body, as: :Body, type: String
17
+ property :processed_date, as: :ProcessedDate, type: Time,
18
+ parse_filter: ->(value, _) { value && value.size.positive? ? Time.parse(value) : nil }
19
+ property :subject, as: :Subject, type: String
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./base_response"
4
+ require_relative "./representer/inducement_response"
5
+
6
+ module ONEAccess
7
+ module Response
8
+ class InducementResponse < BaseResponse
9
+ represented_by Representer::InducementResponse
10
+
11
+ attr_accessor :email_inducement
12
+ attr_accessor :message
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./base_response"
4
+ require_relative "../../data_object/inducement"
5
+ require_relative "../../data_object/representer/inducement"
6
+
7
+ module ONEAccess
8
+ module Response
9
+ module Representer
10
+ class InducementResponse < BaseResponse
11
+ property :email_inducement, as: :EmailInducement,
12
+ decorator: DataObject::Representer::Inducement,
13
+ class: DataObject::Inducement
14
+ property :message, as: :Message
15
+ end
16
+ end
17
+ end
18
+ end
data/oneaccess.gemspec CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "oneaccess"
4
- s.version = "0.4.0"
5
- s.date = "2018-02-06"
4
+ s.version = "0.4.1"
5
+ s.date = "2018-03-13"
6
6
  s.summary = "ONEAccess API wrapper"
7
7
  s.description = "Easily communicate with ONEAccess API"
8
- s.homepage = "https://github.com/AlphaExchange/rixml"
8
+ s.homepage = "https://github.com/AlphaExchange/oneaccess-rb"
9
9
  s.authors = ["Alex Correia Santos"]
10
10
  s.email = ["alex@alpha-exchange.com"]
11
11
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
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.0
4
+ version: 0.4.1
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-02-06 00:00:00.000000000 Z
11
+ date: 2018-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,6 +198,7 @@ files:
198
198
  - lib/oneaccess/api/v1_1/symbology.rb
199
199
  - lib/oneaccess/api/v1_1/user.rb
200
200
  - lib/oneaccess/api/v3_0/base.rb
201
+ - lib/oneaccess/api/v3_0/providers.rb
201
202
  - lib/oneaccess/api/v3_0/references.rb
202
203
  - lib/oneaccess/configuration.rb
203
204
  - lib/oneaccess/data_object/address.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/oneaccess/data_object/contributor.rb
208
209
  - lib/oneaccess/data_object/country.rb
209
210
  - lib/oneaccess/data_object/global_region.rb
211
+ - lib/oneaccess/data_object/inducement.rb
210
212
  - lib/oneaccess/data_object/industry.rb
211
213
  - lib/oneaccess/data_object/investor.rb
212
214
  - lib/oneaccess/data_object/meta.rb
@@ -221,6 +223,7 @@ files:
221
223
  - lib/oneaccess/data_object/representer/contributor.rb
222
224
  - lib/oneaccess/data_object/representer/country.rb
223
225
  - lib/oneaccess/data_object/representer/global_region.rb
226
+ - lib/oneaccess/data_object/representer/inducement.rb
224
227
  - lib/oneaccess/data_object/representer/industry.rb
225
228
  - lib/oneaccess/data_object/representer/investor.rb
226
229
  - lib/oneaccess/data_object/representer/meta.rb
@@ -255,6 +258,7 @@ files:
255
258
  - lib/oneaccess/response/company_response.rb
256
259
  - lib/oneaccess/response/contributors_response.rb
257
260
  - lib/oneaccess/response/countries_response.rb
261
+ - lib/oneaccess/response/inducement_response.rb
258
262
  - lib/oneaccess/response/industries_response.rb
259
263
  - lib/oneaccess/response/investors_response.rb
260
264
  - lib/oneaccess/response/organization_response.rb
@@ -267,6 +271,7 @@ files:
267
271
  - lib/oneaccess/response/representer/company_response.rb
268
272
  - lib/oneaccess/response/representer/contributors_response.rb
269
273
  - lib/oneaccess/response/representer/countries_response.rb
274
+ - lib/oneaccess/response/representer/inducement_response.rb
270
275
  - lib/oneaccess/response/representer/industries_response.rb
271
276
  - lib/oneaccess/response/representer/investors_response.rb
272
277
  - lib/oneaccess/response/representer/organization_response.rb
@@ -285,7 +290,7 @@ files:
285
290
  - lib/oneaccess/serializable.rb
286
291
  - oneaccess.gemspec
287
292
  - release
288
- homepage: https://github.com/AlphaExchange/rixml
293
+ homepage: https://github.com/AlphaExchange/oneaccess-rb
289
294
  licenses:
290
295
  - MIT
291
296
  metadata: {}