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,408 @@
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 ApiOrderUpdateRequest < ApiModelBase
19
+ # 修改/删除时可使用查询返回的内部 ID;必须属于当前单据,保留原有 ID 调用方式。
20
+ attr_accessor :id
21
+
22
+ # 订单编号
23
+ attr_accessor :order_number
24
+
25
+ # 订购日期
26
+ attr_accessor :order_date
27
+
28
+ # 订单类型:0 正式, 1 测试,2 预下单
29
+ attr_accessor :order_type
30
+
31
+ # 合同编号
32
+ attr_accessor :contract_no
33
+
34
+ # 发票号
35
+ attr_accessor :invoice_no
36
+
37
+ # 交易币种
38
+ attr_accessor :currency_code
39
+
40
+ # 品牌;当前采购公司为 T0 品牌商时必填。 条件:当前采购公司为 T0 品牌商时必填;修改时省略保留原值。
41
+ attr_accessor :brand
42
+
43
+ # 备注
44
+ attr_accessor :remarks
45
+
46
+ # 部门名称,可选。
47
+ attr_accessor :division_name
48
+
49
+ # 品牌商名称,多个以 | 分隔;当前采购公司销售阶段为 T1 时必填,与物料阶段无关。 条件:当前采购公司销售阶段为 T1 时必填;修改时省略沿用原品牌商,但不可清空。
50
+ attr_accessor :brand_company_name
51
+
52
+ # 物料阶段,省略沿用原订单阶段;传入时必须有效且与所有有效明细的物料分类一致。 条件:省略保留原值;原订单缺少物料阶段时必须补充。
53
+ attr_accessor :scope_code
54
+
55
+ # OrderLines 业务明细。
56
+ attr_accessor :order_lines
57
+
58
+ # 查询返回的客户公司 ID,可选。优先使用 CustomerName 或 CustomerCode。
59
+ attr_accessor :customer_id
60
+
61
+ # 客户英文名、当地语言名称或简称,精确匹配当前公司的有效客户关系。
62
+ attr_accessor :customer_name
63
+
64
+ # 当前公司维护的客户编码或启用的 Customer/Company 外部映射值。 条件:外部流水号或单号重复时用于消歧;多个客户字段必须一致。
65
+ attr_accessor :customer_code
66
+
67
+ # 查询返回的供应商公司 ID,可选。优先使用 SupplierName 或 SupplierCode。
68
+ attr_accessor :supplier_id
69
+
70
+ # 供应商英文名、当地语言名称或简称,精确匹配当前公司的有效供应商关系。
71
+ attr_accessor :supplier_name
72
+
73
+ # 当前公司维护的供应商编码或启用的 Supplier/Company 外部映射值。 条件:外部流水号或单号重复时用于消歧;多个供应商字段必须一致。
74
+ attr_accessor :supplier_code
75
+
76
+ # 买方外部系统的订单明细流水号;重复时补充交易对方和订单条件。
77
+ attr_accessor :customer_ext_no
78
+
79
+ # 卖方外部系统的订单明细流水号;重复时补充交易对方和订单条件。
80
+ attr_accessor :supplier_ext_no
81
+
82
+ # 查询返回的系统订单明细唯一流水号。
83
+ attr_accessor :unique_no
84
+
85
+ # Attribute mapping from ruby-style variable name to JSON key.
86
+ def self.attribute_map
87
+ {
88
+ :'id' => :'id',
89
+ :'order_number' => :'orderNumber',
90
+ :'order_date' => :'orderDate',
91
+ :'order_type' => :'orderType',
92
+ :'contract_no' => :'contractNo',
93
+ :'invoice_no' => :'invoiceNo',
94
+ :'currency_code' => :'currencyCode',
95
+ :'brand' => :'brand',
96
+ :'remarks' => :'remarks',
97
+ :'division_name' => :'divisionName',
98
+ :'brand_company_name' => :'brandCompanyName',
99
+ :'scope_code' => :'scopeCode',
100
+ :'order_lines' => :'orderLines',
101
+ :'customer_id' => :'customerId',
102
+ :'customer_name' => :'customerName',
103
+ :'customer_code' => :'customerCode',
104
+ :'supplier_id' => :'supplierId',
105
+ :'supplier_name' => :'supplierName',
106
+ :'supplier_code' => :'supplierCode',
107
+ :'customer_ext_no' => :'customerExtNo',
108
+ :'supplier_ext_no' => :'supplierExtNo',
109
+ :'unique_no' => :'uniqueNo'
110
+ }
111
+ end
112
+
113
+ # Returns attribute mapping this model knows about
114
+ def self.acceptable_attribute_map
115
+ attribute_map
116
+ end
117
+
118
+ # Returns all the JSON keys this model knows about
119
+ def self.acceptable_attributes
120
+ acceptable_attribute_map.values
121
+ end
122
+
123
+ # Attribute type mapping.
124
+ def self.openapi_types
125
+ {
126
+ :'id' => :'String',
127
+ :'order_number' => :'String',
128
+ :'order_date' => :'Time',
129
+ :'order_type' => :'Integer',
130
+ :'contract_no' => :'String',
131
+ :'invoice_no' => :'String',
132
+ :'currency_code' => :'String',
133
+ :'brand' => :'String',
134
+ :'remarks' => :'String',
135
+ :'division_name' => :'String',
136
+ :'brand_company_name' => :'String',
137
+ :'scope_code' => :'String',
138
+ :'order_lines' => :'Array<ApiOrderLineUpdateRequest>',
139
+ :'customer_id' => :'String',
140
+ :'customer_name' => :'String',
141
+ :'customer_code' => :'String',
142
+ :'supplier_id' => :'String',
143
+ :'supplier_name' => :'String',
144
+ :'supplier_code' => :'String',
145
+ :'customer_ext_no' => :'String',
146
+ :'supplier_ext_no' => :'String',
147
+ :'unique_no' => :'String'
148
+ }
149
+ end
150
+
151
+ # List of attributes with nullable: true
152
+ def self.openapi_nullable
153
+ Set.new([
154
+ :'id',
155
+ :'order_number',
156
+ :'order_date',
157
+ :'order_type',
158
+ :'contract_no',
159
+ :'invoice_no',
160
+ :'currency_code',
161
+ :'brand',
162
+ :'remarks',
163
+ :'division_name',
164
+ :'brand_company_name',
165
+ :'scope_code',
166
+ :'customer_id',
167
+ :'customer_name',
168
+ :'customer_code',
169
+ :'supplier_id',
170
+ :'supplier_name',
171
+ :'supplier_code',
172
+ :'customer_ext_no',
173
+ :'supplier_ext_no',
174
+ :'unique_no'
175
+ ])
176
+ end
177
+
178
+ # Initializes the object
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ def initialize(attributes = {})
181
+ if (!attributes.is_a?(Hash))
182
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiOrderUpdateRequest` initialize method"
183
+ end
184
+
185
+ # check to see if the attribute exists and convert string to symbol for hash key
186
+ acceptable_attribute_map = self.class.acceptable_attribute_map
187
+ attributes = attributes.each_with_object({}) { |(k, v), h|
188
+ if (!acceptable_attribute_map.key?(k.to_sym))
189
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiOrderUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
190
+ end
191
+ h[k.to_sym] = v
192
+ }
193
+
194
+ if attributes.key?(:'id')
195
+ self.id = attributes[:'id']
196
+ end
197
+
198
+ if attributes.key?(:'order_number')
199
+ self.order_number = attributes[:'order_number']
200
+ end
201
+
202
+ if attributes.key?(:'order_date')
203
+ self.order_date = attributes[:'order_date']
204
+ end
205
+
206
+ if attributes.key?(:'order_type')
207
+ self.order_type = attributes[:'order_type']
208
+ end
209
+
210
+ if attributes.key?(:'contract_no')
211
+ self.contract_no = attributes[:'contract_no']
212
+ end
213
+
214
+ if attributes.key?(:'invoice_no')
215
+ self.invoice_no = attributes[:'invoice_no']
216
+ end
217
+
218
+ if attributes.key?(:'currency_code')
219
+ self.currency_code = attributes[:'currency_code']
220
+ end
221
+
222
+ if attributes.key?(:'brand')
223
+ self.brand = attributes[:'brand']
224
+ end
225
+
226
+ if attributes.key?(:'remarks')
227
+ self.remarks = attributes[:'remarks']
228
+ end
229
+
230
+ if attributes.key?(:'division_name')
231
+ self.division_name = attributes[:'division_name']
232
+ end
233
+
234
+ if attributes.key?(:'brand_company_name')
235
+ self.brand_company_name = attributes[:'brand_company_name']
236
+ end
237
+
238
+ if attributes.key?(:'scope_code')
239
+ self.scope_code = attributes[:'scope_code']
240
+ end
241
+
242
+ if attributes.key?(:'order_lines')
243
+ if (value = attributes[:'order_lines']).is_a?(Array)
244
+ self.order_lines = value
245
+ end
246
+ else
247
+ self.order_lines = nil
248
+ end
249
+
250
+ if attributes.key?(:'customer_id')
251
+ self.customer_id = attributes[:'customer_id']
252
+ end
253
+
254
+ if attributes.key?(:'customer_name')
255
+ self.customer_name = attributes[:'customer_name']
256
+ end
257
+
258
+ if attributes.key?(:'customer_code')
259
+ self.customer_code = attributes[:'customer_code']
260
+ end
261
+
262
+ if attributes.key?(:'supplier_id')
263
+ self.supplier_id = attributes[:'supplier_id']
264
+ end
265
+
266
+ if attributes.key?(:'supplier_name')
267
+ self.supplier_name = attributes[:'supplier_name']
268
+ end
269
+
270
+ if attributes.key?(:'supplier_code')
271
+ self.supplier_code = attributes[:'supplier_code']
272
+ end
273
+
274
+ if attributes.key?(:'customer_ext_no')
275
+ self.customer_ext_no = attributes[:'customer_ext_no']
276
+ end
277
+
278
+ if attributes.key?(:'supplier_ext_no')
279
+ self.supplier_ext_no = attributes[:'supplier_ext_no']
280
+ end
281
+
282
+ if attributes.key?(:'unique_no')
283
+ self.unique_no = attributes[:'unique_no']
284
+ end
285
+ end
286
+
287
+ # Show invalid properties with the reasons. Usually used together with valid?
288
+ # @return Array for valid properties with the reasons
289
+ def list_invalid_properties
290
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
291
+ invalid_properties = Array.new
292
+ if @order_lines.nil?
293
+ invalid_properties.push('invalid value for "order_lines", order_lines cannot be nil.')
294
+ end
295
+
296
+ if @order_lines.length < 1
297
+ invalid_properties.push('invalid value for "order_lines", number of items must be greater than or equal to 1.')
298
+ end
299
+
300
+ invalid_properties
301
+ end
302
+
303
+ # Check to see if the all the properties in the model are valid
304
+ # @return true if the model is valid
305
+ def valid?
306
+ warn '[DEPRECATED] the `valid?` method is obsolete'
307
+ return false if @order_lines.nil?
308
+ return false if @order_lines.length < 1
309
+ true
310
+ end
311
+
312
+ # Custom attribute writer method with validation
313
+ # @param [Object] order_lines Value to be assigned
314
+ def order_lines=(order_lines)
315
+ if order_lines.nil?
316
+ fail ArgumentError, 'order_lines cannot be nil'
317
+ end
318
+
319
+ if order_lines.length < 1
320
+ fail ArgumentError, 'invalid value for "order_lines", number of items must be greater than or equal to 1.'
321
+ end
322
+
323
+ @order_lines = order_lines
324
+ end
325
+
326
+ # Checks equality by comparing each attribute.
327
+ # @param [Object] Object to be compared
328
+ def ==(o)
329
+ return true if self.equal?(o)
330
+ self.class == o.class &&
331
+ id == o.id &&
332
+ order_number == o.order_number &&
333
+ order_date == o.order_date &&
334
+ order_type == o.order_type &&
335
+ contract_no == o.contract_no &&
336
+ invoice_no == o.invoice_no &&
337
+ currency_code == o.currency_code &&
338
+ brand == o.brand &&
339
+ remarks == o.remarks &&
340
+ division_name == o.division_name &&
341
+ brand_company_name == o.brand_company_name &&
342
+ scope_code == o.scope_code &&
343
+ order_lines == o.order_lines &&
344
+ customer_id == o.customer_id &&
345
+ customer_name == o.customer_name &&
346
+ customer_code == o.customer_code &&
347
+ supplier_id == o.supplier_id &&
348
+ supplier_name == o.supplier_name &&
349
+ supplier_code == o.supplier_code &&
350
+ customer_ext_no == o.customer_ext_no &&
351
+ supplier_ext_no == o.supplier_ext_no &&
352
+ unique_no == o.unique_no
353
+ end
354
+
355
+ # @see the `==` method
356
+ # @param [Object] Object to be compared
357
+ def eql?(o)
358
+ self == o
359
+ end
360
+
361
+ # Calculates hash code according to all attributes.
362
+ # @return [Integer] Hash code
363
+ def hash
364
+ [id, order_number, order_date, order_type, contract_no, invoice_no, currency_code, brand, remarks, division_name, brand_company_name, scope_code, order_lines, customer_id, customer_name, customer_code, supplier_id, supplier_name, supplier_code, customer_ext_no, supplier_ext_no, unique_no].hash
365
+ end
366
+
367
+ # Builds the object from hash
368
+ # @param [Hash] attributes Model attributes in the form of hash
369
+ # @return [Object] Returns the model itself
370
+ def self.build_from_hash(attributes)
371
+ return nil unless attributes.is_a?(Hash)
372
+ attributes = attributes.transform_keys(&:to_sym)
373
+ transformed_hash = {}
374
+ openapi_types.each_pair do |key, type|
375
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
376
+ transformed_hash["#{key}"] = nil
377
+ elsif type =~ /\AArray<(.*)>/i
378
+ # check to ensure the input is an array given that the attribute
379
+ # is documented as an array but the input is not
380
+ if attributes[attribute_map[key]].is_a?(Array)
381
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
382
+ end
383
+ elsif !attributes[attribute_map[key]].nil?
384
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
385
+ end
386
+ end
387
+ new(transformed_hash)
388
+ end
389
+
390
+ # Returns the object in the form of hash
391
+ # @return [Hash] Returns the object in the form of hash
392
+ def to_hash
393
+ hash = {}
394
+ self.class.attribute_map.each_pair do |attr, param|
395
+ value = self.send(attr)
396
+ if value.nil?
397
+ is_nullable = self.class.openapi_nullable.include?(attr)
398
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
399
+ end
400
+
401
+ hash[param] = _to_hash(value)
402
+ end
403
+ hash
404
+ end
405
+
406
+ end
407
+
408
+ end
@@ -0,0 +1,220 @@
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 ApiPageResult1ApiDeliveryResponse < ApiModelBase
19
+ # 业务状态码。
20
+ attr_accessor :code
21
+
22
+ # 业务返回数据。
23
+ attr_accessor :data
24
+
25
+ # 按请求语言返回的提示,未指定语言时默认中文。
26
+ attr_accessor :message
27
+
28
+ # 当前页码,从 1 开始。
29
+ attr_accessor :page_index
30
+
31
+ # 每页条数。
32
+ attr_accessor :page_size
33
+
34
+ # 符合查询条件的总条数。
35
+ attr_accessor :total_count
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'code' => :'code',
41
+ :'data' => :'data',
42
+ :'message' => :'message',
43
+ :'page_index' => :'pageIndex',
44
+ :'page_size' => :'pageSize',
45
+ :'total_count' => :'totalCount'
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
+ :'code' => :'Integer',
63
+ :'data' => :'Array<ApiDeliveryResponse>',
64
+ :'message' => :'String',
65
+ :'page_index' => :'Integer',
66
+ :'page_size' => :'Integer',
67
+ :'total_count' => :'Integer'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'data',
75
+ :'message',
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiPageResult1ApiDeliveryResponse` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiPageResult1ApiDeliveryResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'code')
96
+ self.code = attributes[:'code']
97
+ else
98
+ self.code = nil
99
+ end
100
+
101
+ if attributes.key?(:'data')
102
+ if (value = attributes[:'data']).is_a?(Array)
103
+ self.data = value
104
+ end
105
+ end
106
+
107
+ if attributes.key?(:'message')
108
+ self.message = attributes[:'message']
109
+ end
110
+
111
+ if attributes.key?(:'page_index')
112
+ self.page_index = attributes[:'page_index']
113
+ end
114
+
115
+ if attributes.key?(:'page_size')
116
+ self.page_size = attributes[:'page_size']
117
+ end
118
+
119
+ if attributes.key?(:'total_count')
120
+ self.total_count = attributes[:'total_count']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ if @code.nil?
130
+ invalid_properties.push('invalid value for "code", code 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 @code.nil?
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] code Value to be assigned
146
+ def code=(code)
147
+ if code.nil?
148
+ fail ArgumentError, 'code cannot be nil'
149
+ end
150
+
151
+ @code = code
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ code == o.code &&
160
+ data == o.data &&
161
+ message == o.message &&
162
+ page_index == o.page_index &&
163
+ page_size == o.page_size &&
164
+ total_count == o.total_count
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [code, data, message, page_index, page_size, total_count].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end