tachain-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +226 -0
  5. data/Rakefile +10 -0
  6. data/git_push.sh +54 -0
  7. data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
  8. data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
  9. data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
  10. data/lib/tachain-sdk/api/api_order_api.rb +846 -0
  11. data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +466 -0
  13. data/lib/tachain-sdk/api_client.rb +397 -0
  14. data/lib/tachain-sdk/api_error.rb +58 -0
  15. data/lib/tachain-sdk/api_model_base.rb +88 -0
  16. data/lib/tachain-sdk/configuration.rb +329 -0
  17. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
  18. data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
  19. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
  20. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
  21. data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
  22. data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
  23. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
  24. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
  25. data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
  26. data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
  27. data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
  28. data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
  29. data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
  30. data/lib/tachain-sdk/models/api_response_string.rb +200 -0
  31. data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
  32. data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
  33. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
  34. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
  35. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
  36. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
  37. data/lib/tachain-sdk/models/company.rb +780 -0
  38. data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
  39. data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
  40. data/lib/tachain-sdk/models/customer.rb +569 -0
  41. data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
  42. data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
  43. data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
  44. data/lib/tachain-sdk/models/factory.rb +545 -0
  45. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
  46. data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
  47. data/lib/tachain-sdk/models/model1.rb +157 -0
  48. data/lib/tachain-sdk/models/model3.rb +202 -0
  49. data/lib/tachain-sdk/models/model4.rb +202 -0
  50. data/lib/tachain-sdk/models/order.rb +974 -0
  51. data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
  52. data/lib/tachain-sdk/models/order_line.rb +1184 -0
  53. data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
  54. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
  55. data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
  56. data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
  57. data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
  58. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
  59. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
  60. data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
  61. data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
  62. data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
  63. data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
  64. data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
  65. data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
  66. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
  67. data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
  68. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
  69. data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
  70. data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
  71. data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
  72. data/lib/tachain-sdk/models/supplier.rb +585 -0
  73. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
  74. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
  75. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
  76. data/lib/tachain-sdk/models/trader.rb +506 -0
  77. data/lib/tachain-sdk/signed_api_client.rb +65 -0
  78. data/lib/tachain-sdk/version.rb +15 -0
  79. data/lib/tachain-sdk.rb +108 -0
  80. data/spec/spec_helper.rb +111 -0
  81. data/tachain-sdk.gemspec +39 -0
  82. metadata +165 -0
