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
@@ -14,50 +14,27 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TachainSdk
17
- class ProductBomGroupingDto < ApiModelBase
18
- attr_accessor :id
19
-
20
- attr_accessor :material_id
21
-
17
+ # API 专用业务模型。
18
+ class ApiBomLineRequest < ApiModelBase
19
+ # 当前公司的原料编码或原料外部映射值。
22
20
  attr_accessor :material_code
23
21
 
24
- attr_accessor :material_name
25
-
22
+ # 生产一单位成品所需原料用量,大于 0 且小于 100000000,最多 10 位小数;单位取原料主单位。
26
23
  attr_accessor :ratio
27
24
 
25
+ # 损耗率(%),0 至 100,最多 4 位小数,无损耗填 0。
28
26
  attr_accessor :loss
29
27
 
30
- attr_accessor :use_bom_batch
31
-
32
- # 成品入库单编号(MTS)
33
- attr_accessor :receipt_number
34
-
35
- # 入库日期(开始)(MTS)
36
- attr_accessor :receipt_date
37
-
38
- # 入库结束日期(MTS)
39
- attr_accessor :receipt_end_date
40
-
41
- # MTS生产单外键(MTS)
42
- attr_accessor :production_mts_id
43
-
44
- attr_accessor :child_items
28
+ # 备注;排列顺序由数组顺序决定。
29
+ attr_accessor :remark
45
30
 
46
31
  # Attribute mapping from ruby-style variable name to JSON key.
47
32
  def self.attribute_map
48
33
  {
49
- :'id' => :'id',
50
- :'material_id' => :'materialId',
51
34
  :'material_code' => :'materialCode',
52
- :'material_name' => :'materialName',
53
35
  :'ratio' => :'ratio',
54
36
  :'loss' => :'loss',
55
- :'use_bom_batch' => :'useBomBatch',
56
- :'receipt_number' => :'receiptNumber',
57
- :'receipt_date' => :'receiptDate',
58
- :'receipt_end_date' => :'receiptEndDate',
59
- :'production_mts_id' => :'productionMtsId',
60
- :'child_items' => :'childItems'
37
+ :'remark' => :'remark'
61
38
  }
62
39
  end
63
40
 
@@ -74,35 +51,17 @@ module TachainSdk
74
51
  # Attribute type mapping.
75
52
  def self.openapi_types
76
53
  {
77
- :'id' => :'String',
78
- :'material_id' => :'String',
79
54
  :'material_code' => :'String',
80
- :'material_name' => :'String',
81
55
  :'ratio' => :'Float',
82
56
  :'loss' => :'Float',
83
- :'use_bom_batch' => :'String',
84
- :'receipt_number' => :'String',
85
- :'receipt_date' => :'Time',
86
- :'receipt_end_date' => :'Time',
87
- :'production_mts_id' => :'String',
88
- :'child_items' => :'Array<ProductionRawMaterialDto>'
57
+ :'remark' => :'String'
89
58
  }
90
59
  end
91
60
 
92
61
  # List of attributes with nullable: true
93
62
  def self.openapi_nullable
94
63
  Set.new([
95
- :'id',
96
- :'material_id',
97
- :'material_code',
98
- :'material_name',
99
- :'ratio',
100
- :'loss',
101
- :'use_bom_batch',
102
- :'receipt_number',
103
- :'receipt_date',
104
- :'receipt_end_date',
105
- :'production_mts_id',
64
+ :'remark'
106
65
  ])
107
66
  end
108
67
 
@@ -110,78 +69,64 @@ module TachainSdk
110
69
  # @param [Hash] attributes Model attributes in the form of hash
111
70
  def initialize(attributes = {})
112
71
  if (!attributes.is_a?(Hash))
113
- fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ProductBomGroupingDto` initialize method"
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiBomLineRequest` initialize method"
114
73
  end
115
74
 
116
75
  # check to see if the attribute exists and convert string to symbol for hash key
117
76
  acceptable_attribute_map = self.class.acceptable_attribute_map
118
77
  attributes = attributes.each_with_object({}) { |(k, v), h|
119
78
  if (!acceptable_attribute_map.key?(k.to_sym))
120
- fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ProductBomGroupingDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiBomLineRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
121
80
  end
122
81
  h[k.to_sym] = v
123
82
  }
124
83
 
125
- if attributes.key?(:'id')
126
- self.id = attributes[:'id']
127
- end
128
-
129
- if attributes.key?(:'material_id')
130
- self.material_id = attributes[:'material_id']
131
- end
132
-
133
84
  if attributes.key?(:'material_code')
134
85
  self.material_code = attributes[:'material_code']
135
- end
136
-
137
- if attributes.key?(:'material_name')
138
- self.material_name = attributes[:'material_name']
86
+ else
87
+ self.material_code = nil
139
88
  end
140
89
 
141
90
  if attributes.key?(:'ratio')
142
91
  self.ratio = attributes[:'ratio']
92
+ else
93
+ self.ratio = nil
143
94
  end
144
95
 
145
96
  if attributes.key?(:'loss')
