tachain-sdk 0.1.0

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 (82) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +226 -0
  5. data/Rakefile +10 -0
  6. data/git_push.sh +54 -0
  7. data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
  8. data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
  9. data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
  10. data/lib/tachain-sdk/api/api_order_api.rb +846 -0
  11. data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +466 -0
  13. data/lib/tachain-sdk/api_client.rb +397 -0
  14. data/lib/tachain-sdk/api_error.rb +58 -0
  15. data/lib/tachain-sdk/api_model_base.rb +88 -0
  16. data/lib/tachain-sdk/configuration.rb +329 -0
  17. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
  18. data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
  19. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
  20. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
  21. data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
  22. data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
  23. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
  24. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
  25. data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
  26. data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
  27. data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
  28. data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
  29. data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
  30. data/lib/tachain-sdk/models/api_response_string.rb +200 -0
  31. data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
  32. data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
  33. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
  34. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
  35. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
  36. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
  37. data/lib/tachain-sdk/models/company.rb +780 -0
  38. data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
  39. data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
  40. data/lib/tachain-sdk/models/customer.rb +569 -0
  41. data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
  42. data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
  43. data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
  44. data/lib/tachain-sdk/models/factory.rb +545 -0
  45. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
  46. data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
  47. data/lib/tachain-sdk/models/model1.rb +157 -0
  48. data/lib/tachain-sdk/models/model3.rb +202 -0
  49. data/lib/tachain-sdk/models/model4.rb +202 -0
  50. data/lib/tachain-sdk/models/order.rb +974 -0
  51. data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
  52. data/lib/tachain-sdk/models/order_line.rb +1184 -0
  53. data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
  54. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
  55. data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
  56. data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
  57. data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
  58. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
  59. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
  60. data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
  61. data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
  62. data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
  63. data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
  64. data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
  65. data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
  66. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
  67. data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
  68. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
  69. data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
  70. data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
  71. data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
  72. data/lib/tachain-sdk/models/supplier.rb +585 -0
  73. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
  74. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
  75. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
  76. data/lib/tachain-sdk/models/trader.rb +506 -0
  77. data/lib/tachain-sdk/signed_api_client.rb +65 -0
  78. data/lib/tachain-sdk/version.rb +15 -0
  79. data/lib/tachain-sdk.rb +108 -0
  80. data/spec/spec_helper.rb +111 -0
  81. data/tachain-sdk.gemspec +39 -0
  82. metadata +165 -0
