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,186 @@
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
+ # 集成统一响应;业务错误也可能使用 HTTP 200,请检查 Code。
18
+ class ApiResult1ApiProcessRouteResponse < ApiModelBase
19
+ # 业务状态码。
20
+ attr_accessor :code
21
+
22
+ attr_accessor :data
23
+
24
+ # 按请求语言返回的提示,未指定语言时默认中文。
25
+ attr_accessor :message
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'code' => :'code',
31
+ :'data' => :'data',
32
+ :'message' => :'message'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'code' => :'Integer',
50
+ :'data' => :'ApiProcessRouteResponse',
51
+ :'message' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'message'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiResult1ApiProcessRouteResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiResult1ApiProcessRouteResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'code')
79
+ self.code = attributes[:'code']
80
+ else
81
+ self.code = nil
82
+ end
83
+
84
+ if attributes.key?(:'data')
85
+ self.data = attributes[:'data']
86
+ end
87
+
88
+ if attributes.key?(:'message')
89
+ self.message = attributes[:'message']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @code.nil?
99
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
100
+ end
101
+
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ return false if @code.nil?
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] code Value to be assigned
115
+ def code=(code)
116
+ if code.nil?
117
+ fail ArgumentError, 'code cannot be nil'
118
+ end
119
+
120
+ @code = code
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ code == o.code &&
129
+ data == o.data &&
130
+ message == o.message
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [code, data, message].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
164
+ end
165
+ new(transformed_hash)
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ if value.nil?
175
+ is_nullable = self.class.openapi_nullable.include?(attr)
176
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
177
+ end
178
+
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ end
185
+
186
+ end
@@ -0,0 +1,186 @@
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
+ # 集成统一响应;业务错误也可能使用 HTTP 200,请检查 Code。
18
+ class ApiResult1ApiProductResponse < ApiModelBase
19
+ # 业务状态码。
20
+ attr_accessor :code
21
+
22
+ attr_accessor :data
23
+
24
+ # 按请求语言返回的提示,未指定语言时默认中文。
25
+ attr_accessor :message
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'code' => :'code',
31
+ :'data' => :'data',
32
+ :'message' => :'message'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'code' => :'Integer',
50
+ :'data' => :'ApiProductResponse',
51
+ :'message' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'message'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiResult1ApiProductResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiResult1ApiProductResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'code')
79
+ self.code = attributes[:'code']
80
+ else
81
+ self.code = nil
82
+ end
83
+
84
+ if attributes.key?(:'data')
85
+ self.data = attributes[:'data']
86
+ end
87
+
88
+ if attributes.key?(:'message')
89
+ self.message = attributes[:'message']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @code.nil?
99
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
100
+ end
101
+
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ return false if @code.nil?
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] code Value to be assigned
115
+ def code=(code)
116
+ if code.nil?
117
+ fail ArgumentError, 'code cannot be nil'
118
+ end
119
+
120
+ @code = code
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ code == o.code &&
129
+ data == o.data &&
130
+ message == o.message
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [code, data, message].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
164
+ end
165
+ new(transformed_hash)
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ if value.nil?
175
+ is_nullable = self.class.openapi_nullable.include?(attr)
176
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
177
+ end
178
+
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ end
185
+
186
+ end
@@ -0,0 +1,186 @@
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
+ # 集成统一响应;业务错误也可能使用 HTTP 200,请检查 Code。
18
+ class ApiResult1ApiProductionResponse < ApiModelBase
19
+ # 业务状态码。
20
+ attr_accessor :code
21
+
22
+ attr_accessor :data
23
+
24
+ # 按请求语言返回的提示,未指定语言时默认中文。
25
+ attr_accessor :message
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'code' => :'code',
31
+ :'data' => :'data',
32
+ :'message' => :'message'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'code' => :'Integer',
50
+ :'data' => :'ApiProductionResponse',
51
+ :'message' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'message'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiResult1ApiProductionResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiResult1ApiProductionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'code')
79
+ self.code = attributes[:'code']
80
+ else
81
+ self.code = nil
82
+ end
83
+
84
+ if attributes.key?(:'data')
85
+ self.data = attributes[:'data']
86
+ end
87
+
88
+ if attributes.key?(:'message')
89
+ self.message = attributes[:'message']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @code.nil?
99
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
100
+ end
101
+
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ return false if @code.nil?
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] code Value to be assigned
115
+ def code=(code)
116
+ if code.nil?
117
+ fail ArgumentError, 'code cannot be nil'
118
+ end
119
+
120
+ @code = code
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ code == o.code &&
129
+ data == o.data &&
130
+ message == o.message
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [code, data, message].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
164
+ end
165
+ new(transformed_hash)
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ if value.nil?
175
+ is_nullable = self.class.openapi_nullable.include?(attr)
176
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
177
+ end
178
+
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ end
185
+
186
+ end
@@ -14,19 +14,23 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TachainSdk
17
- class ApiResponseOrderApiDto < ApiModelBase
17
+ # 集成统一响应;业务错误也可能使用 HTTP 200,请检查 Code。
18
+ class ApiResult1String < ApiModelBase
19
+ # 业务状态码。
18
20
  attr_accessor :code
