tachain-sdk 0.1.0 → 0.1.1

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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +148 -60
  3. data/lib/tachain-sdk/api/api_declaration_api.rb +155 -84
  4. data/lib/tachain-sdk/api/api_declaration_upload_api.rb +103 -0
  5. data/lib/tachain-sdk/api/api_delivery_api.rb +218 -138
  6. data/lib/tachain-sdk/api/api_enum_api.rb +2 -2
  7. data/lib/tachain-sdk/api/api_material_api.rb +414 -0
  8. data/lib/tachain-sdk/api/api_order_api.rb +185 -167
  9. data/lib/tachain-sdk/api/api_order_workflow_api.rb +227 -24
  10. data/lib/tachain-sdk/api/api_process_route_api.rb +414 -0
  11. data/lib/tachain-sdk/api/api_product_api.rb +414 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +141 -136
  13. data/lib/tachain-sdk/api/api_reference_api.rb +192 -0
  14. data/lib/tachain-sdk/models/{product_bom_grouping_dto.rb → api_bom_line_request.rb} +82 -107
  15. data/lib/tachain-sdk/models/api_bom_line_response.rb +205 -0
  16. data/lib/tachain-sdk/models/api_catalog_delete_request.rb +191 -0
  17. data/lib/tachain-sdk/models/{stage_attachment_api_dto.rb → api_declaration_attachment_response.rb} +16 -108
  18. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +127 -17
  19. data/lib/tachain-sdk/models/api_declaration_document_request.rb +5 -27
  20. data/lib/tachain-sdk/models/api_declaration_file_request.rb +172 -0
  21. data/lib/tachain-sdk/models/api_declaration_form_request.rb +177 -0
  22. data/lib/tachain-sdk/models/{order_stage_form_datum_api_dto.rb → api_declaration_form_response.rb} +16 -49
  23. data/lib/tachain-sdk/models/api_declaration_list_response.rb +185 -0
  24. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +171 -20
  25. data/lib/tachain-sdk/models/{api_declaration_submit_result_dto.rb → api_declaration_submit_response.rb} +10 -42
  26. data/lib/tachain-sdk/models/api_delivery_create_request.rb +292 -0
  27. data/lib/tachain-sdk/models/{result_brand_report_unlinked_order_detail.rb → api_delivery_delete_request.rb} +84 -60
  28. data/lib/tachain-sdk/models/api_delivery_detail_create_request.rb +353 -0
  29. data/lib/tachain-sdk/models/{delivery_note_detail_api_dto.rb → api_delivery_detail_response.rb} +23 -82
  30. data/lib/tachain-sdk/models/api_delivery_detail_update_request.rb +358 -0
  31. data/lib/tachain-sdk/models/{delivery_note_api_dto.rb → api_delivery_response.rb} +22 -192
  32. data/lib/tachain-sdk/models/api_delivery_update_request.rb +287 -0
  33. data/lib/tachain-sdk/models/{order_stage_form_dto.rb → api_document_form_response.rb} +16 -65
  34. data/lib/tachain-sdk/models/{document_type_api_dto.rb → api_document_type_response.rb} +30 -125
  35. data/lib/tachain-sdk/models/api_enum_value_response.rb +193 -0
  36. data/lib/tachain-sdk/models/{api_response_string.rb → api_error_response.rb} +22 -34
  37. data/lib/tachain-sdk/models/api_fiber_composition_request.rb +193 -0
  38. data/lib/tachain-sdk/models/api_fiber_composition_response.rb +160 -0
  39. data/lib/tachain-sdk/models/{attachment_in_api_dto.rb → api_file_response.rb} +23 -115
  40. data/lib/tachain-sdk/models/api_file_upload_response.rb +150 -0
  41. data/lib/tachain-sdk/models/api_mapping_response.rb +182 -0
  42. data/lib/tachain-sdk/models/api_material_create_request.rb +556 -0
  43. data/lib/tachain-sdk/models/api_material_response.rb +349 -0
  44. data/lib/tachain-sdk/models/api_material_update_request.rb +582 -0
  45. data/lib/tachain-sdk/models/{result_mapping_order_select.rb → api_order_accept_request.rb} +105 -70
  46. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +106 -29
  47. data/lib/tachain-sdk/models/api_order_create_request.rb +379 -0
  48. data/lib/tachain-sdk/models/api_order_declaration_verification_request.rb +293 -0
  49. data/lib/tachain-sdk/models/api_order_declaration_verification_response.rb +203 -0
  50. data/lib/tachain-sdk/models/api_order_delete_line_request.rb +315 -0
  51. data/lib/tachain-sdk/models/api_order_delete_request.rb +315 -0
  52. data/lib/tachain-sdk/models/api_order_line_create_request.rb +445 -0
  53. data/lib/tachain-sdk/models/{order_line_api_dto.rb → api_order_line_response.rb} +39 -330
  54. data/lib/tachain-sdk/models/api_order_line_update_request.rb +416 -0
  55. data/lib/tachain-sdk/models/api_order_receipt_pending_line_response.rb +171 -0
  56. data/lib/tachain-sdk/models/{microsoft_asp_net_core_mvc_problem_details.rb → api_order_receipt_pending_response.rb} +28 -45
  57. data/lib/tachain-sdk/models/api_order_receipt_result.rb +185 -0
  58. data/lib/tachain-sdk/models/{order_api_dto.rb → api_order_response.rb} +35 -291
  59. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +102 -42
  60. data/lib/tachain-sdk/models/api_order_submit_audit_response.rb +196 -0
  61. data/lib/tachain-sdk/models/api_order_update_request.rb +408 -0
  62. data/lib/tachain-sdk/models/api_page_result1_api_delivery_response.rb +220 -0
  63. data/lib/tachain-sdk/models/api_page_result1_api_material_response.rb +220 -0
  64. data/lib/tachain-sdk/models/api_page_result1_api_order_response.rb +220 -0
  65. data/lib/tachain-sdk/models/api_page_result1_api_process_route_response.rb +220 -0
  66. data/lib/tachain-sdk/models/{api_response_api_declaration_list_dto.rb → api_page_result1_api_product_response.rb} +48 -27
  67. data/lib/tachain-sdk/models/api_page_result1_api_production_response.rb +220 -0
  68. data/lib/tachain-sdk/models/{result_api_enum.rb → api_process_route_create_request.rb} +88 -62
  69. data/lib/tachain-sdk/models/api_process_route_response.rb +237 -0
  70. data/lib/tachain-sdk/models/{paged_response_delivery_note_api_dto.rb → api_process_route_update_request.rb} +102 -91
  71. data/lib/tachain-sdk/models/api_process_step_request.rb +201 -0
  72. data/lib/tachain-sdk/models/api_process_step_response.rb +171 -0
  73. data/lib/tachain-sdk/models/api_product_create_request.rb +595 -0
  74. data/lib/tachain-sdk/models/api_product_response.rb +373 -0
  75. data/lib/tachain-sdk/models/api_product_update_request.rb +621 -0
  76. data/lib/tachain-sdk/models/api_production_create_request.rb +381 -0
  77. data/lib/tachain-sdk/models/{api_integration_delete_request.rb → api_production_delete_request.rb} +22 -11
  78. data/lib/tachain-sdk/models/api_production_raw_material_create_request.rb +320 -0
  79. data/lib/tachain-sdk/models/{production_raw_material_api_dto.rb → api_production_raw_material_response.rb} +18 -118
  80. data/lib/tachain-sdk/models/api_production_raw_material_update_request.rb +325 -0
  81. data/lib/tachain-sdk/models/{production_api_dto.rb → api_production_response.rb} +23 -156
  82. data/lib/tachain-sdk/models/api_production_sales_order_create_request.rb +309 -0
  83. data/lib/tachain-sdk/models/{production_sales_order_api_dto.rb → api_production_sales_order_response.rb} +17 -94
  84. data/lib/tachain-sdk/models/api_production_sales_order_update_request.rb +314 -0
  85. data/lib/tachain-sdk/models/api_production_update_request.rb +392 -0
  86. data/lib/tachain-sdk/models/api_receipt_pending_item_response.rb +207 -0
  87. data/lib/tachain-sdk/models/api_reference_page_response1_api_enum_value_response.rb +162 -0
  88. data/lib/tachain-sdk/models/api_reference_page_response1_api_mapping_response.rb +162 -0
  89. data/lib/tachain-sdk/models/{api_response_production_api_dto.rb → api_result1_api_declaration_list_response.rb} +20 -33
  90. data/lib/tachain-sdk/models/api_result1_api_declaration_submit_response.rb +186 -0
  91. data/lib/tachain-sdk/models/{api_response_delivery_note_api_dto.rb → api_result1_api_delivery_response.rb} +20 -33
  92. data/lib/tachain-sdk/models/api_result1_api_file_upload_response.rb +186 -0
  93. data/lib/tachain-sdk/models/api_result1_api_material_response.rb +186 -0
  94. data/lib/tachain-sdk/models/api_result1_api_order_declaration_verification_response.rb +186 -0
  95. data/lib/tachain-sdk/models/{api_response_api_declaration_submit_result_dto.rb → api_result1_api_order_receipt_pending_response.rb} +20 -33
  96. data/lib/tachain-sdk/models/api_result1_api_order_receipt_result.rb +186 -0
  97. data/lib/tachain-sdk/models/api_result1_api_order_response.rb +186 -0
  98. data/lib/tachain-sdk/models/api_result1_api_order_submit_audit_response.rb +186 -0
  99. data/lib/tachain-sdk/models/api_result1_api_process_route_response.rb +186 -0
  100. data/lib/tachain-sdk/models/api_result1_api_product_response.rb +186 -0
  101. data/lib/tachain-sdk/models/api_result1_api_production_response.rb +186 -0
  102. data/lib/tachain-sdk/models/{api_response_order_api_dto.rb → api_result1_string.rb} +22 -33
  103. data/lib/tachain-sdk/models/{attachment_in_api_create_dto.rb → api_verification_file_response.rb} +106 -84
  104. data/lib/tachain-sdk/models/api_verification_response.rb +218 -0
  105. data/lib/tachain-sdk/models/delete_v1_declaration_delete200_response.rb +103 -0
  106. data/lib/tachain-sdk/models/get_v1_declaration_list_paging200_response.rb +103 -0
  107. data/lib/tachain-sdk/models/get_v1_declaration_required_documents200_response.rb +103 -0
  108. data/lib/tachain-sdk/models/get_v1_delivery_list_paging200_response.rb +103 -0
  109. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +73 -171
  110. data/lib/tachain-sdk/models/get_v1_material_list_paging200_response.rb +103 -0
  111. data/lib/tachain-sdk/models/get_v1_order_po_list_paging200_response.rb +103 -0
  112. data/lib/tachain-sdk/models/get_v1_order_receipt_pending200_response.rb +103 -0
  113. data/lib/tachain-sdk/models/get_v1_process_route_list_paging200_response.rb +103 -0
  114. data/lib/tachain-sdk/models/get_v1_product_list_paging200_response.rb +103 -0
  115. data/lib/tachain-sdk/models/get_v1_production_list_paging200_response.rb +103 -0
  116. data/lib/tachain-sdk/models/get_v1_reference_enum_values200_response.rb +103 -0
  117. data/lib/tachain-sdk/models/get_v1_reference_mappings200_response.rb +103 -0
  118. data/lib/tachain-sdk/models/model1.rb +47 -14
  119. data/lib/tachain-sdk/models/model2.rb +190 -0
  120. data/lib/tachain-sdk/models/model3.rb +17 -33
  121. data/lib/tachain-sdk/models/model4.rb +17 -33
  122. data/lib/tachain-sdk/models/post_v1_declaration_submit200_response.rb +103 -0
  123. data/lib/tachain-sdk/models/post_v1_declaration_upload_file200_response.rb +103 -0
  124. data/lib/tachain-sdk/models/post_v1_material_create200_response.rb +103 -0
  125. data/lib/tachain-sdk/models/post_v1_order_create200_response.rb +103 -0
  126. data/lib/tachain-sdk/models/post_v1_order_declaration_verification200_response.rb +103 -0
  127. data/lib/tachain-sdk/models/post_v1_order_submit_audit200_response.rb +103 -0
  128. data/lib/tachain-sdk/models/post_v1_process_route_create200_response.rb +103 -0
  129. data/lib/tachain-sdk/models/post_v1_product_create200_response.rb +103 -0
  130. data/lib/tachain-sdk/models/post_v1_production_create200_response.rb +103 -0
  131. data/lib/tachain-sdk/models/put_v1_delivery_confirm_receipt200_response.rb +103 -0
  132. data/lib/tachain-sdk/models/put_v1_delivery_return_receipt200_response.rb +103 -0
  133. data/lib/tachain-sdk/models/put_v1_order_confirm_receipt200_response.rb +103 -0
  134. data/lib/tachain-sdk/version.rb +1 -1
  135. data/lib/tachain-sdk.rb +116 -51
  136. metadata +118 -53
  137. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +0 -251
  138. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +0 -334
  139. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +0 -880
  140. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +0 -749
  141. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +0 -513
  142. data/lib/tachain-sdk/models/company.rb +0 -780
  143. data/lib/tachain-sdk/models/company_compliance_profile.rb +0 -547
  144. data/lib/tachain-sdk/models/company_utility_declaration.rb +0 -592
  145. data/lib/tachain-sdk/models/customer.rb +0 -569
  146. data/lib/tachain-sdk/models/factory.rb +0 -545
  147. data/lib/tachain-sdk/models/order.rb +0 -974
  148. data/lib/tachain-sdk/models/order_line.rb +0 -1184
  149. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +0 -270
  150. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +0 -296
  151. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +0 -296
  152. data/lib/tachain-sdk/models/production_raw_material_dto.rb +0 -548
  153. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +0 -331
  154. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +0 -418
  155. data/lib/tachain-sdk/models/result_order_trace_report.rb +0 -721
  156. data/lib/tachain-sdk/models/supplier.rb +0 -585
  157. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +0 -383
  158. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +0 -456
  159. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +0 -227
  160. data/lib/tachain-sdk/models/trader.rb +0 -506
