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,597 @@
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 DeliveryNoteApiDto < ApiModelBase
19
+ # 运输单ID
20
+ attr_accessor :id
21
+
22
+ # 运输单号
23
+ attr_accessor :number
24
+
25
+ # 发货地
26
+ attr_accessor :from_country
27
+
28
+ # 收货地
29
+ attr_accessor :to_country
30
+
31
+ # 发货日期
32
+ attr_accessor :delivery_date
33
+
34
+ # 收货地址
35
+ attr_accessor :delivery_address
36
+
37
+ # 备注
38
+ attr_accessor :remark
39
+
40
+ # -9 禁用, -1 删除, 0 正常
41
+ attr_accessor :status
42
+
43
+ # 租户ID
44
+ attr_accessor :tenant_id
45
+
46
+ # 创建用户ID
47
+ attr_accessor :created_by
48
+
49
+ # 创建时间
50
+ attr_accessor :created_at
51
+
52
+ # 客户ID
53
+ attr_accessor :customer_id
54
+
55
+ # 客户编码。外部不知道 CustomerId 时,可传枚举接口 Customer.Code/Name/ShortName,由接口解析内部客户 ID。
56
+ attr_accessor :customer_code
57
+
58
+ # 供应商ID
59
+ attr_accessor :supplier_id
60
+
61
+ # 客户租户ID
62
+ attr_accessor :customer_tenant_id
63
+
64
+ # 供应商租户ID
65
+ attr_accessor :supplier_tenant_id
66
+
67
+ # 环境类型:0 正式, 1 测试
68
+ attr_accessor :environment_type
69
+
70
+ # 10 待收货,20 已收货,30 拒绝收货
71
+ attr_accessor :business_status
72
+
73
+ # 修改用户ID
74
+ attr_accessor :updated_by
75
+
76
+ # 更新时间
77
+ attr_accessor :updated_at
78
+
79
+ # 申报情况是否完成,1完成:0未完成
80
+ attr_accessor :declare_complete
81
+
82
+ # 发货单类型:0 正常发货 、1 贸易发货且自己运输,2 贸易发货且供应商运输
83
+ attr_accessor :is_trade
84
+
85
+ # 是否转运单:1是,0否
86
+ attr_accessor :is_transfer
87
+
88
+ # 作废
89
+ attr_accessor :related_delivery_note_id
90
+
91
+ # 发货明细集合
92
+ attr_accessor :delivery_note_detail_list
93
+
94
+ attr_accessor :delivery_note_detail
95
+
96
+ # 收发货:0收货 1发货
97
+ attr_accessor :freight_type
98
+
99
+ attr_accessor :supplier_name
100
+
101
+ attr_accessor :customer_name
102
+
103
+ attr_accessor :invoice_no
104
+
105
+ attr_accessor :from_country_name
106
+
107
+ attr_accessor :to_country_name
108
+
109
+ # 采购订单详细信息
110
+ attr_accessor :purchase_information
111
+
112
+ # 链条是否审核通过
113
+ attr_accessor :chain_review_status
114
+
115
+ # 是否存在品牌审核通过的发货明细
116
+ attr_accessor :is_approved
117
+
118
+ # 申报项(大申报使用)
119
+ attr_accessor :attachments
120
+
121
+ # Attribute mapping from ruby-style variable name to JSON key.
122
+ def self.attribute_map
123
+ {
124
+ :'id' => :'id',
125
+ :'number' => :'number',
126
+ :'from_country' => :'fromCountry',
127
+ :'to_country' => :'toCountry',
128
+ :'delivery_date' => :'deliveryDate',
129
+ :'delivery_address' => :'deliveryAddress',
130
+ :'remark' => :'remark',
131
+ :'status' => :'status',
132
+ :'tenant_id' => :'tenantId',
133
+ :'created_by' => :'createdBy',
134
+ :'created_at' => :'createdAt',
135
+ :'customer_id' => :'customerId',
136
+ :'customer_code' => :'customerCode',
137
+ :'supplier_id' => :'supplierId',
138
+ :'customer_tenant_id' => :'customerTenantId',
139
+ :'supplier_tenant_id' => :'supplierTenantId',
140
+ :'environment_type' => :'environmentType',
141
+ :'business_status' => :'businessStatus',
142
+ :'updated_by' => :'updatedBy',
143
+ :'updated_at' => :'updatedAt',
144
+ :'declare_complete' => :'declareComplete',
145
+ :'is_trade' => :'isTrade',
146
+ :'is_transfer' => :'isTransfer',
147
+ :'related_delivery_note_id' => :'relatedDeliveryNoteId',
148
+ :'delivery_note_detail_list' => :'deliveryNoteDetailList',
149
+ :'delivery_note_detail' => :'deliveryNoteDetail',
150
+ :'freight_type' => :'freightType',
151
+ :'supplier_name' => :'supplierName',
152
+ :'customer_name' => :'customerName',
153
+ :'invoice_no' => :'invoiceNo',
154
+ :'from_country_name' => :'fromCountryName',
155
+ :'to_country_name' => :'toCountryName',
156
+ :'purchase_information' => :'purchaseInformation',
157
+ :'chain_review_status' => :'chainReviewStatus',
158
+ :'is_approved' => :'isApproved',
159
+ :'attachments' => :'attachments'
160
+ }
161
+ end
162
+
163
+ # Returns attribute mapping this model knows about
164
+ def self.acceptable_attribute_map
165
+ attribute_map
166
+ end
167
+
168
+ # Returns all the JSON keys this model knows about
169
+ def self.acceptable_attributes
170
+ acceptable_attribute_map.values
171
+ end
172
+
173
+ # Attribute type mapping.
174
+ def self.openapi_types
175
+ {
176
+ :'id' => :'Integer',
177
+ :'number' => :'String',
178
+ :'from_country' => :'String',
179
+ :'to_country' => :'String',
180
+ :'delivery_date' => :'Time',
181
+ :'delivery_address' => :'String',
182
+ :'remark' => :'String',
183
+ :'status' => :'Integer',
184
+ :'tenant_id' => :'String',
185
+ :'created_by' => :'String',
186
+ :'created_at' => :'Time',
187
+ :'customer_id' => :'String',
188
+ :'customer_code' => :'String',
189
+ :'supplier_id' => :'String',
190
+ :'customer_tenant_id' => :'String',
191
+ :'supplier_tenant_id' => :'String',
192
+ :'environment_type' => :'Integer',
193
+ :'business_status' => :'Integer',
194
+ :'updated_by' => :'String',
195
+ :'updated_at' => :'Time',
196
+ :'declare_complete' => :'Boolean',
197
+ :'is_trade' => :'Integer',
198
+ :'is_transfer' => :'Integer',
199
+ :'related_delivery_note_id' => :'Integer',
200
+ :'delivery_note_detail_list' => :'Array<DeliveryNoteDetailApiDto>',
201
+ :'delivery_note_detail' => :'DeliveryNoteDetailApiDto',
202
+ :'freight_type' => :'Integer',
203
+ :'supplier_name' => :'String',
204
+ :'customer_name' => :'String',
205
+ :'invoice_no' => :'String',
206
+ :'from_country_name' => :'String',
207
+ :'to_country_name' => :'String',
208
+ :'purchase_information' => :'String',
209
+ :'chain_review_status' => :'Boolean',
210
+ :'is_approved' => :'Boolean',
211
+ :'attachments' => :'Array<Model1>'
212
+ }
213
+ end
214
+
215
+ # List of attributes with nullable: true
216
+ def self.openapi_nullable
217
+ Set.new([
218
+ :'id',
219
+ :'number',
220
+ :'from_country',
221
+ :'to_country',
222
+ :'delivery_date',
223
+ :'delivery_address',
224
+ :'remark',
225
+ :'status',
226
+ :'tenant_id',
227
+ :'created_by',
228
+ :'created_at',
229
+ :'customer_id',
230
+ :'customer_code',
231
+ :'supplier_id',
232
+ :'customer_tenant_id',
233
+ :'supplier_tenant_id',
234
+ :'environment_type',
235
+ :'business_status',
236
+ :'updated_by',
237
+ :'updated_at',
238
+ :'declare_complete',
239
+ :'is_trade',
240
+ :'is_transfer',
241
+ :'related_delivery_note_id',
242
+ :'supplier_name',
243
+ :'customer_name',
244
+ :'invoice_no',
245
+ :'from_country_name',
246
+ :'to_country_name',
247
+ :'purchase_information',
248
+ :'chain_review_status',
249
+ :'is_approved',
250
+ ])
251
+ end
252
+
253
+ # Initializes the object
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ def initialize(attributes = {})
256
+ if (!attributes.is_a?(Hash))
257
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::DeliveryNoteApiDto` initialize method"
258
+ end
259
+
260
+ # check to see if the attribute exists and convert string to symbol for hash key
261
+ acceptable_attribute_map = self.class.acceptable_attribute_map
262
+ attributes = attributes.each_with_object({}) { |(k, v), h|
263
+ if (!acceptable_attribute_map.key?(k.to_sym))
264
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::DeliveryNoteApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
265
+ end
266
+ h[k.to_sym] = v
267
+ }
268
+
269
+ if attributes.key?(:'id')
270
+ self.id = attributes[:'id']
271
+ end
272
+
273
+ if attributes.key?(:'number')
274
+ self.number = attributes[:'number']
275
+ end
276
+
277
+ if attributes.key?(:'from_country')
278
+ self.from_country = attributes[:'from_country']
279
+ end
280
+
281
+ if attributes.key?(:'to_country')
282
+ self.to_country = attributes[:'to_country']
283
+ end
284
+
285
+ if attributes.key?(:'delivery_date')
286
+ self.delivery_date = attributes[:'delivery_date']
287
+ end
288
+
289
+ if attributes.key?(:'delivery_address')
290
+ self.delivery_address = attributes[:'delivery_address']
291
+ end
292
+
293
+ if attributes.key?(:'remark')
294
+ self.remark = attributes[:'remark']
295
+ end
296
+
297
+ if attributes.key?(:'status')
298
+ self.status = attributes[:'status']
299
+ end
300
+
301
+ if attributes.key?(:'tenant_id')
302
+ self.tenant_id = attributes[:'tenant_id']
303
+ end
304
+
305
+ if attributes.key?(:'created_by')
306
+ self.created_by = attributes[:'created_by']
307
+ end
308
+
309
+ if attributes.key?(:'created_at')
310
+ self.created_at = attributes[:'created_at']
311
+ end
312
+
313
+ if attributes.key?(:'customer_id')
314
+ self.customer_id = attributes[:'customer_id']
315
+ end
316
+
317
+ if attributes.key?(:'customer_code')
318
+ self.customer_code = attributes[:'customer_code']
319
+ end
320
+
321
+ if attributes.key?(:'supplier_id')
322
+ self.supplier_id = attributes[:'supplier_id']
323
+ end
324
+
325
+ if attributes.key?(:'customer_tenant_id')
326
+ self.customer_tenant_id = attributes[:'customer_tenant_id']
327
+ end
328
+
329
+ if attributes.key?(:'supplier_tenant_id')
330
+ self.supplier_tenant_id = attributes[:'supplier_tenant_id']
331
+ end
332
+
333
+ if attributes.key?(:'environment_type')
334
+ self.environment_type = attributes[:'environment_type']
335
+ end
336
+
337
+ if attributes.key?(:'business_status')
338
+ self.business_status = attributes[:'business_status']
339
+ end
340
+
341
+ if attributes.key?(:'updated_by')
342
+ self.updated_by = attributes[:'updated_by']
343
+ end
344
+
345
+ if attributes.key?(:'updated_at')
346
+ self.updated_at = attributes[:'updated_at']
347
+ end
348
+
349
+ if attributes.key?(:'declare_complete')
350
+ self.declare_complete = attributes[:'declare_complete']
351
+ end
352
+
353
+ if attributes.key?(:'is_trade')
354
+ self.is_trade = attributes[:'is_trade']
355
+ end
356
+
357
+ if attributes.key?(:'is_transfer')
358
+ self.is_transfer = attributes[:'is_transfer']
359
+ end
360
+
361
+ if attributes.key?(:'related_delivery_note_id')
362
+ self.related_delivery_note_id = attributes[:'related_delivery_note_id']
363
+ end
364
+
365
+ if attributes.key?(:'delivery_note_detail_list')
366
+ if (value = attributes[:'delivery_note_detail_list']).is_a?(Array)
367
+ self.delivery_note_detail_list = value
368
+ end
369
+ else
370
+ self.delivery_note_detail_list = nil
371
+ end
372
+
373
+ if attributes.key?(:'delivery_note_detail')
374
+ self.delivery_note_detail = attributes[:'delivery_note_detail']
375
+ else
376
+ self.delivery_note_detail = nil
377
+ end
378
+
379
+ if attributes.key?(:'freight_type')
380
+ self.freight_type = attributes[:'freight_type']
381
+ else
382
+ self.freight_type = nil
383
+ end
384
+
385
+ if attributes.key?(:'supplier_name')
386
+ self.supplier_name = attributes[:'supplier_name']
387
+ end
388
+
389
+ if attributes.key?(:'customer_name')
390
+ self.customer_name = attributes[:'customer_name']
391
+ end
392
+
393
+ if attributes.key?(:'invoice_no')
394
+ self.invoice_no = attributes[:'invoice_no']
395
+ end
396
+
397
+ if attributes.key?(:'from_country_name')
398
+ self.from_country_name = attributes[:'from_country_name']
399
+ end
400
+
401
+ if attributes.key?(:'to_country_name')
402
+ self.to_country_name = attributes[:'to_country_name']
403
+ end
404
+
405
+ if attributes.key?(:'purchase_information')
406
+ self.purchase_information = attributes[:'purchase_information']
407
+ end
408
+
409
+ if attributes.key?(:'chain_review_status')
410
+ self.chain_review_status = attributes[:'chain_review_status']
411
+ end
412
+
413
+ if attributes.key?(:'is_approved')
414
+ self.is_approved = attributes[:'is_approved']
415
+ end
416
+
417
+ if attributes.key?(:'attachments')
418
+ if (value = attributes[:'attachments']).is_a?(Array)
419
+ self.attachments = value
420
+ end
421
+ else
422
+ self.attachments = nil
423
+ end
424
+ end
425
+
426
+ # Show invalid properties with the reasons. Usually used together with valid?
427
+ # @return Array for valid properties with the reasons
428
+ def list_invalid_properties
429
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
430
+ invalid_properties = Array.new
431
+ if @delivery_note_detail_list.nil?
432
+ invalid_properties.push('invalid value for "delivery_note_detail_list", delivery_note_detail_list cannot be nil.')
433
+ end
434
+
435
+ if @delivery_note_detail.nil?
436
+ invalid_properties.push('invalid value for "delivery_note_detail", delivery_note_detail cannot be nil.')
437
+ end
438
+
439
+ if @freight_type.nil?
440
+ invalid_properties.push('invalid value for "freight_type", freight_type cannot be nil.')
441
+ end
442
+
443
+ if @attachments.nil?
444
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
445
+ end
446
+
447
+ invalid_properties
448
+ end
449
+
450
+ # Check to see if the all the properties in the model are valid
451
+ # @return true if the model is valid
452
+ def valid?
453
+ warn '[DEPRECATED] the `valid?` method is obsolete'
454
+ return false if @delivery_note_detail_list.nil?
455
+ return false if @delivery_note_detail.nil?
456
+ return false if @freight_type.nil?
457
+ return false if @attachments.nil?
458
+ true
459
+ end
460
+
461
+ # Custom attribute writer method with validation
462
+ # @param [Object] delivery_note_detail_list Value to be assigned
463
+ def delivery_note_detail_list=(delivery_note_detail_list)
464
+ if delivery_note_detail_list.nil?
465
+ fail ArgumentError, 'delivery_note_detail_list cannot be nil'
466
+ end
467
+
468
+ @delivery_note_detail_list = delivery_note_detail_list
469
+ end
470
+
471
+ # Custom attribute writer method with validation
472
+ # @param [Object] delivery_note_detail Value to be assigned
473
+ def delivery_note_detail=(delivery_note_detail)
474
+ if delivery_note_detail.nil?
475
+ fail ArgumentError, 'delivery_note_detail cannot be nil'
476
+ end
477
+
478
+ @delivery_note_detail = delivery_note_detail
479
+ end
480
+
481
+ # Custom attribute writer method with validation
482
+ # @param [Object] freight_type Value to be assigned
483
+ def freight_type=(freight_type)
484
+ if freight_type.nil?
485
+ fail ArgumentError, 'freight_type cannot be nil'
486
+ end
487
+
488
+ @freight_type = freight_type
489
+ end
490
+
491
+ # Custom attribute writer method with validation
492
+ # @param [Object] attachments Value to be assigned
493
+ def attachments=(attachments)
494
+ if attachments.nil?
495
+ fail ArgumentError, 'attachments cannot be nil'
496
+ end
497
+
498
+ @attachments = attachments
499
+ end
500
+
501
+ # Checks equality by comparing each attribute.
502
+ # @param [Object] Object to be compared
503
+ def ==(o)
504
+ return true if self.equal?(o)
505
+ self.class == o.class &&
506
+ id == o.id &&
507
+ number == o.number &&
508
+ from_country == o.from_country &&
509
+ to_country == o.to_country &&
510
+ delivery_date == o.delivery_date &&
511
+ delivery_address == o.delivery_address &&
512
+ remark == o.remark &&
513
+ status == o.status &&
514
+ tenant_id == o.tenant_id &&
515
+ created_by == o.created_by &&
516
+ created_at == o.created_at &&
517
+ customer_id == o.customer_id &&
518
+ customer_code == o.customer_code &&
519
+ supplier_id == o.supplier_id &&
520
+ customer_tenant_id == o.customer_tenant_id &&
521
+ supplier_tenant_id == o.supplier_tenant_id &&
522
+ environment_type == o.environment_type &&
523
+ business_status == o.business_status &&
524
+ updated_by == o.updated_by &&
525
+ updated_at == o.updated_at &&
526
+ declare_complete == o.declare_complete &&
527
+ is_trade == o.is_trade &&
528
+ is_transfer == o.is_transfer &&
529
+ related_delivery_note_id == o.related_delivery_note_id &&
530
+ delivery_note_detail_list == o.delivery_note_detail_list &&
531
+ delivery_note_detail == o.delivery_note_detail &&
532
+ freight_type == o.freight_type &&
533
+ supplier_name == o.supplier_name &&
534
+ customer_name == o.customer_name &&
535
+ invoice_no == o.invoice_no &&
536
+ from_country_name == o.from_country_name &&
537
+ to_country_name == o.to_country_name &&
538
+ purchase_information == o.purchase_information &&
539
+ chain_review_status == o.chain_review_status &&
540
+ is_approved == o.is_approved &&
541
+ attachments == o.attachments
542
+ end
543
+
544
+ # @see the `==` method
545
+ # @param [Object] Object to be compared
546
+ def eql?(o)
547
+ self == o
548
+ end
549
+
550
+ # Calculates hash code according to all attributes.
551
+ # @return [Integer] Hash code
552
+ def hash
553
+ [id, number, from_country, to_country, delivery_date, delivery_address, remark, status, tenant_id, created_by, created_at, customer_id, customer_code, supplier_id, customer_tenant_id, supplier_tenant_id, environment_type, business_status, updated_by, updated_at, declare_complete, is_trade, is_transfer, related_delivery_note_id, delivery_note_detail_list, delivery_note_detail, freight_type, supplier_name, customer_name, invoice_no, from_country_name, to_country_name, purchase_information, chain_review_status, is_approved, attachments].hash
554
+ end
555
+
556
+ # Builds the object from hash
557
+ # @param [Hash] attributes Model attributes in the form of hash
558
+ # @return [Object] Returns the model itself
559
+ def self.build_from_hash(attributes)
560
+ return nil unless attributes.is_a?(Hash)
561
+ attributes = attributes.transform_keys(&:to_sym)
562
+ transformed_hash = {}
563
+ openapi_types.each_pair do |key, type|
564
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
565
+ transformed_hash["#{key}"] = nil
566
+ elsif type =~ /\AArray<(.*)>/i
567
+ # check to ensure the input is an array given that the attribute
568
+ # is documented as an array but the input is not
569
+ if attributes[attribute_map[key]].is_a?(Array)
570
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
571
+ end
572
+ elsif !attributes[attribute_map[key]].nil?
573
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
574
+ end
575
+ end
576
+ new(transformed_hash)
577
+ end
578
+
579
+ # Returns the object in the form of hash
580
+ # @return [Hash] Returns the object in the form of hash
581
+ def to_hash
582
+ hash = {}
583
+ self.class.attribute_map.each_pair do |attr, param|
584
+ value = self.send(attr)
585
+ if value.nil?
586
+ is_nullable = self.class.openapi_nullable.include?(attr)
587
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
588
+ end
589
+
590
+ hash[param] = _to_hash(value)
591
+ end
592
+ hash
593
+ end
594
+
595
+ end
596
+
597
+ end