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,639 @@
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 ProductionApiDto < ApiModelBase
19
+ # 批次ID,唯一标识生产批次
20
+ attr_accessor :id
21
+
22
+ # 生产编号(MTO)
23
+ attr_accessor :number
24
+
25
+ # 生产开始日期(MTO)
26
+ attr_accessor :production_date
27
+
28
+ # 生产结束日期(MTO)
29
+ attr_accessor :production_end_date
30
+
31
+ # 成品编号(MTO)
32
+ attr_accessor :product_id
33
+
34
+ # 成品编码(MTO)
35
+ attr_accessor :product_code
36
+
37
+ # 成品名称(MTO)
38
+ attr_accessor :product_name
39
+
40
+ # 成品颜色(MTO)
41
+ attr_accessor :product_color
42
+
43
+ # 生产数量\\入库数量
44
+ attr_accessor :quantity_produced
45
+
46
+ # 生产工厂编号(MTO)
47
+ attr_accessor :facility_id
48
+
49
+ # 生产工厂编码。外部不知道 FacilityId 时,可传枚举接口 Factory.Code/Name/ShortName,由接口解析内部工厂公司 ID。
50
+ attr_accessor :facility_code
51
+
52
+ # 生产工序编号(MTO)
53
+ attr_accessor :process_route_id
54
+
55
+ # 工艺路线编码。外部不知道 ProcessRouteId 时,可传枚举接口 ProcessRoute.Code/Name,由接口解析内部工艺路线 ID。
56
+ attr_accessor :process_route_code
57
+
58
+ # 批次描述(MTO)
59
+ attr_accessor :batch
60
+
61
+ # 生成类型(0 MTO, 1 MTS)
62
+ attr_accessor :type
63
+
64
+ # 生产批次状态
65
+ attr_accessor :status
66
+
67
+ # 环境类型:0正式,1测试
68
+ attr_accessor :environment_type
69
+
70
+ # 创建用户ID
71
+ attr_accessor :created_by
72
+
73
+ # 创建时间
74
+ attr_accessor :created_at
75
+
76
+ # 公司ID
77
+ attr_accessor :company_id
78
+
79
+ # 租户ID
80
+ attr_accessor :tenant_id
81
+
82
+ # 修改用户ID
83
+ attr_accessor :updated_by
84
+
85
+ # 更新时间
86
+ attr_accessor :updated_at
87
+
88
+ # 计量单位(MTO)
89
+ attr_accessor :unit
90
+
91
+ # 申报情况是否完成,1完成:0未完成
92
+ attr_accessor :declare_complete
93
+
94
+ # 生产使用的bom版本
95
+ attr_accessor :use_bom_batch
96
+
97
+ # 成品入库单编号(MTS)
98
+ attr_accessor :receipt_number
99
+
100
+ # 入库日期(开始)(MTS)
101
+ attr_accessor :receipt_date
102
+
103
+ # 入库结束日期(MTS)
104
+ attr_accessor :receipt_end_date
105
+
106
+ # 销售订单明细id集合
107
+ attr_accessor :production_sales_order_list
108
+
109
+ # 领料信息
110
+ attr_accessor :production_raw_material_list
111
+
112
+ # 工厂名称
113
+ attr_accessor :facility_name
114
+
115
+ # 工艺步骤
116
+ attr_accessor :process_route_name
117
+
118
+ # 单位名称
119
+ attr_accessor :u_name
120
+
121
+ # MTS数量
122
+ attr_accessor :receipt_count
123
+
124
+ attr_accessor :production_sales_order
125
+
126
+ attr_accessor :order_line
127
+
128
+ attr_accessor :production_raw_material
129
+
130
+ # BOM分组逻辑下的提交结构
131
+ attr_accessor :product_bom_grouping_list
132
+
133
+ # 链条是否审核通过
134
+ attr_accessor :chain_review_status
135
+
136
+ attr_accessor :available_quantity
137
+
138
+ # 生产单类型:0 正常生产 、1 贸易生产
139
+ attr_accessor :is_trade
140
+
141
+ # 申报项(大申报使用)
142
+ attr_accessor :attachments
143
+
144
+ attr_accessor :is_approved
145
+
146
+ # Attribute mapping from ruby-style variable name to JSON key.
147
+ def self.attribute_map
148
+ {
149
+ :'id' => :'id',
150
+ :'number' => :'number',
151
+ :'production_date' => :'productionDate',
152
+ :'production_end_date' => :'productionEndDate',
153
+ :'product_id' => :'productId',
154
+ :'product_code' => :'productCode',
155
+ :'product_name' => :'productName',
156
+ :'product_color' => :'productColor',
157
+ :'quantity_produced' => :'quantityProduced',
158
+ :'facility_id' => :'facilityId',
159
+ :'facility_code' => :'facilityCode',
160
+ :'process_route_id' => :'processRouteId',
161
+ :'process_route_code' => :'processRouteCode',
162
+ :'batch' => :'batch',
163
+ :'type' => :'type',
164
+ :'status' => :'status',
165
+ :'environment_type' => :'environmentType',
166
+ :'created_by' => :'createdBy',
167
+ :'created_at' => :'createdAt',
168
+ :'company_id' => :'companyId',
169
+ :'tenant_id' => :'tenantId',
170
+ :'updated_by' => :'updatedBy',
171
+ :'updated_at' => :'updatedAt',
172
+ :'unit' => :'unit',
173
+ :'declare_complete' => :'declareComplete',
174
+ :'use_bom_batch' => :'useBomBatch',
175
+ :'receipt_number' => :'receiptNumber',
176
+ :'receipt_date' => :'receiptDate',
177
+ :'receipt_end_date' => :'receiptEndDate',
178
+ :'production_sales_order_list' => :'productionSalesOrderList',
179
+ :'production_raw_material_list' => :'productionRawMaterialList',
180
+ :'facility_name' => :'facilityName',
181
+ :'process_route_name' => :'processRouteName',
182
+ :'u_name' => :'uName',
183
+ :'receipt_count' => :'receiptCount',
184
+ :'production_sales_order' => :'productionSalesOrder',
185
+ :'order_line' => :'orderLine',
186
+ :'production_raw_material' => :'productionRawMaterial',
187
+ :'product_bom_grouping_list' => :'productBomGroupingList',
188
+ :'chain_review_status' => :'chainReviewStatus',
189
+ :'available_quantity' => :'availableQuantity',
190
+ :'is_trade' => :'isTrade',
191
+ :'attachments' => :'attachments',
192
+ :'is_approved' => :'isApproved'
193
+ }
194
+ end
195
+
196
+ # Returns attribute mapping this model knows about
197
+ def self.acceptable_attribute_map
198
+ attribute_map
199
+ end
200
+
201
+ # Returns all the JSON keys this model knows about
202
+ def self.acceptable_attributes
203
+ acceptable_attribute_map.values
204
+ end
205
+
206
+ # Attribute type mapping.
207
+ def self.openapi_types
208
+ {
209
+ :'id' => :'String',
210
+ :'number' => :'String',
211
+ :'production_date' => :'Time',
212
+ :'production_end_date' => :'Time',
213
+ :'product_id' => :'String',
214
+ :'product_code' => :'String',
215
+ :'product_name' => :'String',
216
+ :'product_color' => :'String',
217
+ :'quantity_produced' => :'Float',
218
+ :'facility_id' => :'String',
219
+ :'facility_code' => :'String',
220
+ :'process_route_id' => :'Integer',
221
+ :'process_route_code' => :'String',
222
+ :'batch' => :'String',
223
+ :'type' => :'Integer',
224
+ :'status' => :'Integer',
225
+ :'environment_type' => :'Integer',
226
+ :'created_by' => :'String',
227
+ :'created_at' => :'Time',
228
+ :'company_id' => :'String',
229
+ :'tenant_id' => :'String',
230
+ :'updated_by' => :'String',
231
+ :'updated_at' => :'Time',
232
+ :'unit' => :'String',
233
+ :'declare_complete' => :'Boolean',
234
+ :'use_bom_batch' => :'String',
235
+ :'receipt_number' => :'String',
236
+ :'receipt_date' => :'Time',
237
+ :'receipt_end_date' => :'Time',
238
+ :'production_sales_order_list' => :'Array<ProductionSalesOrderApiDto>',
239
+ :'production_raw_material_list' => :'Array<ProductionRawMaterialApiDto>',
240
+ :'facility_name' => :'String',
241
+ :'process_route_name' => :'String',
242
+ :'u_name' => :'String',
243
+ :'receipt_count' => :'Integer',
244
+ :'production_sales_order' => :'ProductionSalesOrderApiDto',
245
+ :'order_line' => :'OrderLineApiDto',
246
+ :'production_raw_material' => :'ProductionRawMaterialApiDto',
247
+ :'product_bom_grouping_list' => :'Array<ProductBomGroupingDto>',
248
+ :'chain_review_status' => :'Boolean',
249
+ :'available_quantity' => :'Float',
250
+ :'is_trade' => :'Integer',
251
+ :'attachments' => :'Array<Model1>',
252
+ :'is_approved' => :'Boolean'
253
+ }
254
+ end
255
+
256
+ # List of attributes with nullable: true
257
+ def self.openapi_nullable
258
+ Set.new([
259
+ :'id',
260
+ :'number',
261
+ :'production_date',
262
+ :'production_end_date',
263
+ :'product_id',
264
+ :'product_code',
265
+ :'product_name',
266
+ :'product_color',
267
+ :'quantity_produced',
268
+ :'facility_id',
269
+ :'facility_code',
270
+ :'process_route_id',
271
+ :'process_route_code',
272
+ :'batch',
273
+ :'type',
274
+ :'status',
275
+ :'environment_type',
276
+ :'created_by',
277
+ :'created_at',
278
+ :'company_id',
279
+ :'tenant_id',
280
+ :'updated_by',
281
+ :'updated_at',
282
+ :'unit',
283
+ :'declare_complete',
284
+ :'use_bom_batch',
285
+ :'receipt_number',
286
+ :'receipt_date',
287
+ :'receipt_end_date',
288
+ :'production_sales_order_list',
289
+ :'production_raw_material_list',
290
+ :'facility_name',
291
+ :'process_route_name',
292
+ :'u_name',
293
+ :'receipt_count',
294
+ :'product_bom_grouping_list',
295
+ :'chain_review_status',
296
+ :'available_quantity',
297
+ :'is_trade',
298
+ :'is_approved'
299
+ ])
300
+ end
301
+
302
+ # Initializes the object
303
+ # @param [Hash] attributes Model attributes in the form of hash
304
+ def initialize(attributes = {})
305
+ if (!attributes.is_a?(Hash))
306
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ProductionApiDto` initialize method"
307
+ end
308
+
309
+ # check to see if the attribute exists and convert string to symbol for hash key
310
+ acceptable_attribute_map = self.class.acceptable_attribute_map
311
+ attributes = attributes.each_with_object({}) { |(k, v), h|
312
+ if (!acceptable_attribute_map.key?(k.to_sym))
313
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ProductionApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
314
+ end
315
+ h[k.to_sym] = v
316
+ }
317
+
318
+ if attributes.key?(:'id')
319
+ self.id = attributes[:'id']
320
+ end
321
+
322
+ if attributes.key?(:'number')
323
+ self.number = attributes[:'number']
324
+ end
325
+
326
+ if attributes.key?(:'production_date')
327
+ self.production_date = attributes[:'production_date']
328
+ end
329
+
330
+ if attributes.key?(:'production_end_date')
331
+ self.production_end_date = attributes[:'production_end_date']
332
+ end
333
+
334
+ if attributes.key?(:'product_id')
335
+ self.product_id = attributes[:'product_id']
336
+ end
337
+
338
+ if attributes.key?(:'product_code')
339
+ self.product_code = attributes[:'product_code']
340
+ end
341
+
342
+ if attributes.key?(:'product_name')
343
+ self.product_name = attributes[:'product_name']
344
+ end
345
+
346
+ if attributes.key?(:'product_color')
347
+ self.product_color = attributes[:'product_color']
348
+ end
349
+
350
+ if attributes.key?(:'quantity_produced')
351
+ self.quantity_produced = attributes[:'quantity_produced']
352
+ end
353
+
354
+ if attributes.key?(:'facility_id')
355
+ self.facility_id = attributes[:'facility_id']
356
+ end
357
+
358
+ if attributes.key?(:'facility_code')
359
+ self.facility_code = attributes[:'facility_code']
360
+ end
361
+
362
+ if attributes.key?(:'process_route_id')
363
+ self.process_route_id = attributes[:'process_route_id']
364
+ end
365
+
366
+ if attributes.key?(:'process_route_code')
367
+ self.process_route_code = attributes[:'process_route_code']
368
+ end
369
+
370
+ if attributes.key?(:'batch')
371
+ self.batch = attributes[:'batch']
372
+ end
373
+
374
+ if attributes.key?(:'type')
375
+ self.type = attributes[:'type']
376
+ end
377
+
378
+ if attributes.key?(:'status')
379
+ self.status = attributes[:'status']
380
+ end
381
+
382
+ if attributes.key?(:'environment_type')
383
+ self.environment_type = attributes[:'environment_type']
384
+ end
385
+
386
+ if attributes.key?(:'created_by')
387
+ self.created_by = attributes[:'created_by']
388
+ end
389
+
390
+ if attributes.key?(:'created_at')
391
+ self.created_at = attributes[:'created_at']
392
+ end
393
+
394
+ if attributes.key?(:'company_id')
395
+ self.company_id = attributes[:'company_id']
396
+ end
397
+
398
+ if attributes.key?(:'tenant_id')
399
+ self.tenant_id = attributes[:'tenant_id']
400
+ end
401
+
402
+ if attributes.key?(:'updated_by')
403
+ self.updated_by = attributes[:'updated_by']
404
+ end
405
+
406
+ if attributes.key?(:'updated_at')
407
+ self.updated_at = attributes[:'updated_at']
408
+ end
409
+
410
+ if attributes.key?(:'unit')
411
+ self.unit = attributes[:'unit']
412
+ end
413
+
414
+ if attributes.key?(:'declare_complete')
415
+ self.declare_complete = attributes[:'declare_complete']
416
+ end
417
+
418
+ if attributes.key?(:'use_bom_batch')
419
+ self.use_bom_batch = attributes[:'use_bom_batch']
420
+ end
421
+
422
+ if attributes.key?(:'receipt_number')
423
+ self.receipt_number = attributes[:'receipt_number']
424
+ end
425
+
426
+ if attributes.key?(:'receipt_date')
427
+ self.receipt_date = attributes[:'receipt_date']
428
+ end
429
+
430
+ if attributes.key?(:'receipt_end_date')
431
+ self.receipt_end_date = attributes[:'receipt_end_date']
432
+ end
433
+
434
+ if attributes.key?(:'production_sales_order_list')
435
+ if (value = attributes[:'production_sales_order_list']).is_a?(Array)
436
+ self.production_sales_order_list = value
437
+ end
438
+ end
439
+
440
+ if attributes.key?(:'production_raw_material_list')
441
+ if (value = attributes[:'production_raw_material_list']).is_a?(Array)
442
+ self.production_raw_material_list = value
443
+ end
444
+ end
445
+
446
+ if attributes.key?(:'facility_name')
447
+ self.facility_name = attributes[:'facility_name']
448
+ end
449
+
450
+ if attributes.key?(:'process_route_name')
451
+ self.process_route_name = attributes[:'process_route_name']
452
+ end
453
+
454
+ if attributes.key?(:'u_name')
455
+ self.u_name = attributes[:'u_name']
456
+ end
457
+
458
+ if attributes.key?(:'receipt_count')
459
+ self.receipt_count = attributes[:'receipt_count']
460
+ end
461
+
462
+ if attributes.key?(:'production_sales_order')
463
+ self.production_sales_order = attributes[:'production_sales_order']
464
+ end
465
+
466
+ if attributes.key?(:'order_line')
467
+ self.order_line = attributes[:'order_line']
468
+ end
469
+
470
+ if attributes.key?(:'production_raw_material')
471
+ self.production_raw_material = attributes[:'production_raw_material']
472
+ end
473
+
474
+ if attributes.key?(:'product_bom_grouping_list')
475
+ if (value = attributes[:'product_bom_grouping_list']).is_a?(Array)
476
+ self.product_bom_grouping_list = value
477
+ end
478
+ end
479
+
480
+ if attributes.key?(:'chain_review_status')
481
+ self.chain_review_status = attributes[:'chain_review_status']
482
+ end
483
+
484
+ if attributes.key?(:'available_quantity')
485
+ self.available_quantity = attributes[:'available_quantity']
486
+ end
487
+
488
+ if attributes.key?(:'is_trade')
489
+ self.is_trade = attributes[:'is_trade']
490
+ end
491
+
492
+ if attributes.key?(:'attachments')
493
+ if (value = attributes[:'attachments']).is_a?(Array)
494
+ self.attachments = value
495
+ end
496
+ else
497
+ self.attachments = nil
498
+ end
499
+
500
+ if attributes.key?(:'is_approved')
501
+ self.is_approved = attributes[:'is_approved']
502
+ end
503
+ end
504
+
505
+ # Show invalid properties with the reasons. Usually used together with valid?
506
+ # @return Array for valid properties with the reasons
507
+ def list_invalid_properties
508
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
509
+ invalid_properties = Array.new
510
+ if @attachments.nil?
511
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
512
+ end
513
+
514
+ invalid_properties
515
+ end
516
+
517
+ # Check to see if the all the properties in the model are valid
518
+ # @return true if the model is valid
519
+ def valid?
520
+ warn '[DEPRECATED] the `valid?` method is obsolete'
521
+ return false if @attachments.nil?
522
+ true
523
+ end
524
+
525
+ # Custom attribute writer method with validation
526
+ # @param [Object] attachments Value to be assigned
527
+ def attachments=(attachments)
528
+ if attachments.nil?
529
+ fail ArgumentError, 'attachments cannot be nil'
530
+ end
531
+
532
+ @attachments = attachments
533
+ end
534
+
535
+ # Checks equality by comparing each attribute.
536
+ # @param [Object] Object to be compared
537
+ def ==(o)
538
+ return true if self.equal?(o)
539
+ self.class == o.class &&
540
+ id == o.id &&
541
+ number == o.number &&
542
+ production_date == o.production_date &&
543
+ production_end_date == o.production_end_date &&
544
+ product_id == o.product_id &&
545
+ product_code == o.product_code &&
546
+ product_name == o.product_name &&
547
+ product_color == o.product_color &&
548
+ quantity_produced == o.quantity_produced &&
549
+ facility_id == o.facility_id &&
550
+ facility_code == o.facility_code &&
551
+ process_route_id == o.process_route_id &&
552
+ process_route_code == o.process_route_code &&
553
+ batch == o.batch &&
554
+ type == o.type &&
555
+ status == o.status &&
556
+ environment_type == o.environment_type &&
557
+ created_by == o.created_by &&
558
+ created_at == o.created_at &&
559
+ company_id == o.company_id &&
560
+ tenant_id == o.tenant_id &&
561
+ updated_by == o.updated_by &&
562
+ updated_at == o.updated_at &&
563
+ unit == o.unit &&
564
+ declare_complete == o.declare_complete &&
565
+ use_bom_batch == o.use_bom_batch &&
566
+ receipt_number == o.receipt_number &&
567
+ receipt_date == o.receipt_date &&
568
+ receipt_end_date == o.receipt_end_date &&
569
+ production_sales_order_list == o.production_sales_order_list &&
570
+ production_raw_material_list == o.production_raw_material_list &&
571
+ facility_name == o.facility_name &&
572
+ process_route_name == o.process_route_name &&
573
+ u_name == o.u_name &&
574
+ receipt_count == o.receipt_count &&
575
+ production_sales_order == o.production_sales_order &&
576
+ order_line == o.order_line &&
577
+ production_raw_material == o.production_raw_material &&
578
+ product_bom_grouping_list == o.product_bom_grouping_list &&
579
+ chain_review_status == o.chain_review_status &&
580
+ available_quantity == o.available_quantity &&
581
+ is_trade == o.is_trade &&
582
+ attachments == o.attachments &&
583
+ is_approved == o.is_approved
584
+ end
585
+
586
+ # @see the `==` method
587
+ # @param [Object] Object to be compared
588
+ def eql?(o)
589
+ self == o
590
+ end
591
+
592
+ # Calculates hash code according to all attributes.
593
+ # @return [Integer] Hash code
594
+ def hash
595
+ [id, number, production_date, production_end_date, product_id, product_code, product_name, product_color, quantity_produced, facility_id, facility_code, process_route_id, process_route_code, batch, type, status, environment_type, created_by, created_at, company_id, tenant_id, updated_by, updated_at, unit, declare_complete, use_bom_batch, receipt_number, receipt_date, receipt_end_date, production_sales_order_list, production_raw_material_list, facility_name, process_route_name, u_name, receipt_count, production_sales_order, order_line, production_raw_material, product_bom_grouping_list, chain_review_status, available_quantity, is_trade, attachments, is_approved].hash
596
+ end
597
+
598
+ # Builds the object from hash
599
+ # @param [Hash] attributes Model attributes in the form of hash
600
+ # @return [Object] Returns the model itself
601
+ def self.build_from_hash(attributes)
602
+ return nil unless attributes.is_a?(Hash)
603
+ attributes = attributes.transform_keys(&:to_sym)
604
+ transformed_hash = {}
605
+ openapi_types.each_pair do |key, type|
606
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
607
+ transformed_hash["#{key}"] = nil
608
+ elsif type =~ /\AArray<(.*)>/i
609
+ # check to ensure the input is an array given that the attribute
610
+ # is documented as an array but the input is not
611
+ if attributes[attribute_map[key]].is_a?(Array)
612
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
613
+ end
614
+ elsif !attributes[attribute_map[key]].nil?
615
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
616
+ end
617
+ end
618
+ new(transformed_hash)
619
+ end
620
+
621
+ # Returns the object in the form of hash
622
+ # @return [Hash] Returns the object in the form of hash
623
+ def to_hash
624
+ hash = {}
625
+ self.class.attribute_map.each_pair do |attr, param|
626
+ value = self.send(attr)
627
+ if value.nil?
628
+ is_nullable = self.class.openapi_nullable.include?(attr)
629
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
630
+ end
631
+
632
+ hash[param] = _to_hash(value)
633
+ end
634
+ hash
635
+ end
636
+
637
+ end
638
+
639
+ end