@@ -0,0 +1,392 @@
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 ApiProductionUpdateRequest < ApiModelBase
19
+ # 修改/删除时可使用查询返回的内部 ID;必须属于当前单据,保留原有 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_code
33
+
34
+ # 生产数量\\入库数量
35
+ attr_accessor :quantity_produced
36
+
37
+ # 生产工厂编码。外部不知道 FacilityId 时,可传枚举接口 Factory.Code/Name/ShortName,由接口解析内部工厂公司 ID。
38
+ attr_accessor :facility_code
39
+
40
+ # 工艺路线编码。外部不知道 ProcessRouteId 时,可传枚举接口 ProcessRoute.Code/Name,由接口解析内部工艺路线 ID。
41
+ attr_accessor :process_route_code
42
+
43
+ # 批次描述(MTO)
44
+ attr_accessor :batch
45
+
46
+ # 生成类型(0 MTO, 1 MTS)
47
+ attr_accessor :type
48
+
49
+ # 生产使用的bom版本 条件:启用 BOM 强制校验的成品需选择有效 BOM 版本;未启用时可省略。
50
+ attr_accessor :use_bom_batch
51
+
52
+ # 成品入库单编号(MTS) 条件:Type=1(MTS)时必填。
53
+ attr_accessor :receipt_number
54
+
55
+ # 入库日期(开始)(MTS) 条件:Type=1 时填写入库开始日期。
56
+ attr_accessor :receipt_date
57
+
58
+ # 入库结束日期(MTS)
59
+ attr_accessor :receipt_end_date
60
+
61
+ # ProductionRawMaterialList 业务明细。
62
+ attr_accessor :production_raw_material_list
63
+
64
+ # ProductionSalesOrderList 业务明细。
65
+ attr_accessor :production_sales_order_list
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'id' => :'id',
71
+ :'number' => :'number',
72
+ :'production_date' => :'productionDate',
73
+ :'production_end_date' => :'productionEndDate',
74
+ :'product_code' => :'productCode',
75
+ :'quantity_produced' => :'quantityProduced',
76
+ :'facility_code' => :'facilityCode',
77
+ :'process_route_code' => :'processRouteCode',
78
+ :'batch' => :'batch',
79
+ :'type' => :'type',
80
+ :'use_bom_batch' => :'useBomBatch',
81
+ :'receipt_number' => :'receiptNumber',
82
+ :'receipt_date' => :'receiptDate',
83
+ :'receipt_end_date' => :'receiptEndDate',
84
+ :'production_raw_material_list' => :'productionRawMaterialList',
85
+ :'production_sales_order_list' => :'productionSalesOrderList'
86
+ }
87
+ end
88
+
89
+ # Returns attribute mapping this model knows about
90
+ def self.acceptable_attribute_map
91
+ attribute_map
92
+ end
93
+
94
+ # Returns all the JSON keys this model knows about
95
+ def self.acceptable_attributes
96
+ acceptable_attribute_map.values
97
+ end
98
+
99
+ # Attribute type mapping.
100
+ def self.openapi_types
101
+ {
102
+ :'id' => :'String',
103
+ :'number' => :'String',
104
+ :'production_date' => :'Time',
105
+ :'production_end_date' => :'Time',
106
+ :'product_code' => :'String',
107
+ :'quantity_produced' => :'Float',
108
+ :'facility_code' => :'String',
109
+ :'process_route_code' => :'String',
110
+ :'batch' => :'String',
111
+ :'type' => :'Integer',
112
+ :'use_bom_batch' => :'String',
113
+ :'receipt_number' => :'String',
114
+ :'receipt_date' => :'Time',
115
+ :'receipt_end_date' => :'Time',
116
+ :'production_raw_material_list' => :'Array<ApiProductionRawMaterialUpdateRequest>',
117
+ :'production_sales_order_list' => :'Array<ApiProductionSalesOrderUpdateRequest>'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ :'id',
125
+ :'production_date',
126
+ :'production_end_date',
127
+ :'facility_code',
128
+ :'process_route_code',
129
+ :'batch',
130
+ :'type',
131
+ :'use_bom_batch',
132
+ :'receipt_number',
133
+ :'receipt_date',
134
+ :'receipt_end_date',
135
+ :'production_sales_order_list'
136
+ ])
137
+ end
138
+
139
+ # Initializes the object
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ def initialize(attributes = {})
142
+ if (!attributes.is_a?(Hash))
143
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductionUpdateRequest` initialize method"
144
+ end
145
+
146
+ # check to see if the attribute exists and convert string to symbol for hash key
147
+ acceptable_attribute_map = self.class.acceptable_attribute_map
148
+ attributes = attributes.each_with_object({}) { |(k, v), h|
149
+ if (!acceptable_attribute_map.key?(k.to_sym))
150
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductionUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
151
+ end
152
+ h[k.to_sym] = v
153
+ }
154
+
155
+ if attributes.key?(:'id')
156
+ self.id = attributes[:'id']
157
+ end
158
+
159
+ if attributes.key?(:'number')
160
+ self.number = attributes[:'number']
161
+ else
162
+ self.number = nil
163
+ end
164
+
165
+ if attributes.key?(:'production_date')
166
+ self.production_date = attributes[:'production_date']
167
+ end
168
+
169
+ if attributes.key?(:'production_end_date')
170
+ self.production_end_date = attributes[:'production_end_date']
171
+ end
172
+
173
+ if attributes.key?(:'product_code')
174
+ self.product_code = attributes[:'product_code']
175
+ else
176
+ self.product_code = nil
177
+ end
178
+
179
+ if attributes.key?(:'quantity_produced')
180
+ self.quantity_produced = attributes[:'quantity_produced']
181
+ else
182
+ self.quantity_produced = nil
183
+ end
184
+
185
+ if attributes.key?(:'facility_code')
186
+ self.facility_code = attributes[:'facility_code']
187
+ end
188
+
189
+ if attributes.key?(:'process_route_code')
190
+ self.process_route_code = attributes[:'process_route_code']
191
+ end
192
+
193
+ if attributes.key?(:'batch')
194
+ self.batch = attributes[:'batch']
195
+ end
196
+
197
+ if attributes.key?(:'type')
198
+ self.type = attributes[:'type']
199
+ end
200
+
201
+ if attributes.key?(:'use_bom_batch')
202
+ self.use_bom_batch = attributes[:'use_bom_batch']
203
+ end
204
+
205
+ if attributes.key?(:'receipt_number')
206
+ self.receipt_number = attributes[:'receipt_number']
207
+ end
208
+
209
+ if attributes.key?(:'receipt_date')
210
+ self.receipt_date = attributes[:'receipt_date']
211
+ end
212
+
213
+ if attributes.key?(:'receipt_end_date')
214
+ self.receipt_end_date = attributes[:'receipt_end_date']
215
+ end
216
+
217
+ if attributes.key?(:'production_raw_material_list')
218
+ if (value = attributes[:'production_raw_material_list']).is_a?(Array)
219
+ self.production_raw_material_list = value
220
+ end
221
+ else
222
+ self.production_raw_material_list = nil
223
+ end
224
+
225
+ if attributes.key?(:'production_sales_order_list')
226
+ if (value = attributes[:'production_sales_order_list']).is_a?(Array)
227
+ self.production_sales_order_list = value
228
+ end
229
+ end
230
+ end
231
+
232
+ # Show invalid properties with the reasons. Usually used together with valid?
233
+ # @return Array for valid properties with the reasons
234
+ def list_invalid_properties
235
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
236
+ invalid_properties = Array.new
237
+ if @number.nil?
238
+ invalid_properties.push('invalid value for "number", number cannot be nil.')
239
+ end
240
+
241
+ if @product_code.nil?
242
+ invalid_properties.push('invalid value for "product_code", product_code cannot be nil.')
243
+ end
244
+
245
+ if @quantity_produced.nil?
246
+ invalid_properties.push('invalid value for "quantity_produced", quantity_produced cannot be nil.')
247
+ end
248
+
249
+ if @production_raw_material_list.nil?
250
+ invalid_properties.push('invalid value for "production_raw_material_list", production_raw_material_list cannot be nil.')
251
+ end
252
+
253
+ if @production_raw_material_list.length < 1
254
+ invalid_properties.push('invalid value for "production_raw_material_list", number of items must be greater than or equal to 1.')
255
+ end
256
+
257
+ invalid_properties
258
+ end
259
+
260
+ # Check to see if the all the properties in the model are valid
261
+ # @return true if the model is valid
262
+ def valid?
263
+ warn '[DEPRECATED] the `valid?` method is obsolete'
264
+ return false if @number.nil?
265
+ return false if @product_code.nil?
266
+ return false if @quantity_produced.nil?
267
+ return false if @production_raw_material_list.nil?
268
+ return false if @production_raw_material_list.length < 1
269
+ true
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] number Value to be assigned
274
+ def number=(number)
275
+ if number.nil?
276
+ fail ArgumentError, 'number cannot be nil'
277
+ end
278
+
279
+ @number = number
280
+ end
281
+
282
+ # Custom attribute writer method with validation
283
+ # @param [Object] product_code Value to be assigned
284
+ def product_code=(product_code)
285
+ if product_code.nil?
286
+ fail ArgumentError, 'product_code cannot be nil'
287
+ end
288
+
289
+ @product_code = product_code
290
+ end
291
+
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] quantity_produced Value to be assigned
294
+ def quantity_produced=(quantity_produced)
295
+ if quantity_produced.nil?
296
+ fail ArgumentError, 'quantity_produced cannot be nil'
297
+ end
298
+
299
+ @quantity_produced = quantity_produced
300
+ end
301
+
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] production_raw_material_list Value to be assigned
304
+ def production_raw_material_list=(production_raw_material_list)
305
+ if production_raw_material_list.nil?
306
+ fail ArgumentError, 'production_raw_material_list cannot be nil'
307
+ end
308
+
309
+ if production_raw_material_list.length < 1
310
+ fail ArgumentError, 'invalid value for "production_raw_material_list", number of items must be greater than or equal to 1.'
311
+ end
312
+
313
+ @production_raw_material_list = production_raw_material_list
314
+ end
315
+
316
+ # Checks equality by comparing each attribute.
317
+ # @param [Object] Object to be compared
318
+ def ==(o)
319
+ return true if self.equal?(o)
320
+ self.class == o.class &&
321
+ id == o.id &&
322
+ number == o.number &&
323
+ production_date == o.production_date &&
324
+ production_end_date == o.production_end_date &&
325
+ product_code == o.product_code &&
326
+ quantity_produced == o.quantity_produced &&
327
+ facility_code == o.facility_code &&
328
+ process_route_code == o.process_route_code &&
329
+ batch == o.batch &&
330
+ type == o.type &&
331
+ use_bom_batch == o.use_bom_batch &&
332
+ receipt_number == o.receipt_number &&
333
+ receipt_date == o.receipt_date &&
334
+ receipt_end_date == o.receipt_end_date &&
335
+ production_raw_material_list == o.production_raw_material_list &&
336
+ production_sales_order_list == o.production_sales_order_list
337
+ end
338
+
339
+ # @see the `==` method
340
+ # @param [Object] Object to be compared
341
+ def eql?(o)
342
+ self == o
343
+ end
344
+
345
+ # Calculates hash code according to all attributes.
346
+ # @return [Integer] Hash code
347
+ def hash
348
+ [id, number, production_date, production_end_date, product_code, quantity_produced, facility_code, process_route_code, batch, type, use_bom_batch, receipt_number, receipt_date, receipt_end_date, production_raw_material_list, production_sales_order_list].hash
349
+ end
350
+
351
+ # Builds the object from hash
352
+ # @param [Hash] attributes Model attributes in the form of hash
353
+ # @return [Object] Returns the model itself
354
+ def self.build_from_hash(attributes)
355
+ return nil unless attributes.is_a?(Hash)
356
+ attributes = attributes.transform_keys(&:to_sym)
357
+ transformed_hash = {}
358
+ openapi_types.each_pair do |key, type|
359
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
360
+ transformed_hash["#{key}"] = nil
361
+ elsif type =~ /\AArray<(.*)>/i
362
+ # check to ensure the input is an array given that the attribute
363
+ # is documented as an array but the input is not
364
+ if attributes[attribute_map[key]].is_a?(Array)
365
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
366
+ end
367
+ elsif !attributes[attribute_map[key]].nil?
368
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
369
+ end
370
+ end
371
+ new(transformed_hash)
372
+ end
373
+
374
+ # Returns the object in the form of hash
375
+ # @return [Hash] Returns the object in the form of hash
376
+ def to_hash
377
+ hash = {}
378
+ self.class.attribute_map.each_pair do |attr, param|
379
+ value = self.send(attr)
380
+ if value.nil?
381
+ is_nullable = self.class.openapi_nullable.include?(attr)
382
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
383
+ end
384
+
385
+ hash[param] = _to_hash(value)
386
+ end
387
+ hash
388
+ end
389
+
390
+ end
391
+
392
+ end
@@ -0,0 +1,207 @@
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 ApiReceiptPendingItemResponse < ApiModelBase
19
+ # 业务模块:1 订单、2 生产、3 运输;0/5 为订单相关提示。
20
+ attr_accessor :type
21
+
22
+ # 收货待办分类码;与一键校验结果的 type 含义不同。
23
+ attr_accessor :error_type
24
+
25
+ # 相关业务数据的位置。
26
+ attr_accessor :position
27
+
28
+ # 按请求语言返回的提示,未指定语言时默认中文。
29
+ attr_accessor :message
30
+
31
+ # 相关业务编号。
32
+ attr_accessor :number
33
+
34
+ # 尚未完成的申报资料及要求。
35
+ attr_accessor :document_types
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'type' => :'type',
41
+ :'error_type' => :'errorType',
42
+ :'position' => :'position',
43
+ :'message' => :'message',
44
+ :'number' => :'number',
45
+ :'document_types' => :'documentTypes'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'type' => :'Integer',
63
+ :'error_type' => :'Integer',
64
+ :'position' => :'String',
65
+ :'message' => :'String',
66
+ :'number' => :'String',
67
+ :'document_types' => :'Array<ApiDocumentTypeResponse>'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'type',
75
+ :'error_type',
76
+ :'position',
77
+ :'message',
78
+ :'number',
79
+ :'document_types'
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiReceiptPendingItemResponse` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiReceiptPendingItemResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'type')
100
+ self.type = attributes[:'type']
101
+ end
102
+
103
+ if attributes.key?(:'error_type')
104
+ self.error_type = attributes[:'error_type']
105
+ end
106
+
107
+ if attributes.key?(:'position')
108
+ self.position = attributes[:'position']
109
+ end
110
+
111
+ if attributes.key?(:'message')
112
+ self.message = attributes[:'message']
113
+ end
114
+
115
+ if attributes.key?(:'number')
116
+ self.number = attributes[:'number']
117
+ end
118
+
119
+ if attributes.key?(:'document_types')
120
+ if (value = attributes[:'document_types']).is_a?(Array)
121
+ self.document_types = value
122
+ end
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
+ invalid_properties = Array.new
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ true
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ type == o.type &&
147
+ error_type == o.error_type &&
148
+ position == o.position &&
149
+ message == o.message &&
150
+ number == o.number &&
151
+ document_types == o.document_types
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Integer] Hash code
162
+ def hash
163
+ [type, error_type, position, message, number, document_types].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def self.build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ transformed_hash = {}
173
+ openapi_types.each_pair do |key, type|
174
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = nil
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[attribute_map[key]].is_a?(Array)
180
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
+ end
182
+ elsif !attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
+ end
185
+ end
186
+ new(transformed_hash)
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ end
206
+
207
+ end