19
21
 
20
- attr_accessor :message
21
-
22
+ # 业务返回数据。
22
23
  attr_accessor :data
23
24
 
25
+ # 按请求语言返回的提示,未指定语言时默认中文。
26
+ attr_accessor :message
27
+
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
25
29
  def self.attribute_map
26
30
  {
27
31
  :'code' => :'code',
28
- :'message' => :'message',
29
- :'data' => :'data'
32
+ :'data' => :'data',
33
+ :'message' => :'message'
30
34
  }
31
35
  end
32
36
 
@@ -44,14 +48,16 @@ module TachainSdk
44
48
  def self.openapi_types
45
49
  {
46
50
  :'code' => :'Integer',
47
- :'message' => :'String',
48
- :'data' => :'OrderApiDto'
51
+ :'data' => :'String',
52
+ :'message' => :'String'
49
53
  }
50
54
  end
51
55
 
52
56
  # List of attributes with nullable: true
53
57
  def self.openapi_nullable
54
58
  Set.new([
59
+ :'data',
60
+ :'message'
55
61
  ])
56
62
  end
57
63
 
@@ -59,14 +65,14 @@ module TachainSdk
59
65
  # @param [Hash] attributes Model attributes in the form of hash
60
66
  def initialize(attributes = {})
61
67
  if (!attributes.is_a?(Hash))
62
- fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiResponseOrderApiDto` initialize method"
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiResult1String` initialize method"
63
69
  end
64
70
 
65
71
  # check to see if the attribute exists and convert string to symbol for hash key
66
72
  acceptable_attribute_map = self.class.acceptable_attribute_map
67
73
  attributes = attributes.each_with_object({}) { |(k, v), h|
68
74
  if (!acceptable_attribute_map.key?(k.to_sym))
69
- fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiResponseOrderApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiResult1String`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
76
  end
71
77
  h[k.to_sym] = v
72
78
  }
@@ -77,15 +83,13 @@ module TachainSdk
77
83
  self.code = nil
78
84
  end
79
85
 
80
- if attributes.key?(:'message')
81
- self.message = attributes[:'message']
82
- else
83
- self.message = nil
84
- end
85
-
86
86
  if attributes.key?(:'data')
87
87
  self.data = attributes[:'data']
88
88
  end
89
+
90
+ if attributes.key?(:'message')
91
+ self.message = attributes[:'message']
92
+ end
89
93
  end
90
94
 
91
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -97,10 +101,6 @@ module TachainSdk
97
101
  invalid_properties.push('invalid value for "code", code cannot be nil.')
98
102
  end
99
103
 
100
- if @message.nil?
101
- invalid_properties.push('invalid value for "message", message cannot be nil.')
102
- end
103
-
104
104
  invalid_properties
105
105
  end
106
106
 
@@ -109,7 +109,6 @@ module TachainSdk
109
109
  def valid?
110
110
  warn '[DEPRECATED] the `valid?` method is obsolete'
111
111
  return false if @code.nil?
112
- return false if @message.nil?
113
112
  true
114
113
  end
115
114
 
@@ -123,24 +122,14 @@ module TachainSdk
123
122
  @code = code
124
123
  end
125
124
 
126
- # Custom attribute writer method with validation
127
- # @param [Object] message Value to be assigned
128
- def message=(message)
129
- if message.nil?
130
- fail ArgumentError, 'message cannot be nil'
131
- end
132
-
133
- @message = message
134
- end
135
-
136
125
  # Checks equality by comparing each attribute.
137
126
  # @param [Object] Object to be compared
138
127
  def ==(o)
139
128
  return true if self.equal?(o)
140
129
  self.class == o.class &&
141
130
  code == o.code &&
142
- message == o.message &&
143
- data == o.data
131
+ data == o.data &&
132
+ message == o.message
144
133
  end
145
134
 
146
135
  # @see the `==` method
@@ -152,7 +141,7 @@ module TachainSdk
152
141
  # Calculates hash code according to all attributes.
153
142
  # @return [Integer] Hash code
154
143
  def hash
155
- [code, message, data].hash
144
+ [code, data, message].hash
156
145
  end
157
146
 
158
147
  # Builds the object from hash