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



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 186

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?(:'investment_value')
    self.investment_value = attributes[:'investment_value']
  end

  if attributes.key?(:'number_of_securities')
    self.number_of_securities = attributes[:'number_of_securities']
  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_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
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.



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.



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

def attachments
  @attachments
end

#background_check_searchesObject

Returns the value of attribute background_check_searches.



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

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

#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.



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

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.



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

def investor_profile
  @investor_profile
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.



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

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`



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

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.



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

def subscription_agreement
  @subscription_agreement
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.



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

def verification_status
  @verification_status
end

#warrant_certificate_numberObject

The warrant certificate number.



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

def warrant_certificate_number
  @warrant_certificate_number
end

#warrant_expiry_dateObject

The warrant expiry date.



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

def warrant_expiry_date
  @warrant_expiry_date
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



143
144
145
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 143

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 112

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',
    :'investment_value' => :'investment_value',
    :'number_of_securities' => :'number_of_securities',
    :'allocated_amount' => :'allocated_amount',
    :'funds_value' => :'funds_value',
    :'access_link' => :'access_link',
    :'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'
  }
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



408
409
410
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 408

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



179
180
181
182
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 179

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

.openapi_typesObject

Attribute type mapping.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 148

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',
    :'investment_value' => :'Float',
    :'number_of_securities' => :'Integer',
    :'allocated_amount' => :'Float',
    :'funds_value' => :'Float',
    :'access_link' => :'String',
    :'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'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 363

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 &&
      investment_value == o.investment_value &&
      number_of_securities == o.number_of_securities &&
      allocated_amount == o.allocated_amount &&
      funds_value == o.funds_value &&
      access_link == o.access_link &&
      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
end

#_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



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 439

def _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_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
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



510
511
512
513
514
515
516
517
518
519
520
521
522
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 510

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

#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



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 415

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


395
396
397
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 395

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



401
402
403
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 401

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

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



302
303
304
305
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 302

def list_invalid_properties
  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



486
487
488
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 486

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



492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 492

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



480
481
482
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 480

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



309
310
311
312
313
314
315
316
317
318
319
# File 'lib/DealMakerAPI/models/v1_entities_investor.rb', line 309

def valid?
  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"])
  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)
  true
end