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,556 @@
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 ApiMaterialCreateRequest < ApiModelBase
19
+ # 业务编码;同一公司、环境和类型内唯一。修改时用于定位,编码不变。
20
+ attr_accessor :code
21
+
22
+ # 名称。
23
+ attr_accessor :name
24
+
25
+ # 加工阶段编码,取 Scope 枚举 code。
26
+ attr_accessor :scope_code
27
+
28
+ # 主计量单位,支持 Unit 枚举编码、名称或当前公司外部映射。
29
+ attr_accessor :unit
30
+
31
+ # 第二计量单位,取值规则同 unit;不使用时省略。
32
+ attr_accessor :second_unit
33
+
34
+ # 物料大类编码,取 TeProductCategory 枚举 code。
35
+ attr_accessor :category_code
36
+
37
+ # 物料明细编码,取 TeProductCategoryDetail 枚举 code。
38
+ attr_accessor :detail_code
39
+
40
+ # 成品分类编码,取 ProductScope / ProductChildScope 枚举 code。
41
+ attr_accessor :goods_category
42
+
43
+ # 材料描述。
44
+ attr_accessor :description
45
+
46
+ # 批次号,使用英文、数字及允许的英文符号。
47
+ attr_accessor :batch
48
+
49
+ # 颜色。
50
+ attr_accessor :color
51
+
52
+ # 备注。
53
+ attr_accessor :remark
54
+
55
+ # 认证标准编码,取 Certification 枚举 code。
56
+ attr_accessor :certificate
57
+
58
+ # 原产国,支持国家枚举编码、名称或外部映射,保存为 ISO 二位码。
59
+ attr_accessor :origin_country
60
+
61
+ # 纤维成分,非空时比例合计必须为 100;成品阶段配置要求成分时必填。
62
+ attr_accessor :components
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'code' => :'code',
68
+ :'name' => :'name',
69
+ :'scope_code' => :'scopeCode',
70
+ :'unit' => :'unit',
71
+ :'second_unit' => :'secondUnit',
72
+ :'category_code' => :'categoryCode',
73
+ :'detail_code' => :'detailCode',
74
+ :'goods_category' => :'goodsCategory',
75
+ :'description' => :'description',
76
+ :'batch' => :'batch',
77
+ :'color' => :'color',
78
+ :'remark' => :'remark',
79
+ :'certificate' => :'certificate',
80
+ :'origin_country' => :'originCountry',
81
+ :'components' => :'components'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'code' => :'String',
99
+ :'name' => :'String',
100
+ :'scope_code' => :'String',
101
+ :'unit' => :'String',
102
+ :'second_unit' => :'String',
103
+ :'category_code' => :'String',
104
+ :'detail_code' => :'String',
105
+ :'goods_category' => :'String',
106
+ :'description' => :'String',
107
+ :'batch' => :'String',
108
+ :'color' => :'String',
109
+ :'remark' => :'String',
110
+ :'certificate' => :'String',
111
+ :'origin_country' => :'String',
112
+ :'components' => :'Array<ApiFiberCompositionRequest>'
113
+ }
114
+ end
115
+
116
+ # List of attributes with nullable: true
117
+ def self.openapi_nullable
118
+ Set.new([
119
+ :'second_unit',
120
+ :'category_code',
121
+ :'detail_code',
122
+ :'goods_category',
123
+ :'description',
124
+ :'batch',
125
+ :'color',
126
+ :'remark',
127
+ :'certificate',
128
+ :'origin_country',
129
+ :'components'
130
+ ])
131
+ end
132
+
133
+ # Initializes the object
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ def initialize(attributes = {})
136
+ if (!attributes.is_a?(Hash))
137
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiMaterialCreateRequest` initialize method"
138
+ end
139
+
140
+ # check to see if the attribute exists and convert string to symbol for hash key
141
+ acceptable_attribute_map = self.class.acceptable_attribute_map
142
+ attributes = attributes.each_with_object({}) { |(k, v), h|
143
+ if (!acceptable_attribute_map.key?(k.to_sym))
144
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiMaterialCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
145
+ end
146
+ h[k.to_sym] = v
147
+ }
148
+
149
+ if attributes.key?(:'code')
150
+ self.code = attributes[:'code']
151
+ else
152
+ self.code = nil
153
+ end
154
+
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
157
+ else
158
+ self.name = nil
159
+ end
160
+
161
+ if attributes.key?(:'scope_code')
162
+ self.scope_code = attributes[:'scope_code']
163
+ else
164
+ self.scope_code = nil
165
+ end
166
+
167
+ if attributes.key?(:'unit')
168
+ self.unit = attributes[:'unit']
169
+ else
170
+ self.unit = nil
171
+ end
172
+
173
+ if attributes.key?(:'second_unit')
174
+ self.second_unit = attributes[:'second_unit']
175
+ end
176
+
177
+ if attributes.key?(:'category_code')
178
+ self.category_code = attributes[:'category_code']
179
+ end
180
+
181
+ if attributes.key?(:'detail_code')
182
+ self.detail_code = attributes[:'detail_code']
183
+ end
184
+
185
+ if attributes.key?(:'goods_category')
186
+ self.goods_category = attributes[:'goods_category']
187
+ end
188
+
189
+ if attributes.key?(:'description')
190
+ self.description = attributes[:'description']
191
+ end
192
+
193
+ if attributes.key?(:'batch')
194
+ self.batch = attributes[:'batch']
195
+ end
196
+
197
+ if attributes.key?(:'color')
198
+ self.color = attributes[:'color']
199
+ end
200
+
201
+ if attributes.key?(:'remark')
202
+ self.remark = attributes[:'remark']
203
+ end
204
+
205
+ if attributes.key?(:'certificate')
206
+ self.certificate = attributes[:'certificate']
207
+ end
208
+
209
+ if attributes.key?(:'origin_country')
210
+ self.origin_country = attributes[:'origin_country']
211
+ end
212
+
213
+ if attributes.key?(:'components')
214
+ if (value = attributes[:'components']).is_a?(Array)
215
+ self.components = value
216
+ end
217
+ end
218
+ end
219
+
220
+ # Show invalid properties with the reasons. Usually used together with valid?
221
+ # @return Array for valid properties with the reasons
222
+ def list_invalid_properties
223
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
224
+ invalid_properties = Array.new
225
+ if @code.nil?
226
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
227
+ end
228
+
229
+ if @code.to_s.length > 128
230
+ invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 128.')
231
+ end
232
+
233
+ if @name.nil?
234
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
235
+ end
236
+
237
+ if @name.to_s.length > 255
238
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
239
+ end
240
+
241
+ if @scope_code.nil?
242
+ invalid_properties.push('invalid value for "scope_code", scope_code cannot be nil.')
243
+ end
244
+
245
+ if @scope_code.to_s.length > 255
246
+ invalid_properties.push('invalid value for "scope_code", the character length must be smaller than or equal to 255.')
247
+ end
248
+
249
+ if @unit.nil?
250
+ invalid_properties.push('invalid value for "unit", unit cannot be nil.')
251
+ end
252
+
253
+ if @unit.to_s.length > 255
254
+ invalid_properties.push('invalid value for "unit", the character length must be smaller than or equal to 255.')
255
+ end
256
+
257
+ if !@second_unit.nil? && @second_unit.to_s.length > 255
258
+ invalid_properties.push('invalid value for "second_unit", the character length must be smaller than or equal to 255.')
259
+ end
260
+
261
+ if !@category_code.nil? && @category_code.to_s.length > 36
262
+ invalid_properties.push('invalid value for "category_code", the character length must be smaller than or equal to 36.')
263
+ end
264
+
265
+ if !@detail_code.nil? && @detail_code.to_s.length > 36
266
+ invalid_properties.push('invalid value for "detail_code", the character length must be smaller than or equal to 36.')
267
+ end
268
+
269
+ if !@goods_category.nil? && @goods_category.to_s.length > 100
270
+ invalid_properties.push('invalid value for "goods_category", the character length must be smaller than or equal to 100.')
271
+ end
272
+
273
+ if !@description.nil? && @description.to_s.length > 255
274
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
275
+ end
276
+
277
+ if !@batch.nil? && @batch.to_s.length > 255
278
+ invalid_properties.push('invalid value for "batch", the character length must be smaller than or equal to 255.')
279
+ end
280
+
281
+ if !@color.nil? && @color.to_s.length > 256
282
+ invalid_properties.push('invalid value for "color", the character length must be smaller than or equal to 256.')
283
+ end
284
+
285
+ if !@remark.nil? && @remark.to_s.length > 500
286
+ invalid_properties.push('invalid value for "remark", the character length must be smaller than or equal to 500.')
287
+ end
288
+
289
+ if !@certificate.nil? && @certificate.to_s.length > 125
290
+ invalid_properties.push('invalid value for "certificate", the character length must be smaller than or equal to 125.')
291
+ end
292
+
293
+ if !@origin_country.nil? && @origin_country.to_s.length > 255
294
+ invalid_properties.push('invalid value for "origin_country", the character length must be smaller than or equal to 255.')
295
+ end
296
+
297
+ invalid_properties
298
+ end
299
+
300
+ # Check to see if the all the properties in the model are valid
301
+ # @return true if the model is valid
302
+ def valid?
303
+ warn '[DEPRECATED] the `valid?` method is obsolete'
304
+ return false if @code.nil?
305
+ return false if @code.to_s.length > 128
306
+ return false if @name.nil?
307
+ return false if @name.to_s.length > 255
308
+ return false if @scope_code.nil?
309
+ return false if @scope_code.to_s.length > 255
310
+ return false if @unit.nil?
311
+ return false if @unit.to_s.length > 255
312
+ return false if !@second_unit.nil? && @second_unit.to_s.length > 255
313
+ return false if !@category_code.nil? && @category_code.to_s.length > 36
314
+ return false if !@detail_code.nil? && @detail_code.to_s.length > 36
315
+ return false if !@goods_category.nil? && @goods_category.to_s.length > 100
316
+ return false if !@description.nil? && @description.to_s.length > 255
317
+ return false if !@batch.nil? && @batch.to_s.length > 255
318
+ return false if !@color.nil? && @color.to_s.length > 256
319
+ return false if !@remark.nil? && @remark.to_s.length > 500
320
+ return false if !@certificate.nil? && @certificate.to_s.length > 125
321
+ return false if !@origin_country.nil? && @origin_country.to_s.length > 255
322
+ true
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] code Value to be assigned
327
+ def code=(code)
328
+ if code.nil?
329
+ fail ArgumentError, 'code cannot be nil'
330
+ end
331
+
332
+ if code.to_s.length > 128
333
+ fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 128.'
334
+ end
335
+
336
+ @code = code
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] name Value to be assigned
341
+ def name=(name)
342
+ if name.nil?
343
+ fail ArgumentError, 'name cannot be nil'
344
+ end
345
+
346
+ if name.to_s.length > 255
347
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
348
+ end
349
+
350
+ @name = name
351
+ end
352
+
353
+ # Custom attribute writer method with validation
354
+ # @param [Object] scope_code Value to be assigned
355
+ def scope_code=(scope_code)
356
+ if scope_code.nil?
357
+ fail ArgumentError, 'scope_code cannot be nil'
358
+ end
359
+
360
+ if scope_code.to_s.length > 255
361
+ fail ArgumentError, 'invalid value for "scope_code", the character length must be smaller than or equal to 255.'
362
+ end
363
+
364
+ @scope_code = scope_code
365
+ end
366
+
367
+ # Custom attribute writer method with validation
368
+ # @param [Object] unit Value to be assigned
369
+ def unit=(unit)
370
+ if unit.nil?
371
+ fail ArgumentError, 'unit cannot be nil'
372
+ end
373
+
374
+ if unit.to_s.length > 255
375
+ fail ArgumentError, 'invalid value for "unit", the character length must be smaller than or equal to 255.'
376
+ end
377
+
378
+ @unit = unit
379
+ end
380
+
381
+ # Custom attribute writer method with validation
382
+ # @param [Object] second_unit Value to be assigned
383
+ def second_unit=(second_unit)
384
+ if !second_unit.nil? && second_unit.to_s.length > 255
385
+ fail ArgumentError, 'invalid value for "second_unit", the character length must be smaller than or equal to 255.'
386
+ end
387
+
388
+ @second_unit = second_unit
389
+ end
390
+
391
+ # Custom attribute writer method with validation
392
+ # @param [Object] category_code Value to be assigned
393
+ def category_code=(category_code)
394
+ if !category_code.nil? && category_code.to_s.length > 36
395
+ fail ArgumentError, 'invalid value for "category_code", the character length must be smaller than or equal to 36.'
396
+ end
397
+
398
+ @category_code = category_code
399
+ end
400
+
401
+ # Custom attribute writer method with validation
402
+ # @param [Object] detail_code Value to be assigned
403
+ def detail_code=(detail_code)
404
+ if !detail_code.nil? && detail_code.to_s.length > 36
405
+ fail ArgumentError, 'invalid value for "detail_code", the character length must be smaller than or equal to 36.'
406
+ end
407
+
408
+ @detail_code = detail_code
409
+ end
410
+
411
+ # Custom attribute writer method with validation
412
+ # @param [Object] goods_category Value to be assigned
413
+ def goods_category=(goods_category)
414
+ if !goods_category.nil? && goods_category.to_s.length > 100
415
+ fail ArgumentError, 'invalid value for "goods_category", the character length must be smaller than or equal to 100.'
416
+ end
417
+
418
+ @goods_category = goods_category
419
+ end
420
+
421
+ # Custom attribute writer method with validation
422
+ # @param [Object] description Value to be assigned
423
+ def description=(description)
424
+ if !description.nil? && description.to_s.length > 255
425
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
426
+ end
427
+
428
+ @description = description
429
+ end
430
+
431
+ # Custom attribute writer method with validation
432
+ # @param [Object] batch Value to be assigned
433
+ def batch=(batch)
434
+ if !batch.nil? && batch.to_s.length > 255
435
+ fail ArgumentError, 'invalid value for "batch", the character length must be smaller than or equal to 255.'
436
+ end
437
+
438
+ @batch = batch
439
+ end
440
+
441
+ # Custom attribute writer method with validation
442
+ # @param [Object] color Value to be assigned
443
+ def color=(color)
444
+ if !color.nil? && color.to_s.length > 256
445
+ fail ArgumentError, 'invalid value for "color", the character length must be smaller than or equal to 256.'
446
+ end
447
+
448
+ @color = color
449
+ end
450
+
451
+ # Custom attribute writer method with validation
452
+ # @param [Object] remark Value to be assigned
453
+ def remark=(remark)
454
+ if !remark.nil? && remark.to_s.length > 500
455
+ fail ArgumentError, 'invalid value for "remark", the character length must be smaller than or equal to 500.'
456
+ end
457
+
458
+ @remark = remark
459
+ end
460
+
461
+ # Custom attribute writer method with validation
462
+ # @param [Object] certificate Value to be assigned
463
+ def certificate=(certificate)
464
+ if !certificate.nil? && certificate.to_s.length > 125
465
+ fail ArgumentError, 'invalid value for "certificate", the character length must be smaller than or equal to 125.'
466
+ end
467
+
468
+ @certificate = certificate
469
+ end
470
+
471
+ # Custom attribute writer method with validation
472
+ # @param [Object] origin_country Value to be assigned
473
+ def origin_country=(origin_country)
474
+ if !origin_country.nil? && origin_country.to_s.length > 255
475
+ fail ArgumentError, 'invalid value for "origin_country", the character length must be smaller than or equal to 255.'
476
+ end
477
+
478
+ @origin_country = origin_country
479
+ end
480
+
481
+ # Checks equality by comparing each attribute.
482
+ # @param [Object] Object to be compared
483
+ def ==(o)
484
+ return true if self.equal?(o)
485
+ self.class == o.class &&
486
+ code == o.code &&
487
+ name == o.name &&
488
+ scope_code == o.scope_code &&
489
+ unit == o.unit &&
490
+ second_unit == o.second_unit &&
491
+ category_code == o.category_code &&
492
+ detail_code == o.detail_code &&
493
+ goods_category == o.goods_category &&
494
+ description == o.description &&
495
+ batch == o.batch &&
496
+ color == o.color &&
497
+ remark == o.remark &&
498
+ certificate == o.certificate &&
499
+ origin_country == o.origin_country &&
500
+ components == o.components
501
+ end
502
+
503
+ # @see the `==` method
504
+ # @param [Object] Object to be compared
505
+ def eql?(o)
506
+ self == o
507
+ end
508
+
509
+ # Calculates hash code according to all attributes.
510
+ # @return [Integer] Hash code
511
+ def hash
512
+ [code, name, scope_code, unit, second_unit, category_code, detail_code, goods_category, description, batch, color, remark, certificate, origin_country, components].hash
513
+ end
514
+
515
+ # Builds the object from hash
516
+ # @param [Hash] attributes Model attributes in the form of hash
517
+ # @return [Object] Returns the model itself
518
+ def self.build_from_hash(attributes)
519
+ return nil unless attributes.is_a?(Hash)
520
+ attributes = attributes.transform_keys(&:to_sym)
521
+ transformed_hash = {}
522
+ openapi_types.each_pair do |key, type|
523
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
524
+ transformed_hash["#{key}"] = nil
525
+ elsif type =~ /\AArray<(.*)>/i
526
+ # check to ensure the input is an array given that the attribute
527
+ # is documented as an array but the input is not
528
+ if attributes[attribute_map[key]].is_a?(Array)
529
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
530
+ end
531
+ elsif !attributes[attribute_map[key]].nil?
532
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
533
+ end
534
+ end
535
+ new(transformed_hash)
536
+ end
537
+
538
+ # Returns the object in the form of hash
539
+ # @return [Hash] Returns the object in the form of hash
540
+ def to_hash
541
+ hash = {}
542
+ self.class.attribute_map.each_pair do |attr, param|
543
+ value = self.send(attr)
544
+ if value.nil?
545
+ is_nullable = self.class.openapi_nullable.include?(attr)
546
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
547
+ end
548
+
549
+ hash[param] = _to_hash(value)
550
+ end
551
+ hash
552
+ end
553
+
554
+ end
555
+
556
+ end