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.
- checksums.yaml +4 -4
- data/README.md +148 -60
- data/lib/tachain-sdk/api/api_declaration_api.rb +155 -84
- data/lib/tachain-sdk/api/api_declaration_upload_api.rb +103 -0
- data/lib/tachain-sdk/api/api_delivery_api.rb +218 -138
- data/lib/tachain-sdk/api/api_enum_api.rb +2 -2
- data/lib/tachain-sdk/api/api_material_api.rb +414 -0
- data/lib/tachain-sdk/api/api_order_api.rb +185 -167
- data/lib/tachain-sdk/api/api_order_workflow_api.rb +227 -24
- data/lib/tachain-sdk/api/api_process_route_api.rb +414 -0
- data/lib/tachain-sdk/api/api_product_api.rb +414 -0
- data/lib/tachain-sdk/api/api_production_api.rb +141 -136
- data/lib/tachain-sdk/api/api_reference_api.rb +192 -0
- data/lib/tachain-sdk/models/{product_bom_grouping_dto.rb → api_bom_line_request.rb} +82 -107
- data/lib/tachain-sdk/models/api_bom_line_response.rb +205 -0
- data/lib/tachain-sdk/models/api_catalog_delete_request.rb +191 -0
- data/lib/tachain-sdk/models/{stage_attachment_api_dto.rb → api_declaration_attachment_response.rb} +16 -108
- data/lib/tachain-sdk/models/api_declaration_delete_request.rb +127 -17
- data/lib/tachain-sdk/models/api_declaration_document_request.rb +5 -27
- data/lib/tachain-sdk/models/api_declaration_file_request.rb +172 -0
- data/lib/tachain-sdk/models/api_declaration_form_request.rb +177 -0
- data/lib/tachain-sdk/models/{order_stage_form_datum_api_dto.rb → api_declaration_form_response.rb} +16 -49
- data/lib/tachain-sdk/models/api_declaration_list_response.rb +185 -0
- data/lib/tachain-sdk/models/api_declaration_submit_request.rb +171 -20
- data/lib/tachain-sdk/models/{api_declaration_submit_result_dto.rb → api_declaration_submit_response.rb} +10 -42
- data/lib/tachain-sdk/models/api_delivery_create_request.rb +292 -0
- data/lib/tachain-sdk/models/{result_brand_report_unlinked_order_detail.rb → api_delivery_delete_request.rb} +84 -60
- data/lib/tachain-sdk/models/api_delivery_detail_create_request.rb +353 -0
- data/lib/tachain-sdk/models/{delivery_note_detail_api_dto.rb → api_delivery_detail_response.rb} +23 -82
- data/lib/tachain-sdk/models/api_delivery_detail_update_request.rb +358 -0
- data/lib/tachain-sdk/models/{delivery_note_api_dto.rb → api_delivery_response.rb} +22 -192
- data/lib/tachain-sdk/models/api_delivery_update_request.rb +287 -0
- data/lib/tachain-sdk/models/{order_stage_form_dto.rb → api_document_form_response.rb} +16 -65
- data/lib/tachain-sdk/models/{document_type_api_dto.rb → api_document_type_response.rb} +30 -125
- data/lib/tachain-sdk/models/api_enum_value_response.rb +193 -0
- data/lib/tachain-sdk/models/{api_response_string.rb → api_error_response.rb} +22 -34
- data/lib/tachain-sdk/models/api_fiber_composition_request.rb +193 -0
- data/lib/tachain-sdk/models/api_fiber_composition_response.rb +160 -0
- data/lib/tachain-sdk/models/{attachment_in_api_dto.rb → api_file_response.rb} +23 -115
- data/lib/tachain-sdk/models/api_file_upload_response.rb +150 -0
- data/lib/tachain-sdk/models/api_mapping_response.rb +182 -0
- data/lib/tachain-sdk/models/api_material_create_request.rb +556 -0
- data/lib/tachain-sdk/models/api_material_response.rb +349 -0
- data/lib/tachain-sdk/models/api_material_update_request.rb +582 -0
- data/lib/tachain-sdk/models/{result_mapping_order_select.rb → api_order_accept_request.rb} +105 -70
- data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +106 -29
- data/lib/tachain-sdk/models/api_order_create_request.rb +379 -0
- data/lib/tachain-sdk/models/api_order_declaration_verification_request.rb +293 -0
- data/lib/tachain-sdk/models/api_order_declaration_verification_response.rb +203 -0
- data/lib/tachain-sdk/models/api_order_delete_line_request.rb +315 -0
- data/lib/tachain-sdk/models/api_order_delete_request.rb +315 -0
- data/lib/tachain-sdk/models/api_order_line_create_request.rb +445 -0
- data/lib/tachain-sdk/models/{order_line_api_dto.rb → api_order_line_response.rb} +39 -330
- data/lib/tachain-sdk/models/api_order_line_update_request.rb +416 -0
- data/lib/tachain-sdk/models/api_order_receipt_pending_line_response.rb +171 -0
- data/lib/tachain-sdk/models/{microsoft_asp_net_core_mvc_problem_details.rb → api_order_receipt_pending_response.rb} +28 -45
- data/lib/tachain-sdk/models/api_order_receipt_result.rb +185 -0
- data/lib/tachain-sdk/models/{order_api_dto.rb → api_order_response.rb} +35 -291
- data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +102 -42
- data/lib/tachain-sdk/models/api_order_submit_audit_response.rb +196 -0
- data/lib/tachain-sdk/models/api_order_update_request.rb +408 -0
- data/lib/tachain-sdk/models/api_page_result1_api_delivery_response.rb +220 -0
- data/lib/tachain-sdk/models/api_page_result1_api_material_response.rb +220 -0
- data/lib/tachain-sdk/models/api_page_result1_api_order_response.rb +220 -0
- data/lib/tachain-sdk/models/api_page_result1_api_process_route_response.rb +220 -0
- data/lib/tachain-sdk/models/{api_response_api_declaration_list_dto.rb → api_page_result1_api_product_response.rb} +48 -27
- data/lib/tachain-sdk/models/api_page_result1_api_production_response.rb +220 -0
- data/lib/tachain-sdk/models/{result_api_enum.rb → api_process_route_create_request.rb} +88 -62
- data/lib/tachain-sdk/models/api_process_route_response.rb +237 -0
- data/lib/tachain-sdk/models/{paged_response_delivery_note_api_dto.rb → api_process_route_update_request.rb} +102 -91
- data/lib/tachain-sdk/models/api_process_step_request.rb +201 -0
- data/lib/tachain-sdk/models/api_process_step_response.rb +171 -0
- data/lib/tachain-sdk/models/api_product_create_request.rb +595 -0
- data/lib/tachain-sdk/models/api_product_response.rb +373 -0
- data/lib/tachain-sdk/models/api_product_update_request.rb +621 -0
- data/lib/tachain-sdk/models/api_production_create_request.rb +381 -0
- data/lib/tachain-sdk/models/{api_integration_delete_request.rb → api_production_delete_request.rb} +22 -11
- data/lib/tachain-sdk/models/api_production_raw_material_create_request.rb +320 -0
- data/lib/tachain-sdk/models/{production_raw_material_api_dto.rb → api_production_raw_material_response.rb} +18 -118
- data/lib/tachain-sdk/models/api_production_raw_material_update_request.rb +325 -0
- data/lib/tachain-sdk/models/{production_api_dto.rb → api_production_response.rb} +23 -156
- data/lib/tachain-sdk/models/api_production_sales_order_create_request.rb +309 -0
- data/lib/tachain-sdk/models/{production_sales_order_api_dto.rb → api_production_sales_order_response.rb} +17 -94
- data/lib/tachain-sdk/models/api_production_sales_order_update_request.rb +314 -0
- data/lib/tachain-sdk/models/api_production_update_request.rb +392 -0
- data/lib/tachain-sdk/models/api_receipt_pending_item_response.rb +207 -0
- data/lib/tachain-sdk/models/api_reference_page_response1_api_enum_value_response.rb +162 -0
- data/lib/tachain-sdk/models/api_reference_page_response1_api_mapping_response.rb +162 -0
- data/lib/tachain-sdk/models/{api_response_production_api_dto.rb → api_result1_api_declaration_list_response.rb} +20 -33
- data/lib/tachain-sdk/models/api_result1_api_declaration_submit_response.rb +186 -0
- data/lib/tachain-sdk/models/{api_response_delivery_note_api_dto.rb → api_result1_api_delivery_response.rb} +20 -33
- data/lib/tachain-sdk/models/api_result1_api_file_upload_response.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_material_response.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_order_declaration_verification_response.rb +186 -0
- data/lib/tachain-sdk/models/{api_response_api_declaration_submit_result_dto.rb → api_result1_api_order_receipt_pending_response.rb} +20 -33
- data/lib/tachain-sdk/models/api_result1_api_order_receipt_result.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_order_response.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_order_submit_audit_response.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_process_route_response.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_product_response.rb +186 -0
- data/lib/tachain-sdk/models/api_result1_api_production_response.rb +186 -0
- data/lib/tachain-sdk/models/{api_response_order_api_dto.rb → api_result1_string.rb} +22 -33
- data/lib/tachain-sdk/models/{attachment_in_api_create_dto.rb → api_verification_file_response.rb} +106 -84
- data/lib/tachain-sdk/models/api_verification_response.rb +218 -0
- data/lib/tachain-sdk/models/delete_v1_declaration_delete200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_declaration_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_declaration_required_documents200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_delivery_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +73 -171
- data/lib/tachain-sdk/models/get_v1_material_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_order_po_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_order_receipt_pending200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_process_route_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_product_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_production_list_paging200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_reference_enum_values200_response.rb +103 -0
- data/lib/tachain-sdk/models/get_v1_reference_mappings200_response.rb +103 -0
- data/lib/tachain-sdk/models/model1.rb +47 -14
- data/lib/tachain-sdk/models/model2.rb +190 -0
- data/lib/tachain-sdk/models/model3.rb +17 -33
- data/lib/tachain-sdk/models/model4.rb +17 -33
- data/lib/tachain-sdk/models/post_v1_declaration_submit200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_declaration_upload_file200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_material_create200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_order_create200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_order_declaration_verification200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_order_submit_audit200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_process_route_create200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_product_create200_response.rb +103 -0
- data/lib/tachain-sdk/models/post_v1_production_create200_response.rb +103 -0
- data/lib/tachain-sdk/models/put_v1_delivery_confirm_receipt200_response.rb +103 -0
- data/lib/tachain-sdk/models/put_v1_delivery_return_receipt200_response.rb +103 -0
- data/lib/tachain-sdk/models/put_v1_order_confirm_receipt200_response.rb +103 -0
- data/lib/tachain-sdk/version.rb +1 -1
- data/lib/tachain-sdk.rb +116 -51
- metadata +118 -53
- data/lib/tachain-sdk/models/api_declaration_list_dto.rb +0 -251
- data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +0 -334
- data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +0 -880
- data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +0 -749
- data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +0 -513
- data/lib/tachain-sdk/models/company.rb +0 -780
- data/lib/tachain-sdk/models/company_compliance_profile.rb +0 -547
- data/lib/tachain-sdk/models/company_utility_declaration.rb +0 -592
- data/lib/tachain-sdk/models/customer.rb +0 -569
- data/lib/tachain-sdk/models/factory.rb +0 -545
- data/lib/tachain-sdk/models/order.rb +0 -974
- data/lib/tachain-sdk/models/order_line.rb +0 -1184
- data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +0 -270
- data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +0 -296
- data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +0 -296
- data/lib/tachain-sdk/models/production_raw_material_dto.rb +0 -548
- data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +0 -331
- data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +0 -418
- data/lib/tachain-sdk/models/result_order_trace_report.rb +0 -721
- data/lib/tachain-sdk/models/supplier.rb +0 -585
- data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +0 -383
- data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +0 -456
- data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +0 -227
- data/lib/tachain-sdk/models/trader.rb +0 -506
|
@@ -0,0 +1,373 @@
|
|
|
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 ApiProductResponse < ApiModelBase
|
|
19
|
+
# 记录 ID,用于后续查询、修改或删除;无需自行生成。
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# 业务编码,原料用于订单 materialCode,成品用于接单及生产 productCode。
|
|
23
|
+
attr_accessor :code
|
|
24
|
+
|
|
25
|
+
# 名称。
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
# 加工阶段编码。
|
|
29
|
+
attr_accessor :scope_code
|
|
30
|
+
|
|
31
|
+
# 主单位业务编码;由保存的单位资料转换。
|
|
32
|
+
attr_accessor :unit_code
|
|
33
|
+
|
|
34
|
+
# 主单位名称。
|
|
35
|
+
attr_accessor :unit_name
|
|
36
|
+
|
|
37
|
+
# 第二单位业务编码。
|
|
38
|
+
attr_accessor :second_unit_code
|
|
39
|
+
|
|
40
|
+
# 物料大类编码,取 TeProductCategory 枚举 code。
|
|
41
|
+
attr_accessor :category_code
|
|
42
|
+
|
|
43
|
+
# 物料明细编码,取 TeProductCategoryDetail 枚举 code。
|
|
44
|
+
attr_accessor :detail_code
|
|
45
|
+
|
|
46
|
+
# 成品分类编码,取 ProductScope / ProductChildScope 枚举 code。
|
|
47
|
+
attr_accessor :goods_category
|
|
48
|
+
|
|
49
|
+
# 材料描述。
|
|
50
|
+
attr_accessor :description
|
|
51
|
+
|
|
52
|
+
# 批次号。
|
|
53
|
+
attr_accessor :batch
|
|
54
|
+
|
|
55
|
+
# 颜色。
|
|
56
|
+
attr_accessor :color
|
|
57
|
+
|
|
58
|
+
# 备注。
|
|
59
|
+
attr_accessor :remark
|
|
60
|
+
|
|
61
|
+
# 认证标准编码,取 Certification 枚举 code。
|
|
62
|
+
attr_accessor :certificate
|
|
63
|
+
|
|
64
|
+
# 原产国 ISO 二位码。
|
|
65
|
+
attr_accessor :origin_country
|
|
66
|
+
|
|
67
|
+
# 纤维成分与比例。
|
|
68
|
+
attr_accessor :components
|
|
69
|
+
|
|
70
|
+
# 创建时间,由服务端生成。
|
|
71
|
+
attr_accessor :created_at
|
|
72
|
+
|
|
73
|
+
# 最后修改时间,由服务端生成。
|
|
74
|
+
attr_accessor :updated_at
|
|
75
|
+
|
|
76
|
+
# 当前 BOM 版本号。
|
|
77
|
+
attr_accessor :bom_batch
|
|
78
|
+
|
|
79
|
+
# 当前版本 BOM 明细,按顺序返回。
|
|
80
|
+
attr_accessor :bom_lines
|
|
81
|
+
|
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
83
|
+
def self.attribute_map
|
|
84
|
+
{
|
|
85
|
+
:'id' => :'id',
|
|
86
|
+
:'code' => :'code',
|
|
87
|
+
:'name' => :'name',
|
|
88
|
+
:'scope_code' => :'scopeCode',
|
|
89
|
+
:'unit_code' => :'unitCode',
|
|
90
|
+
:'unit_name' => :'unitName',
|
|
91
|
+
:'second_unit_code' => :'secondUnitCode',
|
|
92
|
+
:'category_code' => :'categoryCode',
|
|
93
|
+
:'detail_code' => :'detailCode',
|
|
94
|
+
:'goods_category' => :'goodsCategory',
|
|
95
|
+
:'description' => :'description',
|
|
96
|
+
:'batch' => :'batch',
|
|
97
|
+
:'color' => :'color',
|
|
98
|
+
:'remark' => :'remark',
|
|
99
|
+
:'certificate' => :'certificate',
|
|
100
|
+
:'origin_country' => :'originCountry',
|
|
101
|
+
:'components' => :'components',
|
|
102
|
+
:'created_at' => :'createdAt',
|
|
103
|
+
:'updated_at' => :'updatedAt',
|
|
104
|
+
:'bom_batch' => :'bomBatch',
|
|
105
|
+
:'bom_lines' => :'bomLines'
|
|
106
|
+
}
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Returns attribute mapping this model knows about
|
|
110
|
+
def self.acceptable_attribute_map
|
|
111
|
+
attribute_map
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Returns all the JSON keys this model knows about
|
|
115
|
+
def self.acceptable_attributes
|
|
116
|
+
acceptable_attribute_map.values
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Attribute type mapping.
|
|
120
|
+
def self.openapi_types
|
|
121
|
+
{
|
|
122
|
+
:'id' => :'String',
|
|
123
|
+
:'code' => :'String',
|
|
124
|
+
:'name' => :'String',
|
|
125
|
+
:'scope_code' => :'String',
|
|
126
|
+
:'unit_code' => :'String',
|
|
127
|
+
:'unit_name' => :'String',
|
|
128
|
+
:'second_unit_code' => :'String',
|
|
129
|
+
:'category_code' => :'String',
|
|
130
|
+
:'detail_code' => :'String',
|
|
131
|
+
:'goods_category' => :'String',
|
|
132
|
+
:'description' => :'String',
|
|
133
|
+
:'batch' => :'String',
|
|
134
|
+
:'color' => :'String',
|
|
135
|
+
:'remark' => :'String',
|
|
136
|
+
:'certificate' => :'String',
|
|
137
|
+
:'origin_country' => :'String',
|
|
138
|
+
:'components' => :'Array<ApiFiberCompositionResponse>',
|
|
139
|
+
:'created_at' => :'Time',
|
|
140
|
+
:'updated_at' => :'Time',
|
|
141
|
+
:'bom_batch' => :'String',
|
|
142
|
+
:'bom_lines' => :'Array<ApiBomLineResponse>'
|
|
143
|
+
}
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# List of attributes with nullable: true
|
|
147
|
+
def self.openapi_nullable
|
|
148
|
+
Set.new([
|
|
149
|
+
:'id',
|
|
150
|
+
:'code',
|
|
151
|
+
:'name',
|
|
152
|
+
:'scope_code',
|
|
153
|
+
:'unit_code',
|
|
154
|
+
:'unit_name',
|
|
155
|
+
:'second_unit_code',
|
|
156
|
+
:'category_code',
|
|
157
|
+
:'detail_code',
|
|
158
|
+
:'goods_category',
|
|
159
|
+
:'description',
|
|
160
|
+
:'batch',
|
|
161
|
+
:'color',
|
|
162
|
+
:'remark',
|
|
163
|
+
:'certificate',
|
|
164
|
+
:'origin_country',
|
|
165
|
+
:'components',
|
|
166
|
+
:'updated_at',
|
|
167
|
+
:'bom_batch',
|
|
168
|
+
:'bom_lines'
|
|
169
|
+
])
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Initializes the object
|
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
174
|
+
def initialize(attributes = {})
|
|
175
|
+
if (!attributes.is_a?(Hash))
|
|
176
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductResponse` initialize method"
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
180
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
181
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
182
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
183
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
184
|
+
end
|
|
185
|
+
h[k.to_sym] = v
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if attributes.key?(:'id')
|
|
189
|
+
self.id = attributes[:'id']
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if attributes.key?(:'code')
|
|
193
|
+
self.code = attributes[:'code']
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if attributes.key?(:'name')
|
|
197
|
+
self.name = attributes[:'name']
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.key?(:'scope_code')
|
|
201
|
+
self.scope_code = attributes[:'scope_code']
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if attributes.key?(:'unit_code')
|
|
205
|
+
self.unit_code = attributes[:'unit_code']
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if attributes.key?(:'unit_name')
|
|
209
|
+
self.unit_name = attributes[:'unit_name']
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if attributes.key?(:'second_unit_code')
|
|
213
|
+
self.second_unit_code = attributes[:'second_unit_code']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if attributes.key?(:'category_code')
|
|
217
|
+
self.category_code = attributes[:'category_code']
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if attributes.key?(:'detail_code')
|
|
221
|
+
self.detail_code = attributes[:'detail_code']
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if attributes.key?(:'goods_category')
|
|
225
|
+
self.goods_category = attributes[:'goods_category']
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if attributes.key?(:'description')
|
|
229
|
+
self.description = attributes[:'description']
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if attributes.key?(:'batch')
|
|
233
|
+
self.batch = attributes[:'batch']
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if attributes.key?(:'color')
|
|
237
|
+
self.color = attributes[:'color']
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if attributes.key?(:'remark')
|
|
241
|
+
self.remark = attributes[:'remark']
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
if attributes.key?(:'certificate')
|
|
245
|
+
self.certificate = attributes[:'certificate']
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if attributes.key?(:'origin_country')
|
|
249
|
+
self.origin_country = attributes[:'origin_country']
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if attributes.key?(:'components')
|
|
253
|
+
if (value = attributes[:'components']).is_a?(Array)
|
|
254
|
+
self.components = value
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
if attributes.key?(:'created_at')
|
|
259
|
+
self.created_at = attributes[:'created_at']
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if attributes.key?(:'updated_at')
|
|
263
|
+
self.updated_at = attributes[:'updated_at']
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if attributes.key?(:'bom_batch')
|
|
267
|
+
self.bom_batch = attributes[:'bom_batch']
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if attributes.key?(:'bom_lines')
|
|
271
|
+
if (value = attributes[:'bom_lines']).is_a?(Array)
|
|
272
|
+
self.bom_lines = value
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
278
|
+
# @return Array for valid properties with the reasons
|
|
279
|
+
def list_invalid_properties
|
|
280
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
281
|
+
invalid_properties = Array.new
|
|
282
|
+
invalid_properties
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Check to see if the all the properties in the model are valid
|
|
286
|
+
# @return true if the model is valid
|
|
287
|
+
def valid?
|
|
288
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
289
|
+
true
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Checks equality by comparing each attribute.
|
|
293
|
+
# @param [Object] Object to be compared
|
|
294
|
+
def ==(o)
|
|
295
|
+
return true if self.equal?(o)
|
|
296
|
+
self.class == o.class &&
|
|
297
|
+
id == o.id &&
|
|
298
|
+
code == o.code &&
|
|
299
|
+
name == o.name &&
|
|
300
|
+
scope_code == o.scope_code &&
|
|
301
|
+
unit_code == o.unit_code &&
|
|
302
|
+
unit_name == o.unit_name &&
|
|
303
|
+
second_unit_code == o.second_unit_code &&
|
|
304
|
+
category_code == o.category_code &&
|
|
305
|
+
detail_code == o.detail_code &&
|
|
306
|
+
goods_category == o.goods_category &&
|
|
307
|
+
description == o.description &&
|
|
308
|
+
batch == o.batch &&
|
|
309
|
+
color == o.color &&
|
|
310
|
+
remark == o.remark &&
|
|
311
|
+
certificate == o.certificate &&
|
|
312
|
+
origin_country == o.origin_country &&
|
|
313
|
+
components == o.components &&
|
|
314
|
+
created_at == o.created_at &&
|
|
315
|
+
updated_at == o.updated_at &&
|
|
316
|
+
bom_batch == o.bom_batch &&
|
|
317
|
+
bom_lines == o.bom_lines
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# @see the `==` method
|
|
321
|
+
# @param [Object] Object to be compared
|
|
322
|
+
def eql?(o)
|
|
323
|
+
self == o
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Calculates hash code according to all attributes.
|
|
327
|
+
# @return [Integer] Hash code
|
|
328
|
+
def hash
|
|
329
|
+
[id, code, name, scope_code, unit_code, unit_name, second_unit_code, category_code, detail_code, goods_category, description, batch, color, remark, certificate, origin_country, components, created_at, updated_at, bom_batch, bom_lines].hash
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Builds the object from hash
|
|
333
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
334
|
+
# @return [Object] Returns the model itself
|
|
335
|
+
def self.build_from_hash(attributes)
|
|
336
|
+
return nil unless attributes.is_a?(Hash)
|
|
337
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
338
|
+
transformed_hash = {}
|
|
339
|
+
openapi_types.each_pair do |key, type|
|
|
340
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
341
|
+
transformed_hash["#{key}"] = nil
|
|
342
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
343
|
+
# check to ensure the input is an array given that the attribute
|
|
344
|
+
# is documented as an array but the input is not
|
|
345
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
346
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
347
|
+
end
|
|
348
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
349
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
new(transformed_hash)
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# Returns the object in the form of hash
|
|
356
|
+
# @return [Hash] Returns the object in the form of hash
|
|
357
|
+
def to_hash
|
|
358
|
+
hash = {}
|
|
359
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
360
|
+
value = self.send(attr)
|
|
361
|
+
if value.nil?
|
|
362
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
363
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
hash[param] = _to_hash(value)
|
|
367
|
+
end
|
|
368
|
+
hash
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
end
|