DealMakerAPI 0.93.2 → 0.93.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,219 +10,263 @@ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
- require 'spec_helper'
14
-
15
- describe DealMakerAPI::ApiClient do
16
- context 'initialization' do
17
- context 'URL stuff' do
18
- context 'host' do
19
- it 'removes http from host' do
20
- DealMakerAPI.configure { |c| c.host = 'http://example.com' }
21
- expect(DealMakerAPI::Configuration.default.host).to eq('example.com')
22
- end
23
-
24
- it 'removes https from host' do
25
- DealMakerAPI.configure { |c| c.host = 'https://wookiee.com' }
26
- expect(DealMakerAPI::ApiClient.default.config.host).to eq('wookiee.com')
27
- end
28
-
29
- it 'removes trailing path from host' do
30
- DealMakerAPI.configure { |c| c.host = 'hobo.com/v4' }
31
- expect(DealMakerAPI::Configuration.default.host).to eq('hobo.com')
32
- end
33
- end
34
-
35
- context 'base_path' do
36
- it "prepends a slash to base_path" do
37
- DealMakerAPI.configure { |c| c.base_path = 'v4/dog' }
38
- expect(DealMakerAPI::Configuration.default.base_path).to eq('/v4/dog')
39
- end
40
-
41
- it "doesn't prepend a slash if one is already there" do
42
- DealMakerAPI.configure { |c| c.base_path = '/v4/dog' }
43
- expect(DealMakerAPI::Configuration.default.base_path).to eq('/v4/dog')
44
- end
45
-
46
- it "ends up as a blank string if nil" do
47
- DealMakerAPI.configure { |c| c.base_path = nil }
48
- expect(DealMakerAPI::Configuration.default.base_path).to eq('')
49
- end
50
- end
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DealMakerAPI
17
+ class PostDealIncentivePlanRequest
18
+ # The incentive plan active date.
19
+ attr_accessor :active_at
20
+
21
+ # The incentive plan funded by offset in days.
22
+ attr_accessor :funded_by_offset
23
+
24
+ # The incentive plan tier percentage.
25
+ attr_accessor :tiers_incentive_percentage
26
+
27
+ # The incentive plan tier end date.
28
+ attr_accessor :tiers_end_at
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'active_at' => :'active_at',
34
+ :'funded_by_offset' => :'funded_by_offset',
35
+ :'tiers_incentive_percentage' => :'tiers[incentive_percentage]',
36
+ :'tiers_end_at' => :'tiers[end_at]'
37
+ }
51
38
  end
52
- end
53
-
54
- describe 'params_encoding in #build_request' do
55
- let(:config) { DealMakerAPI::Configuration.new }
56
- let(:api_client) { DealMakerAPI::ApiClient.new(config) }
57
39
 
58
- it 'defaults to nil' do
59
- expect(DealMakerAPI::Configuration.default.params_encoding).to eq(nil)
60
- expect(config.params_encoding).to eq(nil)
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
61
44
 
62
- request = api_client.build_request(:get, '/test')
63
- expect(request.options[:params_encoding]).to eq(nil)
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'active_at' => :'Time',
49
+ :'funded_by_offset' => :'Integer',
50
+ :'tiers_incentive_percentage' => :'Array<Float>',
51
+ :'tiers_end_at' => :'Array<Time>'
52
+ }
64
53
  end
65
54
 
66
- it 'can be customized' do
67
- config.params_encoding = :multi
68
- request = api_client.build_request(:get, '/test')
69
- expect(request.options[:params_encoding]).to eq(:multi)
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
70
59
  end
71
- end
72
60
 
