Class: DealMakerAPI::V1EntitiesInvestor

Inherits:
Object
  • Object
show all
Defined in:
lib/DealMakerAPI/models/v1_entities_investor.rb

Overview

V1_Entities_Investor model

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ V1EntitiesInvestor

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 206

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::V1EntitiesInvestor` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::V1EntitiesInvestor`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'user')
    self.user = attributes[:'user']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'allocation_unit')
    self.allocation_unit = attributes[:'allocation_unit']
  end

  if attributes.key?(:'state')
    self.state = attributes[:'state']
  end

  if attributes.key?(:'funding_state')
    self.funding_state = attributes[:'funding_state']
  end

  if attributes.key?(:'funds_pending')
    self.funds_pending = attributes[:'funds_pending']
  end

  if attributes.key?(:'beneficial_address')
    self.beneficial_address = attributes[:'beneficial_address']
  end

  if attributes.key?(:'phone_number')
    self.phone_number = attributes[:'phone_number']
  end

  if attributes.key?(:'investor_currency')
    self.investor_currency = attributes[:'investor_currency']
  end

  if attributes.key?(:'number_of_securities')
    self.number_of_securities = attributes[:'number_of_securities']
  end

  if attributes.key?(:'investment_value')
    self.investment_value = attributes[:'investment_value']
  end

  if attributes.key?(:'allocated_amount')
    self.allocated_amount = attributes[:'allocated_amount']
  end

  if attributes.key?(:'funds_value')
    self.funds_value = attributes[:'funds_value']
  end

  if attributes.key?(:'access_link')
    self.access_link = attributes[:'access_link']
  end

  if attributes.key?(:'subscription_id')
    self.subscription_id = attributes[:'subscription_id']
  end

  if attributes.key?(:'subscription_agreement')
    self.subscription_agreement = attributes[:'subscription_agreement']
  end

  if attributes.key?(:'attachments')
    self.attachments = attributes[:'attachments']
  end

  if attributes.key?(:'background_check_searches')
    self.background_check_searches = attributes[:'background_check_searches']
  end

  if attributes.key?(:'verification_status')
    self.verification_status = attributes[:'verification_status']
  end

  if attributes.key?(:'warrant_expiry_date')
    self.warrant_expiry_date = attributes[:'warrant_expiry_date']
  end

  if attributes.key?(:'warrant_certificate_number')
    self.warrant_certificate_number = attributes[:'warrant_certificate_number']
  end

  if attributes.key?(:'ranking_score')
    self.ranking_score = attributes[:'ranking_score']
  end

  if attributes.key?(:'investor_profile')
    self.investor_profile = attributes[:'investor_profile']
  end

  if attributes.key?(:'investor_profile_id')
    self.investor_profile_id = attributes[:'investor_profile_id']
  end

  if attributes.key?(:'checkout_state')
    self.checkout_state = attributes[:'checkout_state']
  end

  if attributes.key?(:'legacy_flow_link')
    self.legacy_flow_link = attributes[:'legacy_flow_link']
  end
end

Instance Attribute Details

The access link for the investor. This is the access link for the specific investment, not the user. If the same user has multiple investments, each one will have a different access link. Please note that this access link expires every hour. In order to redirect the investor into their authentication screen, use the app.dealmaker.tech/deals/{deal_id}/investors/{investor_id}/otp_access url.



67
68
69
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 67

def access_link
  @access_link
end

#allocated_amountObject

The amount allocated.



61
62
63
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 61

def allocated_amount
  @allocated_amount
end

#allocation_unitObject

The allocation unit.



34
35
36
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 34

def allocation_unit
  @allocation_unit
end

#attachmentsObject

Returns the value of attribute attachments.



74
75
76
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 74

def attachments
  @attachments
end

#background_check_searchesObject

Returns the value of attribute background_check_searches.



76
77
78
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 76

def background_check_searches
  @background_check_searches
end

#beneficial_addressObject

The address.



46
47
48
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 46

def beneficial_address
  @beneficial_address
end

#checkout_stateObject

Current state on the checkout page.



96
97
98
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 96

def checkout_state
  @checkout_state
end

#created_atObject

The creation time.



25
26
27
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 25

def created_at
  @created_at
end

#funding_stateObject

