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,595 @@
|
|
|
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 ApiProductCreateRequest < 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
|
+
# BOM 版本号;提交 bomLines 时必填。
|
|
65
|
+
attr_accessor :bom_batch
|
|
66
|
+
|
|
67
|
+
# 当前 bomBatch 的完整 BOM 明细;省略保留,空数组清空该版本。原料单位从原料资料自动带出。
|
|
68
|
+
attr_accessor :bom_lines
|
|
69
|
+
|
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
71
|
+
def self.attribute_map
|
|
72
|
+
{
|
|
73
|
+
:'code' => :'code',
|
|
74
|
+
:'name' => :'name',
|
|
75
|
+
:'scope_code' => :'scopeCode',
|
|
76
|
+
:'unit' => :'unit',
|
|
77
|
+
:'second_unit' => :'secondUnit',
|
|
78
|
+
:'category_code' => :'categoryCode',
|
|
79
|
+
:'detail_code' => :'detailCode',
|
|
80
|
+
:'goods_category' => :'goodsCategory',
|
|
81
|
+
:'description' => :'description',
|
|
82
|
+
:'batch' => :'batch',
|
|
83
|
+
:'color' => :'color',
|
|
84
|
+
:'remark' => :'remark',
|
|
85
|
+
:'certificate' => :'certificate',
|
|
86
|
+
:'origin_country' => :'originCountry',
|
|
87
|
+
:'components' => :'components',
|
|
88
|
+
:'bom_batch' => :'bomBatch',
|
|
89
|
+
:'bom_lines' => :'bomLines'
|
|
90
|
+
}
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Returns attribute mapping this model knows about
|
|
94
|
+
def self.acceptable_attribute_map
|
|
95
|
+
attribute_map
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Returns all the JSON keys this model knows about
|
|
99
|
+
def self.acceptable_attributes
|
|
100
|
+
acceptable_attribute_map.values
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Attribute type mapping.
|
|
104
|
+
def self.openapi_types
|
|
105
|
+
{
|
|
106
|
+
:'code' => :'String',
|
|
107
|
+
:'name' => :'String',
|
|
108
|
+
:'scope_code' => :'String',
|
|
109
|
+
:'unit' => :'String',
|
|
110
|
+
:'second_unit' => :'String',
|
|
111
|
+
:'category_code' => :'String',
|
|
112
|
+
:'detail_code' => :'String',
|
|
113
|
+
:'goods_category' => :'String',
|
|
114
|
+
:'description' => :'String',
|
|
115
|
+
:'batch' => :'String',
|
|
116
|
+
:'color' => :'String',
|
|
117
|
+
:'remark' => :'String',
|
|
118
|
+
:'certificate' => :'String',
|
|
119
|
+
:'origin_country' => :'String',
|
|
120
|
+
:'components' => :'Array<ApiFiberCompositionRequest>',
|
|
121
|
+
:'bom_batch' => :'String',
|
|
122
|
+
:'bom_lines' => :'Array<ApiBomLineRequest>'
|
|
123
|
+
}
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# List of attributes with nullable: true
|
|
127
|
+
def self.openapi_nullable
|
|
128
|
+
Set.new([
|
|
129
|
+
:'second_unit',
|
|
130
|
+
:'category_code',
|
|
131
|
+
:'detail_code',
|
|
132
|
+
:'goods_category',
|
|
133
|
+
:'description',
|
|
134
|
+
:'batch',
|
|
135
|
+
:'color',
|
|
136
|
+
:'remark',
|
|
137
|
+
:'certificate',
|
|
138
|
+
:'origin_country',
|
|
139
|
+
:'components',
|
|
140
|
+
:'bom_batch',
|
|
141
|
+
:'bom_lines'
|
|
142
|
+
])
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Initializes the object
|
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
147
|
+
def initialize(attributes = {})
|
|
148
|
+
if (!attributes.is_a?(Hash))
|
|
149
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductCreateRequest` initialize method"
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
153
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
154
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
155
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
156
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
157
|
+
end
|
|
158
|
+
h[k.to_sym] = v
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'code')
|
|
162
|
+
self.code = attributes[:'code']
|
|
163
|
+
else
|
|
164
|
+
self.code = nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'name')
|
|
168
|
+
self.name = attributes[:'name']
|
|
169
|
+
else
|
|
170
|
+
self.name = nil
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'scope_code')
|
|
174
|
+
self.scope_code = attributes[:'scope_code']
|
|
175
|
+
else
|
|
176
|
+
self.scope_code = nil
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'unit')
|
|
180
|
+
self.unit = attributes[:'unit']
|
|
181
|
+
else
|
|
182
|
+
self.unit = nil
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'second_unit')
|
|
186
|
+
self.second_unit = attributes[:'second_unit']
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'category_code')
|
|
190
|
+
self.category_code = attributes[:'category_code']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'detail_code')
|
|
194
|
+
self.detail_code = attributes[:'detail_code']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'goods_category')
|
|
198
|
+
self.goods_category = attributes[:'goods_category']
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if attributes.key?(:'description')
|
|
202
|
+
self.description = attributes[:'description']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'batch')
|
|
206
|
+
self.batch = attributes[:'batch']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'color')
|
|
210
|
+
self.color = attributes[:'color']
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if attributes.key?(:'remark')
|
|
214
|
+
self.remark = attributes[:'remark']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'certificate')
|
|
218
|
+
self.certificate = attributes[:'certificate']
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'origin_country')
|
|
222
|
+
self.origin_country = attributes[:'origin_country']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'components')
|
|
226
|
+
if (value = attributes[:'components']).is_a?(Array)
|
|
227
|
+
self.components = value
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if attributes.key?(:'bom_batch')
|
|
232
|
+
self.bom_batch = attributes[:'bom_batch']
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if attributes.key?(:'bom_lines')
|
|
236
|
+
if (value = attributes[:'bom_lines']).is_a?(Array)
|
|
237
|
+
self.bom_lines = value
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
243
|
+
# @return Array for valid properties with the reasons
|
|
244
|
+
def list_invalid_properties
|
|
245
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
246
|
+
invalid_properties = Array.new
|
|
247
|
+
if @code.nil?
|
|
248
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if @code.to_s.length > 128
|
|
252
|
+
invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 128.')
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
if @name.nil?
|
|
256
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
if @name.to_s.length > 255
|
|
260
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
if @scope_code.nil?
|
|
264
|
+
invalid_properties.push('invalid value for "scope_code", scope_code cannot be nil.')
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
if @scope_code.to_s.length > 255
|
|
268
|
+
invalid_properties.push('invalid value for "scope_code", the character length must be smaller than or equal to 255.')
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
if @unit.nil?
|
|
272
|
+
invalid_properties.push('invalid value for "unit", unit cannot be nil.')
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
if @unit.to_s.length > 255
|
|
276
|
+
invalid_properties.push('invalid value for "unit", the character length must be smaller than or equal to 255.')
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
if !@second_unit.nil? && @second_unit.to_s.length > 255
|
|
280
|
+
invalid_properties.push('invalid value for "second_unit", the character length must be smaller than or equal to 255.')
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
if !@category_code.nil? && @category_code.to_s.length > 36
|
|
284
|
+
invalid_properties.push('invalid value for "category_code", the character length must be smaller than or equal to 36.')
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
if !@detail_code.nil? && @detail_code.to_s.length > 36
|
|
288
|
+
invalid_properties.push('invalid value for "detail_code", the character length must be smaller than or equal to 36.')
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
if !@goods_category.nil? && @goods_category.to_s.length > 100
|
|
292
|
+
invalid_properties.push('invalid value for "goods_category", the character length must be smaller than or equal to 100.')
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
if !@description.nil? && @description.to_s.length > 255
|
|
296
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
if !@batch.nil? && @batch.to_s.length > 255
|
|
300
|
+
invalid_properties.push('invalid value for "batch", the character length must be smaller than or equal to 255.')
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
if !@color.nil? && @color.to_s.length > 256
|
|
304
|
+
invalid_properties.push('invalid value for "color", the character length must be smaller than or equal to 256.')
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
if !@remark.nil? && @remark.to_s.length > 500
|
|
308
|
+
invalid_properties.push('invalid value for "remark", the character length must be smaller than or equal to 500.')
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
if !@certificate.nil? && @certificate.to_s.length > 125
|
|
312
|
+
invalid_properties.push('invalid value for "certificate", the character length must be smaller than or equal to 125.')
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
if !@origin_country.nil? && @origin_country.to_s.length > 255
|
|
316
|
+
invalid_properties.push('invalid value for "origin_country", the character length must be smaller than or equal to 255.')
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
if !@bom_batch.nil? && @bom_batch.to_s.length > 125
|
|
320
|
+
invalid_properties.push('invalid value for "bom_batch", the character length must be smaller than or equal to 125.')
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
invalid_properties
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Check to see if the all the properties in the model are valid
|
|
327
|
+
# @return true if the model is valid
|
|
328
|
+
def valid?
|
|
329
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
330
|
+
return false if @code.nil?
|
|
331
|
+
return false if @code.to_s.length > 128
|
|
332
|
+
return false if @name.nil?
|
|
333
|
+
return false if @name.to_s.length > 255
|
|
334
|
+
return false if @scope_code.nil?
|
|
335
|
+
return false if @scope_code.to_s.length > 255
|
|
336
|
+
return false if @unit.nil?
|
|
337
|
+
return false if @unit.to_s.length > 255
|
|
338
|
+
return false if !@second_unit.nil? && @second_unit.to_s.length > 255
|
|
339
|
+
return false if !@category_code.nil? && @category_code.to_s.length > 36
|
|
340
|
+
return false if !@detail_code.nil? && @detail_code.to_s.length > 36
|
|
341
|
+
return false if !@goods_category.nil? && @goods_category.to_s.length > 100
|
|
342
|
+
return false if !@description.nil? && @description.to_s.length > 255
|
|
343
|
+
return false if !@batch.nil? && @batch.to_s.length > 255
|
|
344
|
+
return false if !@color.nil? && @color.to_s.length > 256
|
|
345
|
+
return false if !@remark.nil? && @remark.to_s.length > 500
|
|
346
|
+
return false if !@certificate.nil? && @certificate.to_s.length > 125
|
|
347
|
+
return false if !@origin_country.nil? && @origin_country.to_s.length > 255
|
|
348
|
+
return false if !@bom_batch.nil? && @bom_batch.to_s.length > 125
|
|
349
|
+
true
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Custom attribute writer method with validation
|
|
353
|
+
# @param [Object] code Value to be assigned
|
|
354
|
+
def code=(code)
|
|
355
|
+
if code.nil?
|
|
356
|
+
fail ArgumentError, 'code cannot be nil'
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
if code.to_s.length > 128
|
|
360
|
+
fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 128.'
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
@code = code
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Custom attribute writer method with validation
|
|
367
|
+
# @param [Object] name Value to be assigned
|
|
368
|
+
def name=(name)
|
|
369
|
+
if name.nil?
|
|
370
|
+
fail ArgumentError, 'name cannot be nil'
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
if name.to_s.length > 255
|
|
374
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
@name = name
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
# Custom attribute writer method with validation
|
|
381
|
+
# @param [Object] scope_code Value to be assigned
|
|
382
|
+
def scope_code=(scope_code)
|
|
383
|
+
if scope_code.nil?
|
|
384
|
+
fail ArgumentError, 'scope_code cannot be nil'
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
if scope_code.to_s.length > 255
|
|
388
|
+
fail ArgumentError, 'invalid value for "scope_code", the character length must be smaller than or equal to 255.'
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
@scope_code = scope_code
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Custom attribute writer method with validation
|
|
395
|
+
# @param [Object] unit Value to be assigned
|
|
396
|
+
def unit=(unit)
|
|
397
|
+
if unit.nil?
|
|
398
|
+
fail ArgumentError, 'unit cannot be nil'
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
if unit.to_s.length > 255
|
|
402
|
+
fail ArgumentError, 'invalid value for "unit", the character length must be smaller than or equal to 255.'
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
@unit = unit
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Custom attribute writer method with validation
|
|
409
|
+
# @param [Object] second_unit Value to be assigned
|
|
410
|
+
def second_unit=(second_unit)
|
|
411
|
+
if !second_unit.nil? && second_unit.to_s.length > 255
|
|
412
|
+
fail ArgumentError, 'invalid value for "second_unit", the character length must be smaller than or equal to 255.'
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
@second_unit = second_unit
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
# Custom attribute writer method with validation
|
|
419
|
+
# @param [Object] category_code Value to be assigned
|
|
420
|
+
def category_code=(category_code)
|
|
421
|
+
if !category_code.nil? && category_code.to_s.length > 36
|
|
422
|
+
fail ArgumentError, 'invalid value for "category_code", the character length must be smaller than or equal to 36.'
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
@category_code = category_code
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
# Custom attribute writer method with validation
|
|
429
|
+
# @param [Object] detail_code Value to be assigned
|
|
430
|
+
def detail_code=(detail_code)
|
|
431
|
+
if !detail_code.nil? && detail_code.to_s.length > 36
|
|
432
|
+
fail ArgumentError, 'invalid value for "detail_code", the character length must be smaller than or equal to 36.'
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
@detail_code = detail_code
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# Custom attribute writer method with validation
|
|
439
|
+
# @param [Object] goods_category Value to be assigned
|
|
440
|
+
def goods_category=(goods_category)
|
|
441
|
+
if !goods_category.nil? && goods_category.to_s.length > 100
|
|
442
|
+
fail ArgumentError, 'invalid value for "goods_category", the character length must be smaller than or equal to 100.'
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
@goods_category = goods_category
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Custom attribute writer method with validation
|
|
449
|
+
# @param [Object] description Value to be assigned
|
|
450
|
+
def description=(description)
|
|
451
|
+
if !description.nil? && description.to_s.length > 255
|
|
452
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
@description = description
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
# Custom attribute writer method with validation
|
|
459
|
+
# @param [Object] batch Value to be assigned
|
|
460
|
+
def batch=(batch)
|
|
461
|
+
if !batch.nil? && batch.to_s.length > 255
|
|
462
|
+
fail ArgumentError, 'invalid value for "batch", the character length must be smaller than or equal to 255.'
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
@batch = batch
|
|
466
|
+
end
|
|
467
|
+
|
|
468
|
+
# Custom attribute writer method with validation
|
|
469
|
+
# @param [Object] color Value to be assigned
|
|
470
|
+
def color=(color)
|
|
471
|
+
if !color.nil? && color.to_s.length > 256
|
|
472
|
+
fail ArgumentError, 'invalid value for "color", the character length must be smaller than or equal to 256.'
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
@color = color
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
# Custom attribute writer method with validation
|
|
479
|
+
# @param [Object] remark Value to be assigned
|
|
480
|
+
def remark=(remark)
|
|
481
|
+
if !remark.nil? && remark.to_s.length > 500
|
|
482
|
+
fail ArgumentError, 'invalid value for "remark", the character length must be smaller than or equal to 500.'
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
@remark = remark
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
# Custom attribute writer method with validation
|
|
489
|
+
# @param [Object] certificate Value to be assigned
|
|
490
|
+
def certificate=(certificate)
|
|
491
|
+
if !certificate.nil? && certificate.to_s.length > 125
|
|
492
|
+
fail ArgumentError, 'invalid value for "certificate", the character length must be smaller than or equal to 125.'
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
@certificate = certificate
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
# Custom attribute writer method with validation
|
|
499
|
+
# @param [Object] origin_country Value to be assigned
|
|
500
|
+
def origin_country=(origin_country)
|
|
501
|
+
if !origin_country.nil? && origin_country.to_s.length > 255
|
|
502
|
+
fail ArgumentError, 'invalid value for "origin_country", the character length must be smaller than or equal to 255.'
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
@origin_country = origin_country
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
# Custom attribute writer method with validation
|
|
509
|
+
# @param [Object] bom_batch Value to be assigned
|
|
510
|
+
def bom_batch=(bom_batch)
|
|
511
|
+
if !bom_batch.nil? && bom_batch.to_s.length > 125
|
|
512
|
+
fail ArgumentError, 'invalid value for "bom_batch", the character length must be smaller than or equal to 125.'
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
@bom_batch = bom_batch
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
# Checks equality by comparing each attribute.
|
|
519
|
+
# @param [Object] Object to be compared
|
|
520
|
+
def ==(o)
|
|
521
|
+
return true if self.equal?(o)
|
|
522
|
+
self.class == o.class &&
|
|
523
|
+
code == o.code &&
|
|
524
|
+
name == o.name &&
|
|
525
|
+
scope_code == o.scope_code &&
|
|
526
|
+
unit == o.unit &&
|
|
527
|
+
second_unit == o.second_unit &&
|
|
528
|
+
category_code == o.category_code &&
|
|
529
|
+
detail_code == o.detail_code &&
|
|
530
|
+
goods_category == o.goods_category &&
|
|
531
|
+
description == o.description &&
|
|
532
|
+
batch == o.batch &&
|
|
533
|
+
color == o.color &&
|
|
534
|
+
remark == o.remark &&
|
|
535
|
+
certificate == o.certificate &&
|
|
536
|
+
origin_country == o.origin_country &&
|
|
537
|
+
components == o.components &&
|
|
538
|
+
bom_batch == o.bom_batch &&
|
|
539
|
+
bom_lines == o.bom_lines
|
|
540
|
+
end
|
|
541
|
+
|
|
542
|
+
# @see the `==` method
|
|
543
|
+
# @param [Object] Object to be compared
|
|
544
|
+
def eql?(o)
|
|
545
|
+
self == o
|
|
546
|
+
end
|
|
547
|
+
|
|
548
|
+
# Calculates hash code according to all attributes.
|
|
549
|
+
# @return [Integer] Hash code
|
|
550
|
+
def hash
|
|
551
|
+
[code, name, scope_code, unit, second_unit, category_code, detail_code, goods_category, description, batch, color, remark, certificate, origin_country, components, bom_batch, bom_lines].hash
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
# Builds the object from hash
|
|
555
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
556
|
+
# @return [Object] Returns the model itself
|
|
557
|
+
def self.build_from_hash(attributes)
|
|
558
|
+
return nil unless attributes.is_a?(Hash)
|
|
559
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
560
|
+
transformed_hash = {}
|
|
561
|
+
openapi_types.each_pair do |key, type|
|
|
562
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
563
|
+
transformed_hash["#{key}"] = nil
|
|
564
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
565
|
+
# check to ensure the input is an array given that the attribute
|
|
566
|
+
# is documented as an array but the input is not
|
|
567
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
568
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
569
|
+
end
|
|
570
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
571
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
572
|
+
end
|
|
573
|
+
end
|
|
574
|
+
new(transformed_hash)
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
# Returns the object in the form of hash
|
|
578
|
+
# @return [Hash] Returns the object in the form of hash
|
|
579
|
+
def to_hash
|
|
580
|
+
hash = {}
|
|
581
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
582
|
+
value = self.send(attr)
|
|
583
|
+
if value.nil?
|
|
584
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
585
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
586
|
+
end
|
|
587
|
+
|
|
588
|
+
hash[param] = _to_hash(value)
|
|
589
|
+
end
|
|
590
|
+
hash
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
end
|