73
- describe 'timeout in #build_request' do
74
- let(:config) { DealMakerAPI::Configuration.new }
75
- let(:api_client) { DealMakerAPI::ApiClient.new(config) }
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::PostDealIncentivePlanRequest` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::PostDealIncentivePlanRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
76
75
 
77
- it 'defaults to 0' do
78
- expect(DealMakerAPI::Configuration.default.timeout).to eq(0)
79
- expect(config.timeout).to eq(0)
76
+ if attributes.key?(:'active_at')
77
+ self.active_at = attributes[:'active_at']
78
+ else
79
+ self.active_at = nil
80
+ end
80
81
 
81
- request = api_client.build_request(:get, '/test')
82
- expect(request.options[:timeout]).to eq(0)
83
- end
82
+ if attributes.key?(:'funded_by_offset')
83
+ self.funded_by_offset = attributes[:'funded_by_offset']
84
+ else
85
+ self.funded_by_offset = 0
86
+ end
84
87
 
85
- it 'can be customized' do
86
- config.timeout = 100
87
- request = api_client.build_request(:get, '/test')
88
- expect(request.options[:timeout]).to eq(100)
88
+ if attributes.key?(:'tiers_incentive_percentage')
89
+ if (value = attributes[:'tiers_incentive_percentage']).is_a?(Array)
90
+ self.tiers_incentive_percentage = value
91
+ end
92
+ else
93
+ self.tiers_incentive_percentage = nil
94
+ end
95
+
96
+ if attributes.key?(:'tiers_end_at')
97
+ if (value = attributes[:'tiers_end_at']).is_a?(Array)
98
+ self.tiers_end_at = value
99
+ end
100
+ else
101
+ self.tiers_end_at = nil
102
+ end
89
103
  end
90
- end
91
104
 
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @active_at.nil?
111
+ invalid_properties.push('invalid value for "active_at", active_at cannot be nil.')
112
+ end
92
113
 
114
+ if @tiers_incentive_percentage.nil?
115
+ invalid_properties.push('invalid value for "tiers_incentive_percentage", tiers_incentive_percentage cannot be nil.')
116
+ end
93
117
 
94
- describe '#deserialize' do
95
- it "handles Array<Integer>" do
96
- api_client = DealMakerAPI::ApiClient.new
97
- headers = { 'Content-Type' => 'application/json' }
98
- response = double('response', headers: headers, body: '[12, 34]')
99
- data = api_client.deserialize(response, 'Array<Integer>')
100
- expect(data).to be_instance_of(Array)
101
- expect(data).to eq([12, 34])
102
- end
118
+ if @tiers_end_at.nil?
119
+ invalid_properties.push('invalid value for "tiers_end_at", tiers_end_at cannot be nil.')
120
+ end
103
121
 
104
- it 'handles Array<Array<Integer>>' do
105
- api_client = DealMakerAPI::ApiClient.new
106
- headers = { 'Content-Type' => 'application/json' }
107
- response = double('response', headers: headers, body: '[[12, 34], [56]]')
108
- data = api_client.deserialize(response, 'Array<Array<Integer>>')
109
- expect(data).to be_instance_of(Array)
110
- expect(data).to eq([[12, 34], [56]])
122
+ invalid_properties
111
123
  end
112
124
 
113
- it 'handles Hash<String, String>' do
114
- api_client = DealMakerAPI::ApiClient.new
115
- headers = { 'Content-Type' => 'application/json' }
116
- response = double('response', headers: headers, body: '{"message": "Hello"}')
117
- data = api_client.deserialize(response, 'Hash<String, String>')
118
- expect(data).to be_instance_of(Hash)
119
- expect(data).to eq(:message => 'Hello')
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ return false if @active_at.nil?
130
+ return false if @tiers_incentive_percentage.nil?
131
+ return false if @tiers_end_at.nil?
132
+ true
120
133
  end
121
- end
122
134
 
123
- describe "#object_to_hash" do
124
- it 'ignores nils and includes empty arrays' do
125
- # uncomment below to test object_to_hash for model
126
- # api_client = DealMakerAPI::ApiClient.new
127
- # _model = DealMakerAPI::ModelName.new
128
- # update the model attribute below
129
- # _model.id = 1
130
- # update the expected value (hash) below
131
- # expected = {id: 1, name: '', tags: []}
132
- # expect(api_client.object_to_hash(_model)).to eq(expected)
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ active_at == o.active_at &&
141
+ funded_by_offset == o.funded_by_offset &&
142
+ tiers_incentive_percentage == o.tiers_incentive_percentage &&
143
+ tiers_end_at == o.tiers_end_at
133
144
  end
134
- end
135
-
136
- describe '#build_collection_param' do
137
- let(:param) { ['aa', 'bb', 'cc'] }
138
- let(:api_client) { DealMakerAPI::ApiClient.new }
139
145
 
140
- it 'works for csv' do
141
- expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
142
150
  end
143
151
 
144
- it 'works for ssv' do
145
- expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [active_at, funded_by_offset, tiers_incentive_percentage, tiers_end_at].hash
146
156
  end
147
157
 
148
- it 'works for tsv' do
149
- expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
150
179
  end
151
180
 
152
- it 'works for pipes' do
153
- expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def self._deserialize(type, value)
186
+ case type.to_sym
187
+ when :Time
188
+ Time.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ # models (e.g. Pet) or oneOf
219
+ klass = DealMakerAPI.const_get(type)
220
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
+ end
154
222
  end
155
223
 
156
- it 'works for multi' do
157
- expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
158
228
  end
159
229
 
160
- it 'fails for invalid collection format' do
161
- expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
162
234
  end
163
- end
164
235
 
165
- describe '#json_mime?' do
166
- let(:api_client) { DealMakerAPI::ApiClient.new }
167
-
168
- it 'works' do
169
- expect(api_client.json_mime?(nil)).to eq false
170
- expect(api_client.json_mime?('')).to eq false
171
-
172
- expect(api_client.json_mime?('application/json')).to eq true
173
- expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
174
- expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
175
246
 
176
- expect(api_client.json_mime?('application/xml')).to eq false
177
- expect(api_client.json_mime?('text/plain')).to eq false
178
- expect(api_client.json_mime?('application/jsonp')).to eq false
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
179
250
  end
180
- end
181
-
182
- describe '#select_header_accept' do
183
- let(:api_client) { DealMakerAPI::ApiClient.new }
184
-
185
- it 'works' do
186
- expect(api_client.select_header_accept(nil)).to be_nil
187
- expect(api_client.select_header_accept([])).to be_nil
188
251
 
189
- expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
190
- expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
191
- expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
192
-
193
- expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
194
- expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
195
268
  end
196
- end
197
-
198
- describe '#select_header_content_type' do
199
- let(:api_client) { DealMakerAPI::ApiClient.new }
200
269
 
201
- it 'works' do
202
- expect(api_client.select_header_content_type(nil)).to be_nil
203
- expect(api_client.select_header_content_type([])).to be_nil
204
-
205
- expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
206
- expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
207
- expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
208
- expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
209
- expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
210
- end
211
270
  end
212
271
 
213
- describe '#sanitize_filename' do
214
- let(:api_client) { DealMakerAPI::ApiClient.new }
215
-
216
- it 'works' do
217
- expect(api_client.sanitize_filename('sun')).to eq('sun')
218
- expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
219
- expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
220
- expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
221
- expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
222
- expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
223
- expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
224
- expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
225
- expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
226
- end
227
- end
228
272
  end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 7.2.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module DealMakerAPI
14
- VERSION = '0.93.2'
14
+ VERSION = '0.93.3'
15
15
  end
data/lib/DealMakerAPI.rb CHANGED
@@ -27,6 +27,7 @@ require 'DealMakerAPI/models/create_deal_setup_request'
27
27
  require 'DealMakerAPI/models/create_shareholder_action_request'
28
28
  require 'DealMakerAPI/models/edit_investor_tags_request'
29
29
  require 'DealMakerAPI/models/generate_url_request'
30
+ require 'DealMakerAPI/models/patch_deal_incentive_plan_request'
30
31
  require 'DealMakerAPI/models/patch_investor_profiles_corporations'
31
32
  require 'DealMakerAPI/models/patch_investor_profiles_corporations_beneficial_owners_inner'
32
33
  require 'DealMakerAPI/models/patch_investor_profiles_individuals'
@@ -34,6 +35,7 @@ require 'DealMakerAPI/models/patch_investor_profiles_joints'
34
35
  require 'DealMakerAPI/models/patch_investor_profiles_trusts'
35
36
  require 'DealMakerAPI/models/patch_investor_profiles_trusts_trustees_inner'
36
37
  require 'DealMakerAPI/models/patch_investor_request'
38
+ require 'DealMakerAPI/models/post_deal_incentive_plan_request'
37
39
  require 'DealMakerAPI/models/post_deals_id_investors'
38
40
  require 'DealMakerAPI/models/post_investor_profiles_corporations'
39
41
  require 'DealMakerAPI/models/post_investor_profiles_corporations_beneficial_owners_inner'
@@ -47,4 +47,31 @@ describe 'IncentivePlanApi' do
47
47
  end
48
48
  end
49
49
 
50
+ # unit tests for patch_deal_incentive_plan
51
+ # Updates incentive plan by deal id
52
+ # Updates an incentive plan for the given deal id with respectve tiers.
53
+ # @param id The deal id.
54
+ # @param incentive_plan_id The deal id.
55
+ # @param [Hash] opts the optional parameters
56
+ # @option opts [PatchDealIncentivePlanRequest] :patch_deal_incentive_plan_request
57
+ # @return [V1EntitiesDealsPriceDetails]
58
+ describe 'patch_deal_incentive_plan test' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
61
+ end
62
+ end
63
+
64
+ # unit tests for post_deal_incentive_plan
65
+ # Creates incentive plan by deal id
66
+ # Creates an incentive plan for the given deal id with respectve tiers.
67
+ # @param id The deal id.
68
+ # @param post_deal_incentive_plan_request
69
+ # @param [Hash] opts the optional parameters
70
+ # @return [V1EntitiesDealsPriceDetails]
71
+ describe 'post_deal_incentive_plan test' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
74
+ end
75
+ end
76
+
50
77
  end
@@ -0,0 +1,66 @@
1
+ =begin
2
+ #DealMaker API
3
+
4
+ ## Introduction Welcome to DealMaker’s Web API v1! This API is RESTful, easy to integrate with, and offers support in 2 different languages. This is the technical documentation for our API. There are tutorials and examples of integrations with our API available on our [knowledge centre](https://help.dealmaker.tech/training-centre) as well. # Libraries - Javascript - Ruby # Authentication To authenticate, add an Authorization header to your API request that contains an access token. Before you [generate an access token](#how-to-generate-an-access-token) your must first [create an application](#create-an-application) on your portal and retrieve the your client ID and secret ## Create an Application DealMaker’s Web API v1 supports the use of OAuth applications. Applications can be generated in your [account](https://app.dealmaker.tech/developer/applications). To create an API Application, click on your user name in the top right corner to open a dropdown menu, and select \"Integrations\". Under the API settings tab, click the `Create New Application` button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-1.png) Name your application and assign the level of permissions for this application ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-2.png) Once your application is created, save in a secure space your client ID and secret. **WARNING**: The secret key will not be visible after you click the close button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-3.png) From the developer tab, you will be able to view and manage all the available applications ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-4.png) Each Application consists of a client id, secret and set of scopes. The scopes define what resources you want to have access to. The client ID and secret are used to generate an access token. You will need to create an application to use API endpoints. ## How to generate an access token After creating an application, you must make a call to obtain a bearer token using the Generate an OAuth token operation. This operation requires the following parameters: `token endpoint` - https://app.dealmaker.tech/oauth/token `grant_type` - must be set to `client_credentials` `client_id` - the Client ID displayed when you created the OAuth application in the previous step `client_secret` - the Client Secret displayed when you created the OAuth application in the previous step `scope` - the scope is established when you created the OAuth application in the previous step Note: The Generate an OAuth token response specifies how long the bearer token is valid for. You should reuse the bearer token until it is expired. When the token is expired, call Generate an OAuth token again to generate a new one. To use the access token, you must set a plain text header named `Authorization` with the contents of the header being “Bearer XXX” where XXX is your generated access token. ### Example #### Postman Here's an example on how to generate the access token with Postman, where `{{CLIENT_ID}}` and `{{CLIENT_SECRET}}` are the values generated after following the steps on [Create an Application](#create-an-application) ![Get access token postman example](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/token-postman.png) # Status Codes ## Content-Type Header All responses are returned in JSON format. We specify this by sending the Content-Type header. ## Status Codes Below is a table containing descriptions of the various status codes we currently support against various resources. Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request. | Status Code | Description | | ----------- | ----------- | | `200` | Success | | `403` | Forbidden | | `404` | Not found | # Pagination Pagination is used to divide large responses is smaller portions (pages). By default, all endpoints return a maximum of 25 records per page. You can change the number of records on a per request basis by passing a `per_page` parameter in the request header parameters. The largest supported `per_page` parameter is 100. When the response exceeds the `per_page` parameter, you can paginate through the records by increasing the `offset` parameter. Example: `offset=25` will return 25 records starting from 26th record. You may also paginate using the `page` parameter to indicate the page number you would like to show on the response. Please review the table below for the input parameters ## Inputs | Parameter | Description | | ---------- | ------------------------------------------------------------------------------- | | `per_page` | Amount of records included on each page (Default is 25) | | `page` | Page number | | `offset` | Amount of records offset on the API request where 0 represents the first record | ## Response Headers | Response Header | Description | | --------------- | -------------------------------------------- | | `X-Total` | Total number of records of response | | `X-Total-Pages` | Total number of pages of response | | `X-Per-Page` | Total number of records per page of response | | `X-Page` | Number of current page | | `X-Next-Page` | Number of next page | | `X-Prev-Page` | Number of previous page | | `X-Offset` | Total number of records offset | # Search and Filtering (The q parameter) The q optional parameter accepts a string as input and allows you to filter the request based on that string. Please note that search strings must be encoded according to ASCII. For example, \"john+investor&#64;dealmaker.tech\" should be passed as “john%2Binvestor%40dealmaker.tech”. There are two main ways to filter with it. ## Keyword filtering Some keywords allow you to filter investors based on a specific “scope” of the investors, for example using the string “Invited” will filter all investors with the status invited, and the keyword “Has attachments” will filter investors with attachments. Here’s a list of possible keywords and the “scope” each one of the keywords filters by: | Keywords | Scope | Decoded Example | Encoded Example | | ---------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | Signed on \\(date range\\) | Investors who signed in the provided date range | Signed on (date range) [2020-07-01:2020-07-31] | `Signed%20on%20%28date%20range%29%20%5B2020-07-01%3A2020-07-31%5D` | | Enabled for countersignature on \\(date range\\) | Investors who were enabled for counter signature in the provided date range | Enabled for countersignature on (date range) [2022-05-24:2022-05-25] | `Enabled%20for%20countersignature%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Accepted on \\(date range\\) | Investors accepted in the provided date rage | Accepted on (date range) [2022-05-24:2022-05-25] | `Accepted%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Offline | Investors added to the deal offline | Offline | `Offline` | | Online | Investors added to the deal online | Online | `Online` | | Signed | Investors who signed their agreement | Signed | `Signed` | | Waiting for countersignature | Investors who have signed and are waiting for counter signature | Waiting for countersignature | `Waiting%20for%20countersignature` | | Invited | Investors on the Invited Status | Invited | `Invited` | | Accepted | Investors in the Accepted Status | Accepted | `Accepted` | | Questionnaire in progress | All Investors who have not finished completing the questionnaire | Questionnaire in progress | `Questionnaire%20in%20progress` | | Has attachments | All Investors with attachments | Has attachments | `Has%20attachments` | | Has notes | All Investors with notes | Has notes | `Has%20notes` | | Waiting for co-signature | Investors who have signed and are waiting for co-signature | Waiting for co-signature | `Waiting%20for%20co-signature` | | Background Check Approved | Investors with approved background check | Background Check Approved | `Background%20Check%20Approved` | | Document Review Pending | Investors with pending review | Document Review Pending | `Document%20Review%20Pending` | | Document Upload Pending | Investors with pending documents to upload | Document Upload Pending | `Document%20Upload%20Pending` | | Required adjudicator review | Investors who are required to be review by the adjudicator | Required adjudicator review | `Required%20adjudicator%20review` | --- **NOTE** Filtering keywords are case sensitive and need to be encoded --- ## Search String Any value for the parameter which does not match one of the keywords listed above, will use fields like `first name`, `last name`, `email`, `tags` to search for the investor. For example, if you search “Robert”, because this does not match one of the keywords listed above, it will then return any investors who have the string “Robert” in their name, email, or tags fields. # Versioning The latest version is v1. The version can be updated on the `Accept` header, just set the version as stated on the following example: ``` Accept:application/vnd.dealmaker-v1+json ``` | Version | Accept Header | | ------- | ----------------------------------- | | `v1` | application/vnd.dealmaker-`v1`+json | # SDK’s For instruction on installing SDKs, please view the following links - [Javascript](https://github.com/DealMakerTech/api/tree/main/v1/clients/javascript) - [Ruby](https://github.com/DealMakerTech/api/tree/main/v1/clients/ruby) # Webhooks Our webhooks functionality allows clients to automatically receive updates on a deal's investor data. Some of the data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - State (Draft, Invited, Signed, Accepted, Waiting, Inactive) Via webhooks clients can subscribe to the following events as they happen on Dealmaker: - Investor is created - Investor details are updated (any of the investor details above change or are updated) - Investor has signed their agreement - Invertor fully funded their investment - Investor has been accepted - Investor is deleted A URL supplied by the client will receive all the events with the information as part of the payload. Clients are able to add and update the URL within DealMaker. ## Configuration For a comprehensive guide on how to configure Webhooks please visit our support article: [Configuring Webhooks on DealMaker – DealMaker Support](https://help.dealmaker.tech/configuring-webhooks-on-dealmaker). As a developer user on DealMaker, you are able to configure webhooks by following the steps below: 1. Sign into Dealmaker 2. Go to **“Your profile”** in the top right corner 3. Access an **“Integrations”** configuration via the left menu 4. The developer configures webhooks by including: - The HTTPS URL where the request will be sent - Optionally, a security token that we would use to build a SHA1 hash that would be included in the request headers. The name of the header is `X-DealMaker-Signature`. If the secret is not specified, the hash won’t be included in the headers. - The Deal(s) to include in the webhook subscription - An email address that will be used to notify about errors. 5. The developers can disable webhooks temporarily if needed ## Specification ### Events The initial set of events will be related to the investor. The events are: 1. `investor.created` - Triggers every time a new investor is added to a deal 2. `investor.updated` - Triggers on updates to any of the following fields: - Status - Name - Email - (this is a user field so we trigger event for all investors with webhook subscription) - Allocated Amount - Investment Amount - Accredited investor fields - Adding or removing attachments - Tags - When the investor status is signed, the payload also includes a link to the signed document; the link expires after 30 minutes 3. `investor.signed` - Triggers when the investor signs their subscription agreement (terms and conditions) - When this happens the investor.state becomes `signed` - This event includes the same fields as the `investor.updated` event 4. `investor.funded` - Triggers when the investor becomes fully funded - This happens when the investor.funded_state becomes `funded` - This event includes the same fields as the `investor.updated` event 5. `investor.accepted` - Triggers when the investor is countersigned - When this happens the investor.state becomes `accepted` - This event includes the same fields as the `investor.updated` event 6. `investor.deleted` - Triggers when the investor is removed from the deal - The investor key of the payload only includes investor ID - The deal is not included in the payload. Due to our implementation it’s impossible to retrieve the deal the investor was part of ### Requests - The request is a `POST` - The payload’s `content-type` is `application/json` - Only `2XX` responses are considered successful. In the event of a different response, we consider it failed and queue the event for retry - We retry the request five times, after the initial attempt. Doubling the waiting time between intervals with each try. The first retry happens after 30 seconds, then 60 seconds, 2 mins, 4 minutes, and 8 minutes. This timing scheme gives the receiver about 1 hour if all the requests fail - If an event fails all the attempts to be delivered, we send an email to the address that the user configured ### Payload #### Common Properties There will be some properties that are common to all the events on the system. | Key | Type | Description | | ----------------- | ------ | -------------------------------------------------------------------------------------- | | event | String | The event that triggered the call | | event_id | String | A unique identifier for the event | | deal<sup>\\*</sup> | Object | The deal in which the event occurred. please see below for an example on the deal object<sup>\\*\\*</sup> | <sup>\\*</sup>This field is not included when deleting a resource <sup>\\*\\*</sup> Sample Deal Object in the webhook payload ```json \"deal\": { \"id\": 0, \"title\": \"string\", \"created_at\": \"2022-12-06T18:14:44.000Z\", \"updated_at\": \"2022-12-08T12:46:48.000Z\", \"state\": \"string\", \"currency\": \"string\", \"security_type\": \"string\", \"price_per_security\": 0.00, \"deal_type\": \"string\", \"minimum_investment\": 0, \"maximum_investment\": 0, \"issuer\": { \"id\": 0, \"name\": \"string\" }, \"enterprise\": { \"id\": 0, \"name\": \"string\" } } ``` #### Common Properties (investor scope) By design, we have incorporated on the webhooks payload the same investor-related fields included in the Investor model, for reference on the included fields, their types and values please click [here](https://docs.dealmaker.tech/#tag/investor_model). This will allow you to get all the necessary information you need about a particular investor without having to call the Get Investor by ID endpoint. | #### Investor State Here is a brief description of each investor state: - **Draft:** the investor is added to the platform but hasn't been invited yet and cannot access the portal - **Invited:** the investor was added to the platform but hasn’t completed the questionnaire - **Signed:** the investor signed the document (needs approval from Lawyer or Reviewer before countersignature) - **Waiting:** the investor was approved for countersignature by any of the Lawyers or Reviewers in the deal - **Accepted:** the investor's agreement was countersigned by the Signatory - **Inactive** the investor is no longer eligible to participate in the offering. This may be because their warrant expired, they requested a refund, or they opted out of the offering #### Update Delay Given the high number of updates our platform performs on any investor, we’ve added a cool down period on update events that allows us to “group” updates and trigger only one every minute. In consequence, update events will be delivered 1 minute after the initial request was made and will include the latest version of the investor data at delivery time.
5
+
6
+ The version of the OpenAPI document: 1.75.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for DealMakerAPI::PatchDealIncentivePlanRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe DealMakerAPI::PatchDealIncentivePlanRequest do
21
+ let(:instance) { DealMakerAPI::PatchDealIncentivePlanRequest.new }
22
+
23
+ describe 'test an instance of PatchDealIncentivePlanRequest' do
24
+ it 'should create an instance of PatchDealIncentivePlanRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(DealMakerAPI::PatchDealIncentivePlanRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "active_at"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "funded_by_offset"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "tiers_id"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "tiers__delete"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ describe 'test attribute "tiers_incentive_percentage"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
60
+ describe 'test attribute "tiers_end_at"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
63
+ end
64
+ end
65
+
66
+ end