The funding state.



40
41
42
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 40

def funding_state
  @funding_state
end

#funds_pendingObject

True if any funds are pending; false otherwise.



43
44
45
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 43

def funds_pending
  @funds_pending
end

#funds_valueObject

The current amount that has been funded.



64
65
66
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 64

def funds_value
  @funds_value
end

#idObject

Investor id.



20
21
22
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 20

def id
  @id
end

#investment_valueObject

The current investment value.



58
59
60
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 58

def investment_value
  @investment_value
end

#investor_currencyObject

The investor currency.



52
53
54
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 52

def investor_currency
  @investor_currency
end

#investor_profileObject

Returns the value of attribute investor_profile.



90
91
92
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 90

def investor_profile
  @investor_profile
end

#investor_profile_idObject

The investor profile id.



93
94
95
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 93

def investor_profile_id
  @investor_profile_id
end

The legacy link for the investor. If the investor is already on the legacy flow, this link will be null.



99
100
101
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 99

def legacy_flow_link
  @legacy_flow_link
end

#nameObject

The full name of the investor.



31
32
33
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 31

def name
  @name
end

#number_of_securitiesObject

The number of securities.



55
56
57
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 55

def number_of_securities
  @number_of_securities
end

#phone_numberObject

The beneficial phone number associated with the investor. If there is no phone number, this returns the phone number associated with the user profile.



49
50
51
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 49

def phone_number
  @phone_number
end

#ranking_scoreObject