@@ -0,0 +1,585 @@
1
+ =begin
2
+ #Tactic Chain Public API
3
+
4
+ #Public integration endpoints. Set your own base URL and credential before calling.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TachainSdk
17
+ # 供应商表
18
+ class Supplier < ApiModelBase
19
+ # 供应商ID
20
+ attr_accessor :id
21
+
22
+ # 关联的公司ID
23
+ attr_accessor :company_id
24
+
25
+ # 供应商编码
26
+ attr_accessor :code
27
+
28
+ # 销售范围,多个创建多条数据
29
+ attr_accessor :sales_scope
30
+
31
+ # 备注
32
+ attr_accessor :remark
33
+
34
+ # -9 禁用, -1 删除,0 正常(白名单),-2 加入待确认,-7 黑名单
35
+ attr_accessor :status
36
+
37
+ # 租户ID
38
+ attr_accessor :tenant_id
39
+
40
+ # 环境类型:0 正式, 1 测试
41
+ attr_accessor :environment_type
42
+
43
+ # 创建用户ID
44
+ attr_accessor :created_by
45
+
46
+ # 修改用户ID
47
+ attr_accessor :updated_by
48
+
49
+ # 部门ID
50
+ attr_accessor :division_id
51
+
52
+ # 创建时间
53
+ attr_accessor :created_at
54
+
55
+ # 更新时间
56
+ attr_accessor :updated_at
57
+
58
+ # 供应商类型
59
+ attr_accessor :type
60
+
61
+ # 联系人
62
+ attr_accessor :contact_person
63
+
64
+ # 联系电话
65
+ attr_accessor :contact_phone
66
+
67
+ # 联系邮箱
68
+ attr_accessor :contact_email
69
+
70
+ # 供应品类
71
+ attr_accessor :supply_category
72
+
73
+ # 验厂日期
74
+ attr_accessor :inspection_date
75
+
76
+ # 交货速度(天)
77
+ attr_accessor :delivery_speed
78
+
79
+ # 信用等级
80
+ attr_accessor :credit_rating
81
+
82
+ # -9 禁用, 0 已确认(白名单),-2加入待确认,-7 黑名单
83
+ attr_accessor :white_status
84
+
85
+ # 自定义标签用使用|进行分割
86
+ attr_accessor :custom_tags
87
+
88
+ # 所属公司ID
89
+ attr_accessor :belong_company_id
90
+
91
+ attr_accessor :company
92
+
93
+ # 标签数组
94
+ attr_accessor :scopes
95
+
96
+ # Attribute mapping from ruby-style variable name to JSON key.
97
+ def self.attribute_map
98
+ {
99
+ :'id' => :'id',
100
+ :'company_id' => :'companyId',
101
+ :'code' => :'code',
102
+ :'sales_scope' => :'salesScope',
103
+ :'remark' => :'remark',
104
+ :'status' => :'status',
105
+ :'tenant_id' => :'tenantId',
106
+ :'environment_type' => :'environmentType',
107
+ :'created_by' => :'createdBy',
108
+ :'updated_by' => :'updatedBy',
109
+ :'division_id' => :'divisionId',
110
+ :'created_at' => :'createdAt',
111
+ :'updated_at' => :'updatedAt',
112
+ :'type' => :'type',
113
+ :'contact_person' => :'contactPerson',
114
+ :'contact_phone' => :'contactPhone',
115
+ :'contact_email' => :'contactEmail',
116
+ :'supply_category' => :'supplyCategory',
117
+ :'inspection_date' => :'inspectionDate',
118
+ :'delivery_speed' => :'deliverySpeed',
119
+ :'credit_rating' => :'creditRating',
120
+ :'white_status' => :'whiteStatus',
121
+ :'custom_tags' => :'customTags',
122
+ :'belong_company_id' => :'belongCompanyId',
123
+ :'company' => :'company',
124
+ :'scopes' => :'scopes'
125
+ }
126
+ end
127
+
128
+ # Returns attribute mapping this model knows about
129
+ def self.acceptable_attribute_map
130
+ attribute_map
131
+ end
132
+
133
+ # Returns all the JSON keys this model knows about
134
+ def self.acceptable_attributes
135
+ acceptable_attribute_map.values
136
+ end
137
+
138
+ # Attribute type mapping.
139
+ def self.openapi_types
140
+ {
141
+ :'id' => :'String',
142
+ :'company_id' => :'String',
143
+ :'code' => :'String',
144
+ :'sales_scope' => :'String',
145
+ :'remark' => :'String',
146
+ :'status' => :'Integer',
147
+ :'tenant_id' => :'String',
148
+ :'environment_type' => :'Integer',
149
+ :'created_by' => :'String',
150
+ :'updated_by' => :'String',
151
+ :'division_id' => :'String',
152
+ :'created_at' => :'Time',
153
+ :'updated_at' => :'Time',
154
+ :'type' => :'String',
155
+ :'contact_person' => :'String',
156
+ :'contact_phone' => :'String',
157
+ :'contact_email' => :'String',
158
+ :'supply_category' => :'String',
159
+ :'inspection_date' => :'Date',
160
+ :'delivery_speed' => :'Float',
161
+ :'credit_rating' => :'String',
162
+ :'white_status' => :'Integer',
163
+ :'custom_tags' => :'String',
164
+ :'belong_company_id' => :'String',
165
+ :'company' => :'Company',
166
+ :'scopes' => :'Array<String>'
167
+ }
168
+ end
169
+
170
+ # List of attributes with nullable: true
171
+ def self.openapi_nullable
172
+ Set.new([
173
+ :'company_id',
174
+ :'code',
175
+ :'remark',
176
+ :'updated_by',
177
+ :'division_id',
178
+ :'updated_at',
179
+ :'type',
180
+ :'contact_person',
181
+ :'contact_phone',
182
+ :'contact_email',
183
+ :'supply_category',
184
+ :'inspection_date',
185
+ :'delivery_speed',
186
+ :'credit_rating',
187
+ :'custom_tags',
188
+ ])
189
+ end
190
+
191
+ # Initializes the object
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ def initialize(attributes = {})
194
+ if (!attributes.is_a?(Hash))
195
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::Supplier` initialize method"
196
+ end
197
+
198
+ # check to see if the attribute exists and convert string to symbol for hash key
199
+ acceptable_attribute_map = self.class.acceptable_attribute_map
200
+ attributes = attributes.each_with_object({}) { |(k, v), h|
201
+ if (!acceptable_attribute_map.key?(k.to_sym))
202
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::Supplier`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
203
+ end
204
+ h[k.to_sym] = v
205
+ }
206
+
207
+ if attributes.key?(:'id')
208
+ self.id = attributes[:'id']
209
+ else
210
+ self.id = nil
211
+ end
212
+
213
+ if attributes.key?(:'company_id')
214
+ self.company_id = attributes[:'company_id']
215
+ end
216
+
217
+ if attributes.key?(:'code')
218
+ self.code = attributes[:'code']
219
+ end
220
+
221
+ if attributes.key?(:'sales_scope')
222
+ self.sales_scope = attributes[:'sales_scope']
223
+ else
224
+ self.sales_scope = nil
225
+ end
226
+
227
+ if attributes.key?(:'remark')
228
+ self.remark = attributes[:'remark']
229
+ end
230
+
231
+ if attributes.key?(:'status')
232
+ self.status = attributes[:'status']
233
+ else
234
+ self.status = nil
235
+ end
236
+
237
+ if attributes.key?(:'tenant_id')
238
+ self.tenant_id = attributes[:'tenant_id']
239
+ else
240
+ self.tenant_id = nil
241
+ end
242
+
243
+ if attributes.key?(:'environment_type')
244
+ self.environment_type = attributes[:'environment_type']
245
+ else
246
+ self.environment_type = nil
247
+ end
248
+
249
+ if attributes.key?(:'created_by')
250
+ self.created_by = attributes[:'created_by']
251
+ else
252
+ self.created_by = nil
253
+ end
254
+
255
+ if attributes.key?(:'updated_by')
256
+ self.updated_by = attributes[:'updated_by']
257
+ end
258
+
259
+ if attributes.key?(:'division_id')
260
+ self.division_id = attributes[:'division_id']
261
+ end
262
+
263
+ if attributes.key?(:'created_at')
264
+ self.created_at = attributes[:'created_at']
265
+ else
266
+ self.created_at = nil
267
+ end
268
+
269
+ if attributes.key?(:'updated_at')
270
+ self.updated_at = attributes[:'updated_at']
271
+ end
272
+
273
+ if attributes.key?(:'type')
274
+ self.type = attributes[:'type']
275
+ end
276
+
277
+ if attributes.key?(:'contact_person')
278
+ self.contact_person = attributes[:'contact_person']
279
+ end
280
+
281
+ if attributes.key?(:'contact_phone')
282
+ self.contact_phone = attributes[:'contact_phone']
283
+ end
284
+
285
+ if attributes.key?(:'contact_email')
286
+ self.contact_email = attributes[:'contact_email']
287
+ end
288
+
289
+ if attributes.key?(:'supply_category')
290
+ self.supply_category = attributes[:'supply_category']
291
+ end
292
+
293
+ if attributes.key?(:'inspection_date')
294
+ self.inspection_date = attributes[:'inspection_date']
295
+ end
296
+
297
+ if attributes.key?(:'delivery_speed')
298
+ self.delivery_speed = attributes[:'delivery_speed']
299
+ end
300
+
301
+ if attributes.key?(:'credit_rating')
302
+ self.credit_rating = attributes[:'credit_rating']
303
+ end
304
+
305
+ if attributes.key?(:'white_status')
306
+ self.white_status = attributes[:'white_status']
307
+ else
308
+ self.white_status = nil
309
+ end
310
+
311
+ if attributes.key?(:'custom_tags')
312
+ self.custom_tags = attributes[:'custom_tags']
313
+ end
314
+
315
+ if attributes.key?(:'belong_company_id')
316
+ self.belong_company_id = attributes[:'belong_company_id']
317
+ else
318
+ self.belong_company_id = nil
319
+ end
320
+
321
+ if attributes.key?(:'company')
322
+ self.company = attributes[:'company']
323
+ end
324
+
325
+ if attributes.key?(:'scopes')
326
+ if (value = attributes[:'scopes']).is_a?(Array)
327
+ self.scopes = value
328
+ end
329
+ else
330
+ self.scopes = nil
331
+ end
332
+ end
333
+
334
+ # Show invalid properties with the reasons. Usually used together with valid?
335
+ # @return Array for valid properties with the reasons
336
+ def list_invalid_properties
337
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
338
+ invalid_properties = Array.new
339
+ if @id.nil?
340
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
341
+ end
342
+
343
+ if @sales_scope.nil?
344
+ invalid_properties.push('invalid value for "sales_scope", sales_scope cannot be nil.')
345
+ end
346
+
347
+ if @status.nil?
348
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
349
+ end
350
+
351
+ if @tenant_id.nil?
352
+ invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
353
+ end
354
+
355
+ if @environment_type.nil?
356
+ invalid_properties.push('invalid value for "environment_type", environment_type cannot be nil.')
357
+ end
358
+
359
+ if @created_by.nil?
360
+ invalid_properties.push('invalid value for "created_by", created_by cannot be nil.')
361
+ end
362
+
363
+ if @created_at.nil?
364
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
365
+ end
366
+
367
+ if @white_status.nil?
368
+ invalid_properties.push('invalid value for "white_status", white_status cannot be nil.')
369
+ end
370
+
371
+ if @belong_company_id.nil?
372
+ invalid_properties.push('invalid value for "belong_company_id", belong_company_id cannot be nil.')
373
+ end
374
+
375
+ if @scopes.nil?
376
+ invalid_properties.push('invalid value for "scopes", scopes cannot be nil.')
377
+ end
378
+
379
+ invalid_properties
380
+ end
381
+
382
+ # Check to see if the all the properties in the model are valid
383
+ # @return true if the model is valid
384
+ def valid?
385
+ warn '[DEPRECATED] the `valid?` method is obsolete'
386
+ return false if @id.nil?
387
+ return false if @sales_scope.nil?
388
+ return false if @status.nil?
389
+ return false if @tenant_id.nil?
390
+ return false if @environment_type.nil?
391
+ return false if @created_by.nil?
392
+ return false if @created_at.nil?
393
+ return false if @white_status.nil?
394
+ return false if @belong_company_id.nil?
395
+ return false if @scopes.nil?
396
+ true
397
+ end
398
+
399
+ # Custom attribute writer method with validation
400
+ # @param [Object] id Value to be assigned
401
+ def id=(id)
402
+ if id.nil?
403
+ fail ArgumentError, 'id cannot be nil'
404
+ end
405
+
406
+ @id = id
407
+ end
408
+
409
+ # Custom attribute writer method with validation
410
+ # @param [Object] sales_scope Value to be assigned
411
+ def sales_scope=(sales_scope)
412
+ if sales_scope.nil?
413
+ fail ArgumentError, 'sales_scope cannot be nil'
414
+ end
415
+
416
+ @sales_scope = sales_scope
417
+ end
418
+
419
+ # Custom attribute writer method with validation
420
+ # @param [Object] status Value to be assigned
421
+ def status=(status)
422
+ if status.nil?
423
+ fail ArgumentError, 'status cannot be nil'
424
+ end
425
+
426
+ @status = status
427
+ end
428
+
429
+ # Custom attribute writer method with validation
430
+ # @param [Object] tenant_id Value to be assigned
431
+ def tenant_id=(tenant_id)
432
+ if tenant_id.nil?
433
+ fail ArgumentError, 'tenant_id cannot be nil'
434
+ end
435
+
436
+ @tenant_id = tenant_id
437
+ end
438
+
439
+ # Custom attribute writer method with validation
440
+ # @param [Object] environment_type Value to be assigned
441
+ def environment_type=(environment_type)
442
+ if environment_type.nil?
443
+ fail ArgumentError, 'environment_type cannot be nil'
444
+ end
445
+
446
+ @environment_type = environment_type
447
+ end
448
+
449
+ # Custom attribute writer method with validation
450
+ # @param [Object] created_by Value to be assigned
451
+ def created_by=(created_by)
452
+ if created_by.nil?
453
+ fail ArgumentError, 'created_by cannot be nil'
454
+ end
455
+
456
+ @created_by = created_by
457
+ end
458
+
459
+ # Custom attribute writer method with validation
460
+ # @param [Object] created_at Value to be assigned
461
+ def created_at=(created_at)
462
+ if created_at.nil?
463
+ fail ArgumentError, 'created_at cannot be nil'
464
+ end
465
+
466
+ @created_at = created_at
467
+ end
468
+
469
+ # Custom attribute writer method with validation
470
+ # @param [Object] white_status Value to be assigned
471
+ def white_status=(white_status)
472
+ if white_status.nil?
473
+ fail ArgumentError, 'white_status cannot be nil'
474
+ end
475
+
476
+ @white_status = white_status
477
+ end
478
+
479
+ # Custom attribute writer method with validation
480
+ # @param [Object] belong_company_id Value to be assigned
481
+ def belong_company_id=(belong_company_id)
482
+ if belong_company_id.nil?
483
+ fail ArgumentError, 'belong_company_id cannot be nil'
484
+ end
485
+
486
+ @belong_company_id = belong_company_id
487
+ end
488
+
489
+ # Custom attribute writer method with validation
490
+ # @param [Object] scopes Value to be assigned
491
+ def scopes=(scopes)
492
+ if scopes.nil?
493
+ fail ArgumentError, 'scopes cannot be nil'
494
+ end
495
+
496
+ @scopes = scopes
497
+ end
498
+
499
+ # Checks equality by comparing each attribute.
500
+ # @param [Object] Object to be compared
501
+ def ==(o)
502
+ return true if self.equal?(o)
503
+ self.class == o.class &&
504
+ id == o.id &&
505
+ company_id == o.company_id &&
506
+ code == o.code &&
507
+ sales_scope == o.sales_scope &&
508
+ remark == o.remark &&
509
+ status == o.status &&
510
+ tenant_id == o.tenant_id &&
511
+ environment_type == o.environment_type &&
512
+ created_by == o.created_by &&
513
+ updated_by == o.updated_by &&
514
+ division_id == o.division_id &&
515
+ created_at == o.created_at &&
516
+ updated_at == o.updated_at &&
517
+ type == o.type &&
518
+ contact_person == o.contact_person &&
519
+ contact_phone == o.contact_phone &&
520
+ contact_email == o.contact_email &&
521
+ supply_category == o.supply_category &&
522
+ inspection_date == o.inspection_date &&
523
+ delivery_speed == o.delivery_speed &&
524
+ credit_rating == o.credit_rating &&
525
+ white_status == o.white_status &&
526
+ custom_tags == o.custom_tags &&
527
+ belong_company_id == o.belong_company_id &&
528
+ company == o.company &&
529
+ scopes == o.scopes
530
+ end
531
+
532
+ # @see the `==` method
533
+ # @param [Object] Object to be compared
534
+ def eql?(o)
535
+ self == o
536
+ end
537
+
538
+ # Calculates hash code according to all attributes.
539
+ # @return [Integer] Hash code
540
+ def hash
541
+ [id, company_id, code, sales_scope, remark, status, tenant_id, environment_type, created_by, updated_by, division_id, created_at, updated_at, type, contact_person, contact_phone, contact_email, supply_category, inspection_date, delivery_speed, credit_rating, white_status, custom_tags, belong_company_id, company, scopes].hash
542
+ end
543
+
544
+ # Builds the object from hash
545
+ # @param [Hash] attributes Model attributes in the form of hash
546
+ # @return [Object] Returns the model itself
547
+ def self.build_from_hash(attributes)
548
+ return nil unless attributes.is_a?(Hash)
549
+ attributes = attributes.transform_keys(&:to_sym)
550
+ transformed_hash = {}
551
+ openapi_types.each_pair do |key, type|
552
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
553
+ transformed_hash["#{key}"] = nil
554
+ elsif type =~ /\AArray<(.*)>/i
555
+ # check to ensure the input is an array given that the attribute
556
+ # is documented as an array but the input is not
557
+ if attributes[attribute_map[key]].is_a?(Array)
558
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
559
+ end
560
+ elsif !attributes[attribute_map[key]].nil?
561
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
562
+ end
563
+ end
564
+ new(transformed_hash)
565
+ end
566
+
567
+ # Returns the object in the form of hash
568
+ # @return [Hash] Returns the object in the form of hash
569
+ def to_hash
570
+ hash = {}
571
+ self.class.attribute_map.each_pair do |attr, param|
572
+ value = self.send(attr)
573
+ if value.nil?
574
+ is_nullable = self.class.openapi_nullable.include?(attr)
575
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
576
+ end
577
+
578
+ hash[param] = _to_hash(value)
579
+ end
580
+ hash
581
+ end
582
+
583
+ end
584
+
585
+ end