Class: UnitOpenapiRubySdk::CreateBusinessApplicationAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateBusinessApplicationAttributes

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
299
300
301
302
303
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 165

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `UnitOpenapiRubySdk::CreateBusinessApplicationAttributes` 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 `UnitOpenapiRubySdk::CreateBusinessApplicationAttributes`. 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?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

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

  if attributes.key?(:'ein')
    self.ein = attributes[:'ein']
  else
    self.ein = nil
  end

  if attributes.key?(:'entity_type')
    self.entity_type = attributes[:'entity_type']
  else
    self.entity_type = nil
  end

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

  if attributes.key?(:'state_of_incorporation')
    self.state_of_incorporation = attributes[:'state_of_incorporation']
  else
    self.state_of_incorporation = nil
  end

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

  if attributes.key?(:'phone')
    self.phone = attributes[:'phone']
  else
    self.phone = nil
  end

  if attributes.key?(:'address')
    self.address = attributes[:'address']
  else
    self.address = nil
  end

  if attributes.key?(:'contact')
    self.contact = attributes[:'contact']
  else
    self.contact = nil
  end

  if attributes.key?(:'officer')
    self.officer = attributes[:'officer']
  else
    self.officer = nil
  end

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

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

  if attributes.key?(:'beneficial_owners')
    if (value = attributes[:'beneficial_owners']).is_a?(Array)
      self.beneficial_owners = value
    end
  else
    self.beneficial_owners = nil
  end

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Hash)
      self.tags = value
    end
  end

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

  if attributes.key?(:'device_fingerprints')
    if (value = attributes[:'device_fingerprints']).is_a?(Array)
      self.device_fingerprints = value
    end
  end

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

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

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

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

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

  if attributes.key?(:'countries_of_operation')
    if (value = attributes[:'countries_of_operation']).is_a?(Array)
      self.countries_of_operation = value
    end
  end

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

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

Instance Attribute Details

#addressObject

Returns the value of attribute address.



34
35
36
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 34

def address
  @address
end

#annual_revenueObject

Returns the value of attribute annual_revenue.



54
55
56
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 54

def annual_revenue
  @annual_revenue
end

#beneficial_ownersObject

Returns the value of attribute beneficial_owners.



44
45
46
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 44

def beneficial_owners
  @beneficial_owners
end

#business_verticalObject

Returns the value of attribute business_vertical.



66
67
68
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 66

def business_vertical
  @business_vertical
end

#cash_flowObject

Returns the value of attribute cash_flow.



58
59
60
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 58

def cash_flow
  @cash_flow
end

#contactObject

Returns the value of attribute contact.



36
37
38
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 36

def contact
  @contact
end

#countries_of_operationObject

Returns the value of attribute countries_of_operation.



62
63
64
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 62

def countries_of_operation
  @countries_of_operation
end

#date_of_incorporationObject

Returns the value of attribute date_of_incorporation.



26
27
28
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 26

def date_of_incorporation
  @date_of_incorporation
end

#dbaObject

Returns the value of attribute dba.



20
21
22
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 20

def dba
  @dba
end

#device_fingerprintsObject

Returns the value of attribute device_fingerprints.



50
51
52
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 50

def device_fingerprints
  @device_fingerprints
end

#einObject

Returns the value of attribute ein.



22
23
24
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 22

def ein
  @ein
end

#entity_typeObject

Returns the value of attribute entity_type.



24
25
26
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 24

def entity_type
  @entity_type
end

#idempotency_keyObject

Returns the value of attribute idempotency_key.



48
49
50
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 48

def idempotency_key
  @idempotency_key
end

#industryObject

Returns the value of attribute industry.



52
53
54
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 52

def industry
  @industry
end

#ipObject

Returns the value of attribute ip.



40
41
42
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 40

def ip
  @ip
end

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 18

def name
  @name
end

#number_of_employeesObject

Returns the value of attribute number_of_employees.



56
57
58
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 56

def number_of_employees
  @number_of_employees
end

#officerObject

Returns the value of attribute officer.



38
39
40
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 38

def officer
  @officer
end

#phoneObject

Returns the value of attribute phone.



32
33
34
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 32

def phone
  @phone
end

#purposeObject

Returns the value of attribute purpose.



30
31
32
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 30

def purpose
  @purpose
end

#state_of_incorporationObject

Returns the value of attribute state_of_incorporation.



28
29
30
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 28

def state_of_incorporation
  @state_of_incorporation
end

#stock_symbolObject

Returns the value of attribute stock_symbol.



64
65
66
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 64

def stock_symbol
  @stock_symbol
end

#tagsObject

Returns the value of attribute tags.



46
47
48
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 46

def tags
  @tags
end

