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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +226 -0
- data/Rakefile +10 -0
- data/git_push.sh +54 -0
- data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
- data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
- data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
- data/lib/tachain-sdk/api/api_order_api.rb +846 -0
- data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
- data/lib/tachain-sdk/api/api_production_api.rb +466 -0
- data/lib/tachain-sdk/api_client.rb +397 -0
- data/lib/tachain-sdk/api_error.rb +58 -0
- data/lib/tachain-sdk/api_model_base.rb +88 -0
- data/lib/tachain-sdk/configuration.rb +329 -0
- data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
- data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
- data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
- data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
- data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
- data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
- data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
- data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
- data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_string.rb +200 -0
- data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
- data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
- data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
- data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
- data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
- data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
- data/lib/tachain-sdk/models/company.rb +780 -0
- data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
- data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
- data/lib/tachain-sdk/models/customer.rb +569 -0
- data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
- data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
- data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
- data/lib/tachain-sdk/models/factory.rb +545 -0
- data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
- data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
- data/lib/tachain-sdk/models/model1.rb +157 -0
- data/lib/tachain-sdk/models/model3.rb +202 -0
- data/lib/tachain-sdk/models/model4.rb +202 -0
- data/lib/tachain-sdk/models/order.rb +974 -0
- data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
- data/lib/tachain-sdk/models/order_line.rb +1184 -0
- data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
- data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
- data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
- data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
- data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
- data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
- data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
- data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
- data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
- data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
- data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
- data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
- data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
- data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
- data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
- data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
- data/lib/tachain-sdk/models/supplier.rb +585 -0
- data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
- data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
- data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
- data/lib/tachain-sdk/models/trader.rb +506 -0
- data/lib/tachain-sdk/signed_api_client.rb +65 -0
- data/lib/tachain-sdk/version.rb +15 -0
- data/lib/tachain-sdk.rb +108 -0
- data/spec/spec_helper.rb +111 -0
- data/tachain-sdk.gemspec +39 -0
- metadata +165 -0
|
@@ -0,0 +1,363 @@
|
|
|
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
|
+
class AttachmentInApiDto < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# 文件存储路径
|
|
21
|
+
attr_accessor :file_path
|
|
22
|
+
|
|
23
|
+
# 原文件名称
|
|
24
|
+
attr_accessor :file_name
|
|
25
|
+
|
|
26
|
+
attr_accessor :status
|
|
27
|
+
|
|
28
|
+
attr_accessor :submitted_at
|
|
29
|
+
|
|
30
|
+
attr_accessor :file_size
|
|
31
|
+
|
|
32
|
+
attr_accessor :tenant_id
|
|
33
|
+
|
|
34
|
+
attr_accessor :file_type
|
|
35
|
+
|
|
36
|
+
attr_accessor :file_url
|
|
37
|
+
|
|
38
|
+
attr_accessor :anaysis_status
|
|
39
|
+
|
|
40
|
+
attr_accessor :is_ai_anaysis_flag
|
|
41
|
+
|
|
42
|
+
attr_accessor :doc_id
|
|
43
|
+
|
|
44
|
+
attr_accessor :highlight_areas
|
|
45
|
+
|
|
46
|
+
attr_accessor :attachment_id
|
|
47
|
+
|
|
48
|
+
attr_accessor :manual_review_status
|
|
49
|
+
|
|
50
|
+
attr_accessor :is_operated
|
|
51
|
+
|
|
52
|
+
attr_accessor :ai_status
|
|
53
|
+
|
|
54
|
+
attr_accessor :is_aireview
|
|
55
|
+
|
|
56
|
+
# 文件的 SHA-256 十六进制摘要
|
|
57
|
+
attr_accessor :file_hash256
|
|
58
|
+
|
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
60
|
+
def self.attribute_map
|
|
61
|
+
{
|
|
62
|
+
:'id' => :'id',
|
|
63
|
+
:'file_path' => :'filePath',
|
|
64
|
+
:'file_name' => :'fileName',
|
|
65
|
+
:'status' => :'status',
|
|
66
|
+
:'submitted_at' => :'submittedAt',
|
|
67
|
+
:'file_size' => :'fileSize',
|
|
68
|
+
:'tenant_id' => :'tenantId',
|
|
69
|
+
:'file_type' => :'fileType',
|
|
70
|
+
:'file_url' => :'fileUrl',
|
|
71
|
+
:'anaysis_status' => :'anaysisStatus',
|
|
72
|
+
:'is_ai_anaysis_flag' => :'isAiAnaysisFlag',
|
|
73
|
+
:'doc_id' => :'docId',
|
|
74
|
+
:'highlight_areas' => :'highlightAreas',
|
|
75
|
+
:'attachment_id' => :'attachmentId',
|
|
76
|
+
:'manual_review_status' => :'manualReviewStatus',
|
|
77
|
+
:'is_operated' => :'isOperated',
|
|
78
|
+
:'ai_status' => :'aiStatus',
|
|
79
|
+
:'is_aireview' => :'isAireview',
|
|
80
|
+
:'file_hash256' => :'fileHash256'
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns attribute mapping this model knows about
|
|
85
|
+
def self.acceptable_attribute_map
|
|
86
|
+
attribute_map
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Returns all the JSON keys this model knows about
|
|
90
|
+
def self.acceptable_attributes
|
|
91
|
+
acceptable_attribute_map.values
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Attribute type mapping.
|
|
95
|
+
def self.openapi_types
|
|
96
|
+
{
|
|
97
|
+
:'id' => :'String',
|
|
98
|
+
:'file_path' => :'String',
|
|
99
|
+
:'file_name' => :'String',
|
|
100
|
+
:'status' => :'Integer',
|
|
101
|
+
:'submitted_at' => :'Time',
|
|
102
|
+
:'file_size' => :'Float',
|
|
103
|
+
:'tenant_id' => :'String',
|
|
104
|
+
:'file_type' => :'String',
|
|
105
|
+
:'file_url' => :'String',
|
|
106
|
+
:'anaysis_status' => :'String',
|
|
107
|
+
:'is_ai_anaysis_flag' => :'Boolean',
|
|
108
|
+
:'doc_id' => :'String',
|
|
109
|
+
:'highlight_areas' => :'Object',
|
|
110
|
+
:'attachment_id' => :'String',
|
|
111
|
+
:'manual_review_status' => :'Integer',
|
|
112
|
+
:'is_operated' => :'Boolean',
|
|
113
|
+
:'ai_status' => :'Integer',
|
|
114
|
+
:'is_aireview' => :'Boolean',
|
|
115
|
+
:'file_hash256' => :'String'
|
|
116
|
+
}
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# List of attributes with nullable: true
|
|
120
|
+
def self.openapi_nullable
|
|
121
|
+
Set.new([
|
|
122
|
+
:'id',
|
|
123
|
+
:'file_path',
|
|
124
|
+
:'file_name',
|
|
125
|
+
:'file_size',
|
|
126
|
+
:'tenant_id',
|
|
127
|
+
:'file_type',
|
|
128
|
+
:'file_url',
|
|
129
|
+
:'anaysis_status',
|
|
130
|
+
:'is_ai_anaysis_flag',
|
|
131
|
+
:'doc_id',
|
|
132
|
+
:'highlight_areas',
|
|
133
|
+
:'attachment_id',
|
|
134
|
+
:'manual_review_status',
|
|
135
|
+
:'is_operated',
|
|
136
|
+
:'ai_status',
|
|
137
|
+
:'is_aireview',
|
|
138
|
+
:'file_hash256'
|
|
139
|
+
])
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Initializes the object
|
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
144
|
+
def initialize(attributes = {})
|
|
145
|
+
if (!attributes.is_a?(Hash))
|
|
146
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::AttachmentInApiDto` initialize method"
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
150
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
151
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
152
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
153
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::AttachmentInApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
154
|
+
end
|
|
155
|
+
h[k.to_sym] = v
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'id')
|
|
159
|
+
self.id = attributes[:'id']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'file_path')
|
|
163
|
+
self.file_path = attributes[:'file_path']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'file_name')
|
|
167
|
+
self.file_name = attributes[:'file_name']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'status')
|
|
171
|
+
self.status = attributes[:'status']
|
|
172
|
+
else
|
|
173
|
+
self.status = nil
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'submitted_at')
|
|
177
|
+
self.submitted_at = attributes[:'submitted_at']
|
|
178
|
+
else
|
|
179
|
+
self.submitted_at = nil
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'file_size')
|
|
183
|
+
self.file_size = attributes[:'file_size']
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if attributes.key?(:'tenant_id')
|
|
187
|
+
self.tenant_id = attributes[:'tenant_id']
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if attributes.key?(:'file_type')
|
|
191
|
+
self.file_type = attributes[:'file_type']
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.key?(:'file_url')
|
|
195
|
+
self.file_url = attributes[:'file_url']
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if attributes.key?(:'anaysis_status')
|
|
199
|
+
self.anaysis_status = attributes[:'anaysis_status']
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if attributes.key?(:'is_ai_anaysis_flag')
|
|
203
|
+
self.is_ai_anaysis_flag = attributes[:'is_ai_anaysis_flag']
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if attributes.key?(:'doc_id')
|
|
207
|
+
self.doc_id = attributes[:'doc_id']
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if attributes.key?(:'highlight_areas')
|
|
211
|
+
self.highlight_areas = attributes[:'highlight_areas']
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if attributes.key?(:'attachment_id')
|
|
215
|
+
self.attachment_id = attributes[:'attachment_id']
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if attributes.key?(:'manual_review_status')
|
|
219
|
+
self.manual_review_status = attributes[:'manual_review_status']
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
if attributes.key?(:'is_operated')
|
|
223
|
+
self.is_operated = attributes[:'is_operated']
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
if attributes.key?(:'ai_status')
|
|
227
|
+
self.ai_status = attributes[:'ai_status']
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if attributes.key?(:'is_aireview')
|
|
231
|
+
self.is_aireview = attributes[:'is_aireview']
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if attributes.key?(:'file_hash256')
|
|
235
|
+
self.file_hash256 = attributes[:'file_hash256']
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
240
|
+
# @return Array for valid properties with the reasons
|
|
241
|
+
def list_invalid_properties
|
|
242
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
243
|
+
invalid_properties = Array.new
|
|
244
|
+
if @status.nil?
|
|
245
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if @submitted_at.nil?
|
|
249
|
+
invalid_properties.push('invalid value for "submitted_at", submitted_at cannot be nil.')
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
invalid_properties
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Check to see if the all the properties in the model are valid
|
|
256
|
+
# @return true if the model is valid
|
|
257
|
+
def valid?
|
|
258
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
259
|
+
return false if @status.nil?
|
|
260
|
+
return false if @submitted_at.nil?
|
|
261
|
+
true
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Custom attribute writer method with validation
|
|
265
|
+
# @param [Object] status Value to be assigned
|
|
266
|
+
def status=(status)
|
|
267
|
+
if status.nil?
|
|
268
|
+
fail ArgumentError, 'status cannot be nil'
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
@status = status
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Custom attribute writer method with validation
|
|
275
|
+
# @param [Object] submitted_at Value to be assigned
|
|
276
|
+
def submitted_at=(submitted_at)
|
|
277
|
+
if submitted_at.nil?
|
|
278
|
+
fail ArgumentError, 'submitted_at cannot be nil'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
@submitted_at = submitted_at
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Checks equality by comparing each attribute.
|
|
285
|
+
# @param [Object] Object to be compared
|
|
286
|
+
def ==(o)
|
|
287
|
+
return true if self.equal?(o)
|
|
288
|
+
self.class == o.class &&
|
|
289
|
+
id == o.id &&
|
|
290
|
+
file_path == o.file_path &&
|
|
291
|
+
file_name == o.file_name &&
|
|
292
|
+
status == o.status &&
|
|
293
|
+
submitted_at == o.submitted_at &&
|
|
294
|
+
file_size == o.file_size &&
|
|
295
|
+
tenant_id == o.tenant_id &&
|
|
296
|
+
file_type == o.file_type &&
|
|
297
|
+
file_url == o.file_url &&
|
|
298
|
+
anaysis_status == o.anaysis_status &&
|
|
299
|
+
is_ai_anaysis_flag == o.is_ai_anaysis_flag &&
|
|
300
|
+
doc_id == o.doc_id &&
|
|
301
|
+
highlight_areas == o.highlight_areas &&
|
|
302
|
+
attachment_id == o.attachment_id &&
|
|
303
|
+
manual_review_status == o.manual_review_status &&
|
|
304
|
+
is_operated == o.is_operated &&
|
|
305
|
+
ai_status == o.ai_status &&
|
|
306
|
+
is_aireview == o.is_aireview &&
|
|
307
|
+
file_hash256 == o.file_hash256
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# @see the `==` method
|
|
311
|
+
# @param [Object] Object to be compared
|
|
312
|
+
def eql?(o)
|
|
313
|
+
self == o
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Calculates hash code according to all attributes.
|
|
317
|
+
# @return [Integer] Hash code
|
|
318
|
+
def hash
|
|
319
|
+
[id, file_path, file_name, status, submitted_at, file_size, tenant_id, file_type, file_url, anaysis_status, is_ai_anaysis_flag, doc_id, highlight_areas, attachment_id, manual_review_status, is_operated, ai_status, is_aireview, file_hash256].hash
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Builds the object from hash
|
|
323
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
324
|
+
# @return [Object] Returns the model itself
|
|
325
|
+
def self.build_from_hash(attributes)
|
|
326
|
+
return nil unless attributes.is_a?(Hash)
|
|
327
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
328
|
+
transformed_hash = {}
|
|
329
|
+
openapi_types.each_pair do |key, type|
|
|
330
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
331
|
+
transformed_hash["#{key}"] = nil
|
|
332
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
333
|
+
# check to ensure the input is an array given that the attribute
|
|
334
|
+
# is documented as an array but the input is not
|
|
335
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
336
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
337
|
+
end
|
|
338
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
339
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
340
|
+
end
|
|
341
|
+
end
|
|
342
|
+
new(transformed_hash)
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Returns the object in the form of hash
|
|
346
|
+
# @return [Hash] Returns the object in the form of hash
|
|
347
|
+
def to_hash
|
|
348
|
+
hash = {}
|
|
349
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
350
|
+
value = self.send(attr)
|
|
351
|
+
if value.nil?
|
|
352
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
353
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
hash[param] = _to_hash(value)
|
|
357
|
+
end
|
|
358
|
+
hash
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
end
|
|
@@ -0,0 +1,334 @@
|
|
|
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 BrandKpiPolicyResult < ApiModelBase
|
|
19
|
+
# 实际被考核的订单明细 ID。
|
|
20
|
+
attr_accessor :order_line_id
|
|
21
|
+
|
|
22
|
+
# 品牌来源明细 ID,同一供应商跨品牌时不混用结果。
|
|
23
|
+
attr_accessor :brand_order_line_id
|
|
24
|
+
|
|
25
|
+
# Brand、T1、T2 或 T3。
|
|
26
|
+
attr_accessor :scope
|
|
27
|
+
|
|
28
|
+
# 新口径的考核结果,1 为合格,不代表原始快照状态被更改。
|
|
29
|
+
attr_accessor :kpi_status
|
|
30
|
+
|
|
31
|
+
# 新口径不计为逾期。
|
|
32
|
+
attr_accessor :is_overdue
|
|
33
|
+
|
|
34
|
+
# 新口径逾期天数为零。
|
|
35
|
+
attr_accessor :overdue_days
|
|
36
|
+
|
|
37
|
+
# 统计归属日期,到港优先,否则预计发货与订单创建取晚者。
|
|
38
|
+
attr_accessor :assessment_date
|
|
39
|
+
|
|
40
|
+
# 原始快照状态,没有快照时为空,供核对政策调整前结果。
|
|
41
|
+
attr_accessor :original_kpi_status
|
|
42
|
+
|
|
43
|
+
# 原始快照逾期天数,展示合格不覆盖历史事实。
|
|
44
|
+
attr_accessor :original_overdue_days
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'order_line_id' => :'orderLineId',
|
|
50
|
+
:'brand_order_line_id' => :'brandOrderLineId',
|
|
51
|
+
:'scope' => :'scope',
|
|
52
|
+
:'kpi_status' => :'kpiStatus',
|
|
53
|
+
:'is_overdue' => :'isOverdue',
|
|
54
|
+
:'overdue_days' => :'overdueDays',
|
|
55
|
+
:'assessment_date' => :'assessmentDate',
|
|
56
|
+
:'original_kpi_status' => :'originalKpiStatus',
|
|
57
|
+
:'original_overdue_days' => :'originalOverdueDays'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'order_line_id' => :'String',
|
|
75
|
+
:'brand_order_line_id' => :'String',
|
|
76
|
+
:'scope' => :'String',
|
|
77
|
+
:'kpi_status' => :'Integer',
|
|
78
|
+
:'is_overdue' => :'Boolean',
|
|
79
|
+
:'overdue_days' => :'Integer',
|
|
80
|
+
:'assessment_date' => :'Time',
|
|
81
|
+
:'original_kpi_status' => :'Integer',
|
|
82
|
+
:'original_overdue_days' => :'Integer'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
89
|
+
:'assessment_date',
|
|
90
|
+
:'original_kpi_status',
|
|
91
|
+
:'original_overdue_days'
|
|
92
|
+
])
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Initializes the object
|
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
97
|
+
def initialize(attributes = {})
|
|
98
|
+
if (!attributes.is_a?(Hash))
|
|
99
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::BrandKpiPolicyResult` initialize method"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
103
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::BrandKpiPolicyResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
107
|
+
end
|
|
108
|
+
h[k.to_sym] = v
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'order_line_id')
|
|
112
|
+
self.order_line_id = attributes[:'order_line_id']
|
|
113
|
+
else
|
|
114
|
+
self.order_line_id = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'brand_order_line_id')
|
|
118
|
+
self.brand_order_line_id = attributes[:'brand_order_line_id']
|
|
119
|
+
else
|
|
120
|
+
self.brand_order_line_id = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'scope')
|
|
124
|
+
self.scope = attributes[:'scope']
|
|
125
|
+
else
|
|
126
|
+
self.scope = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'kpi_status')
|
|
130
|
+
self.kpi_status = attributes[:'kpi_status']
|
|
131
|
+
else
|
|
132
|
+
self.kpi_status = nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'is_overdue')
|
|
136
|
+
self.is_overdue = attributes[:'is_overdue']
|
|
137
|
+
else
|
|
138
|
+
self.is_overdue = nil
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'overdue_days')
|
|
142
|
+
self.overdue_days = attributes[:'overdue_days']
|
|
143
|
+
else
|
|
144
|
+
self.overdue_days = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'assessment_date')
|
|
148
|
+
self.assessment_date = attributes[:'assessment_date']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'original_kpi_status')
|
|
152
|
+
self.original_kpi_status = attributes[:'original_kpi_status']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'original_overdue_days')
|
|
156
|
+
self.original_overdue_days = attributes[:'original_overdue_days']
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
161
|
+
# @return Array for valid properties with the reasons
|
|
162
|
+
def list_invalid_properties
|
|
163
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
164
|
+
invalid_properties = Array.new
|
|
165
|
+
if @order_line_id.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "order_line_id", order_line_id cannot be nil.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if @brand_order_line_id.nil?
|
|
170
|
+
invalid_properties.push('invalid value for "brand_order_line_id", brand_order_line_id cannot be nil.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if @scope.nil?
|
|
174
|
+
invalid_properties.push('invalid value for "scope", scope cannot be nil.')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if @kpi_status.nil?
|
|
178
|
+
invalid_properties.push('invalid value for "kpi_status", kpi_status cannot be nil.')
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if @is_overdue.nil?
|
|
182
|
+
invalid_properties.push('invalid value for "is_overdue", is_overdue cannot be nil.')
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if @overdue_days.nil?
|
|
186
|
+
invalid_properties.push('invalid value for "overdue_days", overdue_days cannot be nil.')
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
invalid_properties
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Check to see if the all the properties in the model are valid
|
|
193
|
+
# @return true if the model is valid
|
|
194
|
+
def valid?
|
|
195
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
196
|
+
return false if @order_line_id.nil?
|
|
197
|
+
return false if @brand_order_line_id.nil?
|
|
198
|
+
return false if @scope.nil?
|
|
199
|
+
return false if @kpi_status.nil?
|
|
200
|
+
return false if @is_overdue.nil?
|
|
201
|
+
return false if @overdue_days.nil?
|
|
202
|
+
true
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Custom attribute writer method with validation
|
|
206
|
+
# @param [Object] order_line_id Value to be assigned
|
|
207
|
+
def order_line_id=(order_line_id)
|
|
208
|
+
if order_line_id.nil?
|
|
209
|
+
fail ArgumentError, 'order_line_id cannot be nil'
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
@order_line_id = order_line_id
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method with validation
|
|
216
|
+
# @param [Object] brand_order_line_id Value to be assigned
|
|
217
|
+
def brand_order_line_id=(brand_order_line_id)
|
|
218
|
+
if brand_order_line_id.nil?
|
|
219
|
+
fail ArgumentError, 'brand_order_line_id cannot be nil'
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
@brand_order_line_id = brand_order_line_id
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Custom attribute writer method with validation
|
|
226
|
+
# @param [Object] scope Value to be assigned
|
|
227
|
+
def scope=(scope)
|
|
228
|
+
if scope.nil?
|
|
229
|
+
fail ArgumentError, 'scope cannot be nil'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@scope = scope
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] kpi_status Value to be assigned
|
|
237
|
+
def kpi_status=(kpi_status)
|
|
238
|
+
if kpi_status.nil?
|
|
239
|
+
fail ArgumentError, 'kpi_status cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
@kpi_status = kpi_status
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Custom attribute writer method with validation
|
|
246
|
+
# @param [Object] is_overdue Value to be assigned
|
|
247
|
+
def is_overdue=(is_overdue)
|
|
248
|
+
if is_overdue.nil?
|
|
249
|
+
fail ArgumentError, 'is_overdue cannot be nil'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
@is_overdue = is_overdue
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Custom attribute writer method with validation
|
|
256
|
+
# @param [Object] overdue_days Value to be assigned
|
|
257
|
+
def overdue_days=(overdue_days)
|
|
258
|
+
if overdue_days.nil?
|
|
259
|
+
fail ArgumentError, 'overdue_days cannot be nil'
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
@overdue_days = overdue_days
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Checks equality by comparing each attribute.
|
|
266
|
+
# @param [Object] Object to be compared
|
|
267
|
+
def ==(o)
|
|
268
|
+
return true if self.equal?(o)
|
|
269
|
+
self.class == o.class &&
|
|
270
|
+
order_line_id == o.order_line_id &&
|
|
271
|
+
brand_order_line_id == o.brand_order_line_id &&
|
|
272
|
+
scope == o.scope &&
|
|
273
|
+
kpi_status == o.kpi_status &&
|
|
274
|
+
is_overdue == o.is_overdue &&
|
|
275
|
+
overdue_days == o.overdue_days &&
|
|
276
|
+
assessment_date == o.assessment_date &&
|
|
277
|
+
original_kpi_status == o.original_kpi_status &&
|
|
278
|
+
original_overdue_days == o.original_overdue_days
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# @see the `==` method
|
|
282
|
+
# @param [Object] Object to be compared
|
|
283
|
+
def eql?(o)
|
|
284
|
+
self == o
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Calculates hash code according to all attributes.
|
|
288
|
+
# @return [Integer] Hash code
|
|
289
|
+
def hash
|
|
290
|
+
[order_line_id, brand_order_line_id, scope, kpi_status, is_overdue, overdue_days, assessment_date, original_kpi_status, original_overdue_days].hash
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Builds the object from hash
|
|
294
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
295
|
+
# @return [Object] Returns the model itself
|
|
296
|
+
def self.build_from_hash(attributes)
|
|
297
|
+
return nil unless attributes.is_a?(Hash)
|
|
298
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
299
|
+
transformed_hash = {}
|
|
300
|
+
openapi_types.each_pair do |key, type|
|
|
301
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
302
|
+
transformed_hash["#{key}"] = nil
|
|
303
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
304
|
+
# check to ensure the input is an array given that the attribute
|
|
305
|
+
# is documented as an array but the input is not
|
|
306
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
307
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
308
|
+
end
|
|
309
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
310
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
new(transformed_hash)
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Returns the object in the form of hash
|
|
317
|
+
# @return [Hash] Returns the object in the form of hash
|
|
318
|
+
def to_hash
|
|
319
|
+
hash = {}
|
|
320
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
321
|
+
value = self.send(attr)
|
|
322
|
+
if value.nil?
|
|
323
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
324
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
hash[param] = _to_hash(value)
|
|
328
|
+
end
|
|
329
|
+
hash
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
end
|