A value ‘[0, 1]` that represents the propensity for the investor to complete payment for the investment. A larger value indicates a higher likelihood of payment, as predicted by DealMaker’s machine learning algorithm. This field will only populate if DealMaker Compass is enabled for a deal and the investor funds_state value is not funded or overfunded



88
89
90
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 88

def ranking_score
  @ranking_score
end

#stateObject

The state.



37
38
39
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 37

def state
  @state
end

#subscription_agreementObject

Returns the value of attribute subscription_agreement.



72
73
74
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 72

def subscription_agreement
  @subscription_agreement
end

#subscription_idObject

The investor subscription id.



70
71
72
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 70

def subscription_id
  @subscription_id
end

#updated_atObject

The last update time.



28
29
30
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 28

def updated_at
  @updated_at
end

#userObject

Returns the value of attribute user.



22
23
24
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 22

def user
  @user
end

#verification_statusObject

The current 506c verification state.



79
80
81
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 79

def verification_status
  @verification_status
end

#warrant_certificate_numberObject

The warrant certificate number.



85
86
87
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 85

def warrant_certificate_number
  @warrant_certificate_number
end

#warrant_expiry_dateObject

The warrant expiry date.



82
83
84
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 82

def warrant_expiry_date
  @warrant_expiry_date
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 486

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = DealMakerAPI.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



159
160
161
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 159

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 124

def self.attribute_map
  {
    :'id' => :'id',
    :'user' => :'user',
    :'created_at' => :'created_at',
    :'updated_at' => :'updated_at',
    :'name' => :'name',
    :'allocation_unit' => :'allocation_unit',
    :'state' => :'state',
    :'funding_state' => :'funding_state',
    :'funds_pending' => :'funds_pending',
    :'beneficial_address' => :'beneficial_address',
    :'phone_number' => :'phone_number',
    :'investor_currency' => :'investor_currency',
    :'number_of_securities' => :'number_of_securities',
    :'investment_value' => :'investment_value',
    :'allocated_amount' => :'allocated_amount',
    :'funds_value' => :'funds_value',
    :'access_link' => :'access_link',
    :'subscription_id' => :'subscription_id',
    :'subscription_agreement' => :'subscription_agreement',
    :'attachments' => :'attachments',
    :'background_check_searches' => :'background_check_searches',
    :'verification_status' => :'verification_status',
    :'warrant_expiry_date' => :'warrant_expiry_date',
    :'warrant_certificate_number' => :'warrant_certificate_number',
    :'ranking_score' => :'ranking_score',
    :'investor_profile' => :'investor_profile',
    :'investor_profile_id' => :'investor_profile_id',
    :'checkout_state' => :'checkout_state',
    :'legacy_flow_link' => :'legacy_flow_link'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 462

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



199
200
201
202
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 199

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 164

def self.openapi_types
  {
    :'id' => :'Integer',
    :'user' => :'V1EntitiesInvestorUser',
    :'created_at' => :'Time',
    :'updated_at' => :'Time',
    :'name' => :'String',
    :'allocation_unit' => :'String',
    :'state' => :'String',
    :'funding_state' => :'String',
    :'funds_pending' => :'Boolean',
    :'beneficial_address' => :'String',
    :'phone_number' => :'String',
    :'investor_currency' => :'String',
    :'number_of_securities' => :'Integer',
    :'investment_value' => :'Float',
    :'allocated_amount' => :'Float',
    :'funds_value' => :'Float',
    :'access_link' => :'String',
    :'subscription_id' => :'Integer',
    :'subscription_agreement' => :'V1EntitiesSubscriptionAgreement',
    :'attachments' => :'V1EntitiesAttachment',
    :'background_check_searches' => :'V1EntitiesBackgroundCheckSearch',
    :'verification_status' => :'String',
    :'warrant_expiry_date' => :'Date',
    :'warrant_certificate_number' => :'Integer',
    :'ranking_score' => :'Float',
    :'investor_profile' => :'String',
    :'investor_profile_id' => :'Integer',
    :'checkout_state' => :'String',
    :'legacy_flow_link' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 413

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      user == o.user &&
      created_at == o.created_at &&
      updated_at == o.updated_at &&
      name == o.name &&
      allocation_unit == o.allocation_unit &&
      state == o.state &&
      funding_state == o.funding_state &&
      funds_pending == o.funds_pending &&
      beneficial_address == o.beneficial_address &&
      phone_number == o.phone_number &&
      investor_currency == o.investor_currency &&
      number_of_securities == o.number_of_securities &&
      investment_value == o.investment_value &&
      allocated_amount == o.allocated_amount &&
      funds_value == o.funds_value &&
      access_link == o.access_link &&
      subscription_id == o.subscription_id &&
      subscription_agreement == o.subscription_agreement &&
      attachments == o.attachments &&
      background_check_searches == o.background_check_searches &&
      verification_status == o.verification_status &&
      warrant_expiry_date == o.warrant_expiry_date &&
      warrant_certificate_number == o.warrant_certificate_number &&
      ranking_score == o.ranking_score &&
      investor_profile == o.investor_profile &&
      investor_profile_id == o.investor_profile_id &&
      checkout_state == o.checkout_state &&
      legacy_flow_link == o.legacy_flow_link
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



557
558
559
560
561
562
563
564
565
566
567
568
569
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 557

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


449
450
451
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 449

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



455
456
457
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 455

def hash
  [id, user, created_at, updated_at, name, allocation_unit, state, funding_state, funds_pending, beneficial_address, phone_number, investor_currency, number_of_securities, investment_value, allocated_amount, funds_value, access_link, subscription_id, subscription_agreement, attachments, background_check_searches, verification_status, warrant_expiry_date, warrant_certificate_number, ranking_score, investor_profile, investor_profile_id, checkout_state, legacy_flow_link].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



338
339
340
341
342
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 338

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



533
534
535
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 533

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 539

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



527
528
529
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 527

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 346

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  allocation_unit_validator = EnumAttributeValidator.new('String', ["securities", "amount"])
  return false unless allocation_unit_validator.valid?(@allocation_unit)
  state_validator = EnumAttributeValidator.new('String', ["draft", "invited", "cosigning", "signed", "waiting", "accepted", "inactive", "processing_countersign"])
  return false unless state_validator.valid?(@state)
  funding_state_validator = EnumAttributeValidator.new('String', ["unfunded", "underfunded", "funded", "overfunded"])
  return false unless funding_state_validator.valid?(@funding_state)
  verification_status_validator = EnumAttributeValidator.new('String', ["pending", "approved", "rejected", "new_documents_requested"])
  return false unless verification_status_validator.valid?(@verification_status)
  checkout_state_validator = EnumAttributeValidator.new('String', ["pre_checkout", "investment_amount", "contact_information", "investor_confirmation", "terms_conditions", "payment", "checkout_complete", "resubmit_agreement", "legacy_checkout", "document_upload"])
  return false unless checkout_state_validator.valid?(@checkout_state)
  true
end