#websiteObject

Returns the value of attribute website.



42
43
44
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 42

def website
  @website
end

#year_of_incorporationObject

Returns the value of attribute year_of_incorporation.



60
61
62
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 60

def year_of_incorporation
  @year_of_incorporation
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



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 703

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 = UnitOpenapiRubySdk.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



122
123
124
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 122

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 91

def self.attribute_map
  {
    :'name' => :'name',
    :'dba' => :'dba',
    :'ein' => :'ein',
    :'entity_type' => :'entityType',
    :'date_of_incorporation' => :'dateOfIncorporation',
    :'state_of_incorporation' => :'stateOfIncorporation',
    :'purpose' => :'purpose',
    :'phone' => :'phone',
    :'address' => :'address',
    :'contact' => :'contact',
    :'officer' => :'officer',
    :'ip' => :'ip',
    :'website' => :'website',
    :'beneficial_owners' => :'beneficialOwners',
    :'tags' => :'tags',
    :'idempotency_key' => :'idempotencyKey',
    :'device_fingerprints' => :'deviceFingerprints',
    :'industry' => :'industry',
    :'annual_revenue' => :'annualRevenue',
    :'number_of_employees' => :'numberOfEmployees',
    :'cash_flow' => :'cashFlow',
    :'year_of_incorporation' => :'yearOfIncorporation',
    :'countries_of_operation' => :'countriesOfOperation',
    :'stock_symbol' => :'stockSymbol',
    :'business_vertical' => :'businessVertical'
  }
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



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 679

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



158
159
160
161
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 158

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

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 127

