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,398 @@
|
|
|
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
|
+
# Table, stage_attachment
|
|
18
|
+
class StageAttachmentApiDto < ApiModelBase
|
|
19
|
+
# 流程文件表ID
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# 订单/⽣产单/发货单/⼊库单ID
|
|
23
|
+
attr_accessor :extend_id
|
|
24
|
+
|
|
25
|
+
# 流程阶段表id
|
|
26
|
+
attr_accessor :stage_id
|
|
27
|
+
|
|
28
|
+
# 文档类型表id
|
|
29
|
+
attr_accessor :document_type_id
|
|
30
|
+
|
|
31
|
+
# 文件存储路径
|
|
32
|
+
attr_accessor :file_path
|
|
33
|
+
|
|
34
|
+
# 文档的发生日期
|
|
35
|
+
attr_accessor :document_date
|
|
36
|
+
|
|
37
|
+
# 文档的编号,例如运输单号,入库号等
|
|
38
|
+
attr_accessor :document_number
|
|
39
|
+
|
|
40
|
+
# 原文件名称
|
|
41
|
+
attr_accessor :file_name
|
|
42
|
+
|
|
43
|
+
# 上传时间
|
|
44
|
+
attr_accessor :uploaded_at
|
|
45
|
+
|
|
46
|
+
# 上传用户id
|
|
47
|
+
attr_accessor :uploaded_by
|
|
48
|
+
|
|
49
|
+
# 备注
|
|
50
|
+
attr_accessor :remark
|
|
51
|
+
|
|
52
|
+
# -9 禁用, -1 删除, 0 正常
|
|
53
|
+
attr_accessor :status
|
|
54
|
+
|
|
55
|
+
# 租户ID
|
|
56
|
+
attr_accessor :tenant_id
|
|
57
|
+
|
|
58
|
+
# 环境类型:0 正式, 1 测试
|
|
59
|
+
attr_accessor :environment_type
|
|
60
|
+
|
|
61
|
+
# 文件大小mb
|
|
62
|
+
attr_accessor :file_size
|
|
63
|
+
|
|
64
|
+
# 文件对应的存储id
|
|
65
|
+
attr_accessor :attachment_id
|
|
66
|
+
|
|
67
|
+
# 关联文件的 SHA-256 十六进制摘要
|
|
68
|
+
attr_accessor :file_hash256
|
|
69
|
+
|
|
70
|
+
# ai审核文档id
|
|
71
|
+
attr_accessor :doc_id
|
|
72
|
+
|
|
73
|
+
# ai审核后状态
|
|
74
|
+
attr_accessor :ai_status
|
|
75
|
+
|
|
76
|
+
# 公司ID
|
|
77
|
+
attr_accessor :company_id
|
|
78
|
+
|
|
79
|
+
# 高风险预警情况
|
|
80
|
+
attr_accessor :risk_warning
|
|
81
|
+
|
|
82
|
+
attr_accessor :file_list
|
|
83
|
+
|
|
84
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
85
|
+
def self.attribute_map
|
|
86
|
+
{
|
|
87
|
+
:'id' => :'id',
|
|
88
|
+
:'extend_id' => :'extendId',
|
|
89
|
+
:'stage_id' => :'stageId',
|
|
90
|
+
:'document_type_id' => :'documentTypeId',
|
|
91
|
+
:'file_path' => :'filePath',
|
|
92
|
+
:'document_date' => :'documentDate',
|
|
93
|
+
:'document_number' => :'documentNumber',
|
|
94
|
+
:'file_name' => :'fileName',
|
|
95
|
+
:'uploaded_at' => :'uploadedAt',
|
|
96
|
+
:'uploaded_by' => :'uploadedBy',
|
|
97
|
+
:'remark' => :'remark',
|
|
98
|
+
:'status' => :'status',
|
|
99
|
+
:'tenant_id' => :'tenantId',
|
|
100
|
+
:'environment_type' => :'environmentType',
|
|
101
|
+
:'file_size' => :'fileSize',
|
|
102
|
+
:'attachment_id' => :'attachmentId',
|
|
103
|
+
:'file_hash256' => :'fileHash256',
|
|
104
|
+
:'doc_id' => :'docId',
|
|
105
|
+
:'ai_status' => :'aiStatus',
|
|
106
|
+
:'company_id' => :'companyId',
|
|
107
|
+
:'risk_warning' => :'riskWarning',
|
|
108
|
+
:'file_list' => :'fileList'
|
|
109
|
+
}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Returns attribute mapping this model knows about
|
|
113
|
+
def self.acceptable_attribute_map
|
|
114
|
+
attribute_map
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Returns all the JSON keys this model knows about
|
|
118
|
+
def self.acceptable_attributes
|
|
119
|
+
acceptable_attribute_map.values
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Attribute type mapping.
|
|
123
|
+
def self.openapi_types
|
|
124
|
+
{
|
|
125
|
+
:'id' => :'String',
|
|
126
|
+
:'extend_id' => :'String',
|
|
127
|
+
:'stage_id' => :'String',
|
|
128
|
+
:'document_type_id' => :'String',
|
|
129
|
+
:'file_path' => :'String',
|
|
130
|
+
:'document_date' => :'Time',
|
|
131
|
+
:'document_number' => :'String',
|
|
132
|
+
:'file_name' => :'String',
|
|
133
|
+
:'uploaded_at' => :'Time',
|
|
134
|
+
:'uploaded_by' => :'String',
|
|
135
|
+
:'remark' => :'String',
|
|
136
|
+
:'status' => :'Integer',
|
|
137
|
+
:'tenant_id' => :'String',
|
|
138
|
+
:'environment_type' => :'Integer',
|
|
139
|
+
:'file_size' => :'Float',
|
|
140
|
+
:'attachment_id' => :'String',
|
|
141
|
+
:'file_hash256' => :'String',
|
|
142
|
+
:'doc_id' => :'String',
|
|
143
|
+
:'ai_status' => :'String',
|
|
144
|
+
:'company_id' => :'String',
|
|
145
|
+
:'risk_warning' => :'Integer',
|
|
146
|
+
:'file_list' => :'Array<AttachmentInApiDto>'
|
|
147
|
+
}
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# List of attributes with nullable: true
|
|
151
|
+
def self.openapi_nullable
|
|
152
|
+
Set.new([
|
|
153
|
+
:'id',
|
|
154
|
+
:'extend_id',
|
|
155
|
+
:'stage_id',
|
|
156
|
+
:'document_type_id',
|
|
157
|
+
:'file_path',
|
|
158
|
+
:'document_date',
|
|
159
|
+
:'document_number',
|
|
160
|
+
:'file_name',
|
|
161
|
+
:'uploaded_at',
|
|
162
|
+
:'uploaded_by',
|
|
163
|
+
:'remark',
|
|
164
|
+
:'status',
|
|
165
|
+
:'tenant_id',
|
|
166
|
+
:'environment_type',
|
|
167
|
+
:'file_size',
|
|
168
|
+
:'attachment_id',
|
|
169
|
+
:'file_hash256',
|
|
170
|
+
:'doc_id',
|
|
171
|
+
:'ai_status',
|
|
172
|
+
:'company_id',
|
|
173
|
+
:'risk_warning',
|
|
174
|
+
])
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Initializes the object
|
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
179
|
+
def initialize(attributes = {})
|
|
180
|
+
if (!attributes.is_a?(Hash))
|
|
181
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::StageAttachmentApiDto` initialize method"
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
185
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
186
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
187
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
188
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::StageAttachmentApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
189
|
+
end
|
|
190
|
+
h[k.to_sym] = v
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'id')
|
|
194
|
+
self.id = attributes[:'id']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'extend_id')
|
|
198
|
+
self.extend_id = attributes[:'extend_id']
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if attributes.key?(:'stage_id')
|
|
202
|
+
self.stage_id = attributes[:'stage_id']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'document_type_id')
|
|
206
|
+
self.document_type_id = attributes[:'document_type_id']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'file_path')
|
|
210
|
+
self.file_path = attributes[:'file_path']
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if attributes.key?(:'document_date')
|
|
214
|
+
self.document_date = attributes[:'document_date']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'document_number')
|
|
218
|
+
self.document_number = attributes[:'document_number']
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'file_name')
|
|
222
|
+
self.file_name = attributes[:'file_name']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'uploaded_at')
|
|
226
|
+
self.uploaded_at = attributes[:'uploaded_at']
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'uploaded_by')
|
|
230
|
+
self.uploaded_by = attributes[:'uploaded_by']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'remark')
|
|
234
|
+
self.remark = attributes[:'remark']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'status')
|
|
238
|
+
self.status = attributes[:'status']
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if attributes.key?(:'tenant_id')
|
|
242
|
+
self.tenant_id = attributes[:'tenant_id']
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'environment_type')
|
|
246
|
+
self.environment_type = attributes[:'environment_type']
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if attributes.key?(:'file_size')
|
|
250
|
+
self.file_size = attributes[:'file_size']
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if attributes.key?(:'attachment_id')
|
|
254
|
+
self.attachment_id = attributes[:'attachment_id']
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if attributes.key?(:'file_hash256')
|
|
258
|
+
self.file_hash256 = attributes[:'file_hash256']
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if attributes.key?(:'doc_id')
|
|
262
|
+
self.doc_id = attributes[:'doc_id']
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'ai_status')
|
|
266
|
+
self.ai_status = attributes[:'ai_status']
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if attributes.key?(:'company_id')
|
|
270
|
+
self.company_id = attributes[:'company_id']
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if attributes.key?(:'risk_warning')
|
|
274
|
+
self.risk_warning = attributes[:'risk_warning']
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if attributes.key?(:'file_list')
|
|
278
|
+
if (value = attributes[:'file_list']).is_a?(Array)
|
|
279
|
+
self.file_list = value
|
|
280
|
+
end
|
|
281
|
+
else
|
|
282
|
+
self.file_list = nil
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
287
|
+
# @return Array for valid properties with the reasons
|
|
288
|
+
def list_invalid_properties
|
|
289
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
290
|
+
invalid_properties = Array.new
|
|
291
|
+
if @file_list.nil?
|
|
292
|
+
invalid_properties.push('invalid value for "file_list", file_list cannot be nil.')
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
invalid_properties
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Check to see if the all the properties in the model are valid
|
|
299
|
+
# @return true if the model is valid
|
|
300
|
+
def valid?
|
|
301
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
302
|
+
return false if @file_list.nil?
|
|
303
|
+
true
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Custom attribute writer method with validation
|
|
307
|
+
# @param [Object] file_list Value to be assigned
|
|
308
|
+
def file_list=(file_list)
|
|
309
|
+
if file_list.nil?
|
|
310
|
+
fail ArgumentError, 'file_list cannot be nil'
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
@file_list = file_list
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Checks equality by comparing each attribute.
|
|
317
|
+
# @param [Object] Object to be compared
|
|
318
|
+
def ==(o)
|
|
319
|
+
return true if self.equal?(o)
|
|
320
|
+
self.class == o.class &&
|
|
321
|
+
id == o.id &&
|
|
322
|
+
extend_id == o.extend_id &&
|
|
323
|
+
stage_id == o.stage_id &&
|
|
324
|
+
document_type_id == o.document_type_id &&
|
|
325
|
+
file_path == o.file_path &&
|
|
326
|
+
document_date == o.document_date &&
|
|
327
|
+
document_number == o.document_number &&
|
|
328
|
+
file_name == o.file_name &&
|
|
329
|
+
uploaded_at == o.uploaded_at &&
|
|
330
|
+
uploaded_by == o.uploaded_by &&
|
|
331
|
+
remark == o.remark &&
|
|
332
|
+
status == o.status &&
|
|
333
|
+
tenant_id == o.tenant_id &&
|
|
334
|
+
environment_type == o.environment_type &&
|
|
335
|
+
file_size == o.file_size &&
|
|
336
|
+
attachment_id == o.attachment_id &&
|
|
337
|
+
file_hash256 == o.file_hash256 &&
|
|
338
|
+
doc_id == o.doc_id &&
|
|
339
|
+
ai_status == o.ai_status &&
|
|
340
|
+
company_id == o.company_id &&
|
|
341
|
+
risk_warning == o.risk_warning &&
|
|
342
|
+
file_list == o.file_list
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# @see the `==` method
|
|
346
|
+
# @param [Object] Object to be compared
|
|
347
|
+
def eql?(o)
|
|
348
|
+
self == o
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# Calculates hash code according to all attributes.
|
|
352
|
+
# @return [Integer] Hash code
|
|
353
|
+
def hash
|
|
354
|
+
[id, extend_id, stage_id, document_type_id, file_path, document_date, document_number, file_name, uploaded_at, uploaded_by, remark, status, tenant_id, environment_type, file_size, attachment_id, file_hash256, doc_id, ai_status, company_id, risk_warning, file_list].hash
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# Builds the object from hash
|
|
358
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
359
|
+
# @return [Object] Returns the model itself
|
|
360
|
+
def self.build_from_hash(attributes)
|
|
361
|
+
return nil unless attributes.is_a?(Hash)
|
|
362
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
363
|
+
transformed_hash = {}
|
|
364
|
+
openapi_types.each_pair do |key, type|
|
|
365
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
366
|
+
transformed_hash["#{key}"] = nil
|
|
367
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
368
|
+
# check to ensure the input is an array given that the attribute
|
|
369
|
+
# is documented as an array but the input is not
|
|
370
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
371
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
372
|
+
end
|
|
373
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
374
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
new(transformed_hash)
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
# Returns the object in the form of hash
|
|
381
|
+
# @return [Hash] Returns the object in the form of hash
|
|
382
|
+
def to_hash
|
|
383
|
+
hash = {}
|
|
384
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
385
|
+
value = self.send(attr)
|
|
386
|
+
if value.nil?
|
|
387
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
388
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
hash[param] = _to_hash(value)
|
|
392
|
+
end
|
|
393
|
+
hash
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
end
|