146
97
  self.loss = attributes[:'loss']
98
+ else
99
+ self.loss = nil
147
100
  end
148
101
 
149
- if attributes.key?(:'use_bom_batch')
150
- self.use_bom_batch = attributes[:'use_bom_batch']
151
- end
152
-
153
- if attributes.key?(:'receipt_number')
154
- self.receipt_number = attributes[:'receipt_number']
102
+ if attributes.key?(:'remark')
103
+ self.remark = attributes[:'remark']
155
104
  end
105
+ end
156
106
 
157
- if attributes.key?(:'receipt_date')
158
- self.receipt_date = attributes[:'receipt_date']
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @material_code.nil?
113
+ invalid_properties.push('invalid value for "material_code", material_code cannot be nil.')
159
114
  end
160
115
 
161
- if attributes.key?(:'receipt_end_date')
162
- self.receipt_end_date = attributes[:'receipt_end_date']
116
+ if @material_code.to_s.length > 255
117
+ invalid_properties.push('invalid value for "material_code", the character length must be smaller than or equal to 255.')
163
118
  end
164
119
 
165
- if attributes.key?(:'production_mts_id')
166
- self.production_mts_id = attributes[:'production_mts_id']
120
+ if @ratio.nil?
121
+ invalid_properties.push('invalid value for "ratio", ratio cannot be nil.')
167
122
  end
168
123
 
169
- if attributes.key?(:'child_items')
170
- if (value = attributes[:'child_items']).is_a?(Array)
171
- self.child_items = value
172
- end
173
- else
174
- self.child_items = nil
124
+ if @loss.nil?
125
+ invalid_properties.push('invalid value for "loss", loss cannot be nil.')
175
126
  end
176
- end
177
127
 
178
- # Show invalid properties with the reasons. Usually used together with valid?
179
- # @return Array for valid properties with the reasons
180
- def list_invalid_properties
181
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
182
- invalid_properties = Array.new
183
- if @child_items.nil?
184
- invalid_properties.push('invalid value for "child_items", child_items cannot be nil.')
128
+ if !@remark.nil? && @remark.to_s.length > 500
129
+ invalid_properties.push('invalid value for "remark", the character length must be smaller than or equal to 500.')
185
130
  end
186
131
 
187
132
  invalid_properties
@@ -191,18 +136,56 @@ module TachainSdk
191
136
  # @return true if the model is valid
192
137
  def valid?
193
138
  warn '[DEPRECATED] the `valid?` method is obsolete'
194
- return false if @child_items.nil?
139
+ return false if @material_code.nil?
140
+ return false if @material_code.to_s.length > 255
141
+ return false if @ratio.nil?
142
+ return false if @loss.nil?
143
+ return false if !@remark.nil? && @remark.to_s.length > 500
195
144
  true
196
145
  end
197
146
 
198
147
  # Custom attribute writer method with validation
199
- # @param [Object] child_items Value to be assigned
200
- def child_items=(child_items)
201
- if child_items.nil?
202
- fail ArgumentError, 'child_items cannot be nil'
148
+ # @param [Object] material_code Value to be assigned
149
+ def material_code=(material_code)
150
+ if material_code.nil?
151
+ fail ArgumentError, 'material_code cannot be nil'
152
+ end
153
+
154
+ if material_code.to_s.length > 255
155
+ fail ArgumentError, 'invalid value for "material_code", the character length must be smaller than or equal to 255.'
156
+ end
157
+
158
+ @material_code = material_code
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] ratio Value to be assigned
163
+ def ratio=(ratio)
164
+ if ratio.nil?
165
+ fail ArgumentError, 'ratio cannot be nil'
166
+ end
167
+
168
+ @ratio = ratio
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] loss Value to be assigned
173
+ def loss=(loss)
174
+ if loss.nil?
175
+ fail ArgumentError, 'loss cannot be nil'
176
+ end
177
+
178
+ @loss = loss
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] remark Value to be assigned
183
+ def remark=(remark)
184
+ if !remark.nil? && remark.to_s.length > 500
185
+ fail ArgumentError, 'invalid value for "remark", the character length must be smaller than or equal to 500.'
203
186
  end
204
187
 
205
- @child_items = child_items
188
+ @remark = remark
206
189
  end
207
190
 
208
191
  # Checks equality by comparing each attribute.
@@ -210,18 +193,10 @@ module TachainSdk
210
193
  def ==(o)
211
194
  return true if self.equal?(o)
212
195
  self.class == o.class &&
213
- id == o.id &&
214
- material_id == o.material_id &&
215
196
  material_code == o.material_code &&
216
- material_name == o.material_name &&
217
197
  ratio == o.ratio &&
218
198
  loss == o.loss &&
219
- use_bom_batch == o.use_bom_batch &&
220
- receipt_number == o.receipt_number &&
221
- receipt_date == o.receipt_date &&
222
- receipt_end_date == o.receipt_end_date &&
223
- production_mts_id == o.production_mts_id &&
224
- child_items == o.child_items
199
+ remark == o.remark
225
200
  end
226
201
 