def self.openapi_types
  {
    :'name' => :'String',
    :'dba' => :'String',
    :'ein' => :'String',
    :'entity_type' => :'EntityType',
    :'date_of_incorporation' => :'Date',
    :'state_of_incorporation' => :'String',
    :'purpose' => :'String',
    :'phone' => :'Phone',
    :'address' => :'Address',
    :'contact' => :'Contact',
    :'officer' => :'CreateOfficer',
    :'ip' => :'String',
    :'website' => :'String',
    :'beneficial_owners' => :'Array<CreateBeneficialOwner>',
    :'tags' => :'Hash<String, String>',
    :'idempotency_key' => :'String',
    :'device_fingerprints' => :'Array<DeviceFingerprint>',
    :'industry' => :'Industry',
    :'annual_revenue' => :'BusinessAnnualRevenue',
    :'number_of_employees' => :'BusinessNumberOfEmployees',
    :'cash_flow' => :'CashFlow',
    :'year_of_incorporation' => :'String',
    :'countries_of_operation' => :'Array<String>',
    :'stock_symbol' => :'String',
    :'business_vertical' => :'BusinessVertical'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 634

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      dba == o.dba &&
      ein == o.ein &&
      entity_type == o.entity_type &&
      date_of_incorporation == o.date_of_incorporation &&
      state_of_incorporation == o.state_of_incorporation &&
      purpose == o.purpose &&
      phone == o.phone &&
      address == o.address &&
      contact == o.contact &&
      officer == o.officer &&
      ip == o.ip &&
      website == o.website &&
      beneficial_owners == o.beneficial_owners &&
      tags == o.tags &&
      idempotency_key == o.idempotency_key &&
      device_fingerprints == o.device_fingerprints &&
      industry == o.industry &&
      annual_revenue == o.annual_revenue &&
      number_of_employees == o.number_of_employees &&
      cash_flow == o.cash_flow &&
      year_of_incorporation == o.year_of_incorporation &&
      countries_of_operation == o.countries_of_operation &&
      stock_symbol == o.stock_symbol &&
      business_vertical == o.business_vertical
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



774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 774

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


666
667
668
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 666

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



672
673
674
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 672

def hash
  [name, dba, ein, entity_type, date_of_incorporation, state_of_incorporation, purpose, phone, address, contact, officer, ip, website, beneficial_owners, tags, idempotency_key, device_fingerprints, industry, annual_revenue, number_of_employees, cash_flow, year_of_incorporation, countries_of_operation, stock_symbol, business_vertical].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 307

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @name.to_s.length > 255
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
  end

  if @name.to_s.length < 1
    invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
  end

  if !@dba.nil? && @dba.to_s.length > 255
    invalid_properties.push('invalid value for "dba", the character length must be smaller than or equal to 255.')
  end

  if !@dba.nil? && @dba.to_s.length < 1
    invalid_properties.push('invalid value for "dba", the character length must be great than or equal to 1.')
  end

  if @ein.nil?
    invalid_properties.push('invalid value for "ein", ein cannot be nil.')
  end

  pattern = Regexp.new(/^\d{9}$/)
  if @ein !~ pattern
    invalid_properties.push("invalid value for \"ein\", must conform to the pattern #{pattern}.")
  end

  if @entity_type.nil?
    invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.')
  end

  if @state_of_incorporation.nil?
    invalid_properties.push('invalid value for "state_of_incorporation", state_of_incorporation cannot be nil.')
  end

  if @state_of_incorporation.to_s.length > 2
    invalid_properties.push('invalid value for "state_of_incorporation", the character length must be smaller than or equal to 2.')
  end

  if @state_of_incorporation.to_s.length < 2
    invalid_properties.push('invalid value for "state_of_incorporation", the character length must be great than or equal to 2.')
  end

  if !@purpose.nil? && @purpose.to_s.length > 1024
    invalid_properties.push('invalid value for "purpose", the character length must be smaller than or equal to 1024.')
  end

  if !@purpose.nil? && @purpose.to_s.length < 1
    invalid_properties.push('invalid value for "purpose", the character length must be great than or equal to 1.')
  end

  if @phone.nil?
    invalid_properties.push('invalid value for "phone", phone cannot be nil.')
  end

  if @address.nil?
    invalid_properties.push('invalid value for "address", address cannot be nil.')
  end

  if @contact.nil?
    invalid_properties.push('invalid value for "contact", contact cannot be nil.')
  end

  if @officer.nil?
    invalid_properties.push('invalid value for "officer", officer cannot be nil.')
  end

  if @beneficial_owners.nil?
    invalid_properties.push('invalid value for "beneficial_owners", beneficial_owners cannot be nil.')
  end

  if !@tags.nil? && @tags.length > 15
    invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 15.')
  end

  if !@idempotency_key.nil? && @idempotency_key.to_s.length > 255
    invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 255.')
  end

  if !@idempotency_key.nil? && @idempotency_key.to_s.length < 1
    invalid_properties.push('invalid value for "idempotency_key", the character length must be great than or equal to 1.')
  end

  if !@device_fingerprints.nil? && @device_fingerprints.length > 1
    invalid_properties.push('invalid value for "device_fingerprints", number of items must be less than or equal to 1.')
  end

  pattern = Regexp.new(/^\d{4}$/)
  if !@year_of_incorporation.nil? && @year_of_incorporation !~ pattern
    invalid_properties.push("invalid value for \"year_of_incorporation\", must conform to the pattern #{pattern}.")
  end

  if !@countries_of_operation.nil? && @countries_of_operation.length < 1
    invalid_properties.push('invalid value for "countries_of_operation", number of items must be greater than or equal to 1.')
  end

  if !@stock_symbol.nil? && @stock_symbol.to_s.length > 5
    invalid_properties.push('invalid value for "stock_symbol", the character length must be smaller than or equal to 5.')
  end

  if !@stock_symbol.nil? && @stock_symbol.to_s.length < 1
    invalid_properties.push('invalid value for "stock_symbol", the character length must be great than or equal to 1.')
  end

  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



750
751
752
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 750

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



756
757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 756

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



744
745
746
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 744

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



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
446
447
448
449
450
# File 'lib/unit_openapi_ruby_sdk/models/create_business_application_attributes.rb', line 421

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @name.nil?
  return false if @name.to_s.length > 255
  return false if @name.to_s.length < 1
  return false if !@dba.nil? && @dba.to_s.length > 255
  return false if !@dba.nil? && @dba.to_s.length < 1
  return false if @ein.nil?
  return false if @ein !~ Regexp.new(/^\d{9}$/)
  return false if @entity_type.nil?
  return false if @state_of_incorporation.nil?
  return false if @state_of_incorporation.to_s.length > 2
  return false if @state_of_incorporation.to_s.length < 2
  return false if !@purpose.nil? && @purpose.to_s.length > 1024
  return false if !@purpose.nil? && @purpose.to_s.length < 1
  return false if @phone.nil?
  return false if @address.nil?
  return false if @contact.nil?
  return false if @officer.nil?
  return false if @beneficial_owners.nil?
  return false if !@tags.nil? && @tags.length > 15
  return false if !@idempotency_key.nil? && @idempotency_key.to_s.length > 255
  return false if !@idempotency_key.nil? && @idempotency_key.to_s.length < 1
  return false if !@device_fingerprints.nil? && @device_fingerprints.length > 1
  return false if !@year_of_incorporation.nil? && @year_of_incorporation !~ Regexp.new(/^\d{4}$/)
  return false if !@countries_of_operation.nil? && @countries_of_operation.length < 1
  return false if !@stock_symbol.nil? && @stock_symbol.to_s.length > 5
  return false if !@stock_symbol.nil? && @stock_symbol.to_s.length < 1
  true
end