@@ -0,0 +1,209 @@
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 ApiDeclarationDocumentRequest < ApiModelBase
19
+ # 资料类型 ID,对应系统中的文档类型。
20
+ attr_accessor :document_type_id
21
+
22
+ # 资料类型编码。外部不知道 DocumentTypeId 时可传该字段,由接口解析成资料类型 ID。
23
+ attr_accessor :document_type_code
24
+
25
+ # 单据日期,例如运输单日期、入库单日期。
26
+ attr_accessor :document_date
27
+
28
+ # 单据编号,例如运输单号、入库单号。
29
+ attr_accessor :document_number
30
+
31
+ # 文件资料列表。只提交表单资料时可以为空。
32
+ attr_accessor :file_list
33
+
34
+ # 表单资料列表。只提交文件资料时可以为空。
35
+ attr_accessor :form_data_list
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'document_type_id' => :'documentTypeId',
41
+ :'document_type_code' => :'documentTypeCode',
42
+ :'document_date' => :'documentDate',
43
+ :'document_number' => :'documentNumber',
44
+ :'file_list' => :'fileList',
45
+ :'form_data_list' => :'formDataList'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'document_type_id' => :'String',
63
+ :'document_type_code' => :'String',
64
+ :'document_date' => :'Time',
65
+ :'document_number' => :'String',
66
+ :'file_list' => :'Array<AttachmentInApiCreateDto>',
67
+ :'form_data_list' => :'Array<OrderStageFormDto>'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'document_type_id',
75
+ :'document_type_code',
76
+ :'document_date',
77
+ :'document_number',
78
+ :'file_list',
79
+ :'form_data_list'
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiDeclarationDocumentRequest` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiDeclarationDocumentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'document_type_id')
100
+ self.document_type_id = attributes[:'document_type_id']
101
+ end
102
+
103
+ if attributes.key?(:'document_type_code')
104
+ self.document_type_code = attributes[:'document_type_code']
105
+ end
106
+
107
+ if attributes.key?(:'document_date')
108
+ self.document_date = attributes[:'document_date']
109
+ end
110
+
111
+ if attributes.key?(:'document_number')
112
+ self.document_number = attributes[:'document_number']
113
+ end
114
+
115
+ if attributes.key?(:'file_list')
116
+ if (value = attributes[:'file_list']).is_a?(Array)
117
+ self.file_list = value
118
+ end
119
+ end
120
+
121
+ if attributes.key?(:'form_data_list')
122
+ if (value = attributes[:'form_data_list']).is_a?(Array)
123
+ self.form_data_list = value
124
+ end
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ document_type_id == o.document_type_id &&
149
+ document_type_code == o.document_type_code &&
150
+ document_date == o.document_date &&
151
+ document_number == o.document_number &&
152
+ file_list == o.file_list &&
153
+ form_data_list == o.form_data_list
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [document_type_id, document_type_code, document_date, document_number, file_list, form_data_list].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
183
+ end
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
187
+ end
188
+ new(transformed_hash)
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ end
208
+
209
+ end
@@ -0,0 +1,251 @@
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 ApiDeclarationListDto < ApiModelBase
19
+ # 附件申报记录总数。
20
+ attr_accessor :attachment_total_count
21
+
22
+ # 表单申报记录总数。
23
+ attr_accessor :form_total_count
24
+
25
+ # 当前页附件申报记录。
26
+ attr_accessor :attachments
27
+
28
+ # 当前页表单申报记录。
29
+ attr_accessor :forms
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'attachment_total_count' => :'attachmentTotalCount',
35
+ :'form_total_count' => :'formTotalCount',
36
+ :'attachments' => :'attachments',
37
+ :'forms' => :'forms'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'attachment_total_count' => :'Integer',
55
+ :'form_total_count' => :'Integer',
56
+ :'attachments' => :'Array<StageAttachmentApiDto>',
57
+ :'forms' => :'Array<OrderStageFormDatumApiDto>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiDeclarationListDto` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiDeclarationListDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'attachment_total_count')
84
+ self.attachment_total_count = attributes[:'attachment_total_count']
85
+ else
86
+ self.attachment_total_count = nil
87
+ end
88
+
89
+ if attributes.key?(:'form_total_count')
90
+ self.form_total_count = attributes[:'form_total_count']
91
+ else
92
+ self.form_total_count = nil
93
+ end
94
+
95
+ if attributes.key?(:'attachments')
96
+ if (value = attributes[:'attachments']).is_a?(Array)
97
+ self.attachments = value
98
+ end
99
+ else
100
+ self.attachments = nil
101
+ end
102
+
103
+ if attributes.key?(:'forms')
104
+ if (value = attributes[:'forms']).is_a?(Array)
105
+ self.forms = value
106
+ end
107
+ else
108
+ self.forms = nil
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @attachment_total_count.nil?
118
+ invalid_properties.push('invalid value for "attachment_total_count", attachment_total_count cannot be nil.')
119
+ end
120
+
121
+ if @form_total_count.nil?
122
+ invalid_properties.push('invalid value for "form_total_count", form_total_count cannot be nil.')
123
+ end
124
+
125
+ if @attachments.nil?
126
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
127
+ end
128
+
129
+ if @forms.nil?
130
+ invalid_properties.push('invalid value for "forms", forms cannot be nil.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
+ return false if @attachment_total_count.nil?
141
+ return false if @form_total_count.nil?
142
+ return false if @attachments.nil?
143
+ return false if @forms.nil?
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] attachment_total_count Value to be assigned
149
+ def attachment_total_count=(attachment_total_count)
150
+ if attachment_total_count.nil?
151
+ fail ArgumentError, 'attachment_total_count cannot be nil'
152
+ end
153
+
154
+ @attachment_total_count = attachment_total_count
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] form_total_count Value to be assigned
159
+ def form_total_count=(form_total_count)
160
+ if form_total_count.nil?
161
+ fail ArgumentError, 'form_total_count cannot be nil'
162
+ end
163
+
164
+ @form_total_count = form_total_count
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] attachments Value to be assigned
169
+ def attachments=(attachments)
170
+ if attachments.nil?
171
+ fail ArgumentError, 'attachments cannot be nil'
172
+ end
173
+
174
+ @attachments = attachments
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] forms Value to be assigned
179
+ def forms=(forms)
180
+ if forms.nil?
181
+ fail ArgumentError, 'forms cannot be nil'
182
+ end
183
+
184
+ @forms = forms
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ attachment_total_count == o.attachment_total_count &&
193
+ form_total_count == o.form_total_count &&
194
+ attachments == o.attachments &&
195
+ forms == o.forms
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Integer] Hash code
206
+ def hash
207
+ [attachment_total_count, form_total_count, attachments, forms].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def self.build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ transformed_hash = {}
217
+ openapi_types.each_pair do |key, type|
218
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = nil
220
+ elsif type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[attribute_map[key]].is_a?(Array)
224
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
225
+ end
226
+ elsif !attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
228
+ end
229
+ end
230
+ new(transformed_hash)
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -0,0 +1,251 @@
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 ApiDeclarationSubmitRequest < ApiModelBase
19
+ # 业务扩展 ID,例如订单、生产单、发货单等业务单据 ID。
20
+ attr_accessor :extend_id
21
+
22
+ # 业务单号。订单阶段表示订单号,生产/入库阶段表示生产单号,发货阶段可表示发货单号。
23
+ attr_accessor :extend_number
24
+
25
+ # 业务单日期。订单阶段用于和 ExtendNumber 一起定位订单。
26
+ attr_accessor :extend_date
27
+
28
+ # 订单行号。订单阶段需要按行定位时与 ExtendNumber、ExtendDate 一起使用。
29
+ attr_accessor :extend_line_number
30
+
31
+ # 订单侧别,常用 PO 或 SO;订单号重复时用于区分采购订单和销售订单。
32
+ attr_accessor :order_side
33
+
34
+ # 产品编码。生产/入库阶段按生产单号定位时需要配合生产类型使用。
35
+ attr_accessor :product_code
36
+
37
+ # 生产类型。生产阶段默认 0,入库阶段默认 1;显式传入时参与生产单唯一定位。
38
+ attr_accessor :production_type
39
+
40
+ # 发货单号。发货阶段优先用该字段定位发货单。
41
+ attr_accessor :delivery_number
42
+
43
+ # 申报阶段 ID。
44
+ attr_accessor :stage_id
45
+
46
+ # 申报资料明细集合,每条明细对应一种资料类型。
47
+ attr_accessor :document_list
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'extend_id' => :'extendId',
53
+ :'extend_number' => :'extendNumber',
54
+ :'extend_date' => :'extendDate',
55
+ :'extend_line_number' => :'extendLineNumber',
56
+ :'order_side' => :'orderSide',
57
+ :'product_code' => :'productCode',
58
+ :'production_type' => :'productionType',
59
+ :'delivery_number' => :'deliveryNumber',
60
+ :'stage_id' => :'stageId',
61
+ :'document_list' => :'documentList'
62
+ }
63
+ end
64
+
65
+ # Returns attribute mapping this model knows about
66
+ def self.acceptable_attribute_map
67
+ attribute_map
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ acceptable_attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'extend_id' => :'String',
79
+ :'extend_number' => :'String',
80
+ :'extend_date' => :'Time',
81
+ :'extend_line_number' => :'String',
82
+ :'order_side' => :'String',
83
+ :'product_code' => :'String',
84
+ :'production_type' => :'Integer',
85
+ :'delivery_number' => :'String',
86
+ :'stage_id' => :'String',
87
+ :'document_list' => :'Array<ApiDeclarationDocumentRequest>'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ :'extend_id',
95
+ :'extend_number',
96
+ :'extend_date',
97
+ :'extend_line_number',
98
+ :'order_side',
99
+ :'product_code',
100
+ :'production_type',
101
+ :'delivery_number',
102
+ :'stage_id',
103
+ :'document_list'
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiDeclarationSubmitRequest` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ acceptable_attribute_map = self.class.acceptable_attribute_map
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!acceptable_attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiDeclarationSubmitRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+ if attributes.key?(:'extend_id')
124
+ self.extend_id = attributes[:'extend_id']
125
+ end
126
+
127
+ if attributes.key?(:'extend_number')
128
+ self.extend_number = attributes[:'extend_number']
129
+ end
130
+
131
+ if attributes.key?(:'extend_date')
132
+ self.extend_date = attributes[:'extend_date']
133
+ end
134
+
135
+ if attributes.key?(:'extend_line_number')
136
+ self.extend_line_number = attributes[:'extend_line_number']
137
+ end
138
+
139
+ if attributes.key?(:'order_side')
140
+ self.order_side = attributes[:'order_side']
141
+ end
142
+
143
+ if attributes.key?(:'product_code')
144
+ self.product_code = attributes[:'product_code']
145
+ end
146
+
147
+ if attributes.key?(:'production_type')
148
+ self.production_type = attributes[:'production_type']
149
+ end
150
+
151
+ if attributes.key?(:'delivery_number')
152
+ self.delivery_number = attributes[:'delivery_number']
153
+ end
154
+
155
+ if attributes.key?(:'stage_id')
156
+ self.stage_id = attributes[:'stage_id']
157
+ end
158
+
159
+ if attributes.key?(:'document_list')
160
+ if (value = attributes[:'document_list']).is_a?(Array)
161
+ self.document_list = value
162
+ end
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
170
+ invalid_properties = Array.new
171
+ invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ warn '[DEPRECATED] the `valid?` method is obsolete'
178
+ true
179
+ end
180
+
181
+ # Checks equality by comparing each attribute.
182
+ # @param [Object] Object to be compared
183
+ def ==(o)
184
+ return true if self.equal?(o)
185
+ self.class == o.class &&
186
+ extend_id == o.extend_id &&
187
+ extend_number == o.extend_number &&
188
+ extend_date == o.extend_date &&
189
+ extend_line_number == o.extend_line_number &&
190
+ order_side == o.order_side &&
191
+ product_code == o.product_code &&
192
+ production_type == o.production_type &&
193
+ delivery_number == o.delivery_number &&
194
+ stage_id == o.stage_id &&
195
+ document_list == o.document_list
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Integer] Hash code
206
+ def hash
207
+ [extend_id, extend_number, extend_date, extend_line_number, order_side, product_code, production_type, delivery_number, stage_id, document_list].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def self.build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ transformed_hash = {}
217
+ openapi_types.each_pair do |key, type|
218
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = nil
220
+ elsif type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[attribute_map[key]].is_a?(Array)
224
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
225
+ end
226
+ elsif !attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
228
+ end
229
+ end
230
+ new(transformed_hash)
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ end
250
+
251
+ end