227
202
  # @see the `==` method
@@ -233,7 +208,7 @@ module TachainSdk
233
208
  # Calculates hash code according to all attributes.
234
209
  # @return [Integer] Hash code
235
210
  def hash
236
- [id, material_id, material_code, material_name, ratio, loss, use_bom_batch, receipt_number, receipt_date, receipt_end_date, production_mts_id, child_items].hash
211
+ [material_code, ratio, loss, remark].hash
237
212
  end
238
213
 
239
214
  # Builds the object from hash
@@ -0,0 +1,205 @@
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
+ # API 专用业务模型。
18
+ class ApiBomLineResponse < ApiModelBase
19
+ # 原料编码,可用于采购订单 materialCode。
20
+ attr_accessor :material_code
21
+
22
+ # 原料名称。
23
+ attr_accessor :material_name
24
+
25
+ # 单位用量。
26
+ attr_accessor :ratio
27
+
28
+ # 损耗率(%)。
29
+ attr_accessor :loss
30
+
31
+ # 保存 BOM 时从所选原料主单位自动带出的业务编码;查询返回当时保存的单位。
32
+ attr_accessor :unit_code
33
+
34
+ # 备注。
35
+ attr_accessor :remark
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'material_code' => :'materialCode',
41
+ :'material_name' => :'materialName',
42
+ :'ratio' => :'ratio',
43
+ :'loss' => :'loss',
44
+ :'unit_code' => :'unitCode',
45
+ :'remark' => :'remark'
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
+ :'material_code' => :'String',
63
+ :'material_name' => :'String',
64
+ :'ratio' => :'Float',
65
+ :'loss' => :'Float',
66
+ :'unit_code' => :'String',
67
+ :'remark' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'material_code',
75
+ :'material_name',
76
+ :'ratio',
77
+ :'loss',
78
+ :'unit_code',
79
+ :'remark'
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::ApiBomLineResponse` 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::ApiBomLineResponse`. 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?(:'material_code')
100
+ self.material_code = attributes[:'material_code']
101
+ end
102
+
103
+ if attributes.key?(:'material_name')
104
+ self.material_name = attributes[:'material_name']
105
+ end
106
+
107
+ if attributes.key?(:'ratio')
108
+ self.ratio = attributes[:'ratio']
109
+ end
110
+
111
+ if attributes.key?(:'loss')
112
+ self.loss = attributes[:'loss']
113
+ end
114
+
115
+ if attributes.key?(:'unit_code')
116
+ self.unit_code = attributes[:'unit_code']
117
+ end
118
+
119
+ if attributes.key?(:'remark')
120
+ self.remark = attributes[:'remark']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ material_code == o.material_code &&
145
+ material_name == o.material_name &&
146
+ ratio == o.ratio &&
147
+ loss == o.loss &&
148
+ unit_code == o.unit_code &&
149
+ remark == o.remark
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ def hash
161
+ [material_code, material_name, ratio, loss, unit_code, remark].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def self.build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ attributes = attributes.transform_keys(&:to_sym)
170
+ transformed_hash = {}
171
+ openapi_types.each_pair do |key, type|
172
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
173
+ transformed_hash["#{key}"] = nil
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[attribute_map[key]].is_a?(Array)
178
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
179
+ end
180
+ elsif !attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
182
+ end
183
+ end
184
+ new(transformed_hash)
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ end
204
+
205
+ end
@@ -0,0 +1,191 @@
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
+ # API 专用业务模型。
18
+ class ApiCatalogDeleteRequest < ApiModelBase
19
+ # 要删除的业务编码。code 和 id 至少一项,同时提供时必须一致。
20
+ attr_accessor :code
21
+
22
+ # 查询返回的记录 ID;加工路线为数字的字符串。
23
+ attr_accessor :id
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'code' => :'code',
29
+ :'id' => :'id'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'code' => :'String',
47
+ :'id' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'code',
55
+ :'id'
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiCatalogDeleteRequest` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiCatalogDeleteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'code')
76
+ self.code = attributes[:'code']
77
+ end
78
+
79
+ if attributes.key?(:'id')
80
+ self.id = attributes[:'id']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if !@code.nil? && @code.to_s.length > 128
90
+ invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 128.')
91
+ end
92
+
93
+ if !@id.nil? && @id.to_s.length > 36
94
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 36.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ return false if !@code.nil? && @code.to_s.length > 128
105
+ return false if !@id.nil? && @id.to_s.length > 36
106
+ true
107
+ end
108
+
109
+ # Custom attribute writer method with validation
110
+ # @param [Object] code Value to be assigned
111
+ def code=(code)
112
+ if !code.nil? && code.to_s.length > 128
113
+ fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 128.'
114
+ end
115
+
116
+ @code = code
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] id Value to be assigned
121
+ def id=(id)
122
+ if !id.nil? && id.to_s.length > 36
123
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 36.'
124
+ end
125
+
126
+ @id = id
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ code == o.code &&
135
+ id == o.id
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [code, id].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
169
+ end
170
+ new(transformed_hash)
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ end
190
+
191
+ end