tachain-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +226 -0
  5. data/Rakefile +10 -0
  6. data/git_push.sh +54 -0
  7. data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
  8. data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
  9. data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
  10. data/lib/tachain-sdk/api/api_order_api.rb +846 -0
  11. data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +466 -0
  13. data/lib/tachain-sdk/api_client.rb +397 -0
  14. data/lib/tachain-sdk/api_error.rb +58 -0
  15. data/lib/tachain-sdk/api_model_base.rb +88 -0
  16. data/lib/tachain-sdk/configuration.rb +329 -0
  17. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
  18. data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
  19. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
  20. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
  21. data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
  22. data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
  23. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
  24. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
  25. data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
  26. data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
  27. data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
  28. data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
  29. data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
  30. data/lib/tachain-sdk/models/api_response_string.rb +200 -0
  31. data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
  32. data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
  33. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
  34. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
  35. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
  36. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
  37. data/lib/tachain-sdk/models/company.rb +780 -0
  38. data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
  39. data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
  40. data/lib/tachain-sdk/models/customer.rb +569 -0
  41. data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
  42. data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
  43. data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
  44. data/lib/tachain-sdk/models/factory.rb +545 -0
  45. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
  46. data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
  47. data/lib/tachain-sdk/models/model1.rb +157 -0
  48. data/lib/tachain-sdk/models/model3.rb +202 -0
  49. data/lib/tachain-sdk/models/model4.rb +202 -0
  50. data/lib/tachain-sdk/models/order.rb +974 -0
  51. data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
  52. data/lib/tachain-sdk/models/order_line.rb +1184 -0
  53. data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
  54. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
  55. data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
  56. data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
  57. data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
  58. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
  59. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
  60. data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
  61. data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
  62. data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
  63. data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
  64. data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
  65. data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
  66. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
  67. data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
  68. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
  69. data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
  70. data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
  71. data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
  72. data/lib/tachain-sdk/models/supplier.rb +585 -0
  73. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
  74. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
  75. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
  76. data/lib/tachain-sdk/models/trader.rb +506 -0
  77. data/lib/tachain-sdk/signed_api_client.rb +65 -0
  78. data/lib/tachain-sdk/version.rb +15 -0
  79. data/lib/tachain-sdk.rb +108 -0
  80. data/spec/spec_helper.rb +111 -0
  81. data/tachain-sdk.gemspec +39 -0
  82. metadata +165 -0
@@ -0,0 +1,548 @@
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 ProductionRawMaterialDto < ApiModelBase
19
+ # 原料记录ID
20
+ attr_accessor :id
21
+
22
+ # 生产批次ID
23
+ attr_accessor :production_id
24
+
25
+ # 采购订单明细ID
26
+ attr_accessor :purchase_order_detail_id
27
+
28
+ # 原料名称(冗余)
29
+ attr_accessor :material_name
30
+
31
+ # 使用数量
32
+ attr_accessor :quantity_used
33
+
34
+ # 单位
35
+ attr_accessor :unit
36
+
37
+ # 租户ID
38
+ attr_accessor :tenant_id
39
+
40
+ # 环境类型:0正式,1测试
41
+ attr_accessor :environment_type
42
+
43
+ # 创建用户ID
44
+ attr_accessor :created_by
45
+
46
+ # 创建时间
47
+ attr_accessor :created_at
48
+
49
+ # 公司ID
50
+ attr_accessor :company_id
51
+
52
+ # 成品入库单ID,(MTS Only)
53
+ attr_accessor :receipt_id
54
+
55
+ # -9 禁用, -1 删除, 0 正常
56
+ attr_accessor :status
57
+
58
+ # 修改用户ID
59
+ attr_accessor :updated_by
60
+
61
+ # 更新时间
62
+ attr_accessor :updated_at
63
+
64
+ # 生产损耗率(%)
65
+ attr_accessor :loss
66
+
67
+ # 订单可用量
68
+ attr_accessor :available_quantity
69
+
70
+ # 单位名称
71
+ attr_accessor :u_name
72
+
73
+ # 订单编号
74
+ attr_accessor :order_number
75
+
76
+ # 订单行号
77
+ attr_accessor :line_number
78
+
79
+ # 订单唯一标识
80
+ attr_accessor :unique_no
81
+
82
+ # 原料编码
83
+ attr_accessor :material_code
84
+
85
+ # 关联采购订单行的阶段编码,用于快速申报领料回显和草稿保存。
86
+ attr_accessor :scope_code
87
+
88
+ # 关联采购订单行用于纤维申报匹配的代表成分编码。
89
+ attr_accessor :single_component
90
+
91
+ attr_accessor :parent_id
92
+
93
+ # 供应商名称
94
+ attr_accessor :supplier_name
95
+
96
+ # 采购附件列表(合同/发票/付款证明/宣誓书)
97
+ attr_accessor :attachments
98
+
99
+ # 采购单订单数量
100
+ attr_accessor :quantity
101
+
102
+ # 采购单单位
103
+ attr_accessor :po_unit
104
+
105
+ attr_accessor :po_status
106
+
107
+ attr_accessor :unit_code
108
+
109
+ # 前端使用
110
+ attr_accessor :u_id
111
+
112
+ attr_accessor :is_transfer
113
+
114
+ # Attribute mapping from ruby-style variable name to JSON key.
115
+ def self.attribute_map
116
+ {
117
+ :'id' => :'id',
118
+ :'production_id' => :'productionId',
119
+ :'purchase_order_detail_id' => :'purchaseOrderDetailId',
120
+ :'material_name' => :'materialName',
121
+ :'quantity_used' => :'quantityUsed',
122
+ :'unit' => :'unit',
123
+ :'tenant_id' => :'tenantId',
124
+ :'environment_type' => :'environmentType',
125
+ :'created_by' => :'createdBy',
126
+ :'created_at' => :'createdAt',
127
+ :'company_id' => :'companyId',
128
+ :'receipt_id' => :'receiptId',
129
+ :'status' => :'status',
130
+ :'updated_by' => :'updatedBy',
131
+ :'updated_at' => :'updatedAt',
132
+ :'loss' => :'loss',
133
+ :'available_quantity' => :'availableQuantity',
134
+ :'u_name' => :'uName',
135
+ :'order_number' => :'orderNumber',
136
+ :'line_number' => :'lineNumber',
137
+ :'unique_no' => :'uniqueNo',
138
+ :'material_code' => :'materialCode',
139
+ :'scope_code' => :'scopeCode',
140
+ :'single_component' => :'singleComponent',
141
+ :'parent_id' => :'parentId',
142
+ :'supplier_name' => :'supplierName',
143
+ :'attachments' => :'attachments',
144
+ :'quantity' => :'quantity',
145
+ :'po_unit' => :'poUnit',
146
+ :'po_status' => :'poStatus',
147
+ :'unit_code' => :'unitCode',
148
+ :'u_id' => :'uId',
149
+ :'is_transfer' => :'isTransfer'
150
+ }
151
+ end
152
+
153
+ # Returns attribute mapping this model knows about
154
+ def self.acceptable_attribute_map
155
+ attribute_map
156
+ end
157
+
158
+ # Returns all the JSON keys this model knows about
159
+ def self.acceptable_attributes
160
+ acceptable_attribute_map.values
161
+ end
162
+
163
+ # Attribute type mapping.
164
+ def self.openapi_types
165
+ {
166
+ :'id' => :'Integer',
167
+ :'production_id' => :'String',
168
+ :'purchase_order_detail_id' => :'String',
169
+ :'material_name' => :'String',
170
+ :'quantity_used' => :'Float',
171
+ :'unit' => :'String',
172
+ :'tenant_id' => :'String',
173
+ :'environment_type' => :'Integer',
174
+ :'created_by' => :'String',
175
+ :'created_at' => :'Time',
176
+ :'company_id' => :'String',
177
+ :'receipt_id' => :'Integer',
178
+ :'status' => :'Integer',
179
+ :'updated_by' => :'String',
180
+ :'updated_at' => :'Time',
181
+ :'loss' => :'Float',
182
+ :'available_quantity' => :'Float',
183
+ :'u_name' => :'String',
184
+ :'order_number' => :'String',
185
+ :'line_number' => :'String',
186
+ :'unique_no' => :'String',
187
+ :'material_code' => :'String',
188
+ :'scope_code' => :'String',
189
+ :'single_component' => :'String',
190
+ :'parent_id' => :'String',
191
+ :'supplier_name' => :'String',
192
+ :'attachments' => :'Array<Object>',
193
+ :'quantity' => :'Float',
194
+ :'po_unit' => :'String',
195
+ :'po_status' => :'Integer',
196
+ :'unit_code' => :'String',
197
+ :'u_id' => :'String',
198
+ :'is_transfer' => :'Integer'
199
+ }
200
+ end
201
+
202
+ # List of attributes with nullable: true
203
+ def self.openapi_nullable
204
+ Set.new([
205
+ :'production_id',
206
+ :'purchase_order_detail_id',
207
+ :'material_name',
208
+ :'unit',
209
+ :'tenant_id',
210
+ :'created_by',
211
+ :'created_at',
212
+ :'company_id',
213
+ :'receipt_id',
214
+ :'status',
215
+ :'updated_by',
216
+ :'updated_at',
217
+ :'loss',
218
+ :'available_quantity',
219
+ :'u_name',
220
+ :'order_number',
221
+ :'line_number',
222
+ :'unique_no',
223
+ :'material_code',
224
+ :'scope_code',
225
+ :'single_component',
226
+ :'parent_id',
227
+ :'supplier_name',
228
+ :'attachments',
229
+ :'quantity',
230
+ :'po_unit',
231
+ :'po_status',
232
+ :'unit_code',
233
+ :'u_id',
234
+ :'is_transfer'
235
+ ])
236
+ end
237
+
238
+ # Initializes the object
239
+ # @param [Hash] attributes Model attributes in the form of hash
240
+ def initialize(attributes = {})
241
+ if (!attributes.is_a?(Hash))
242
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ProductionRawMaterialDto` initialize method"
243
+ end
244
+
245
+ # check to see if the attribute exists and convert string to symbol for hash key
246
+ acceptable_attribute_map = self.class.acceptable_attribute_map
247
+ attributes = attributes.each_with_object({}) { |(k, v), h|
248
+ if (!acceptable_attribute_map.key?(k.to_sym))
249
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ProductionRawMaterialDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
250
+ end
251
+ h[k.to_sym] = v
252
+ }
253
+
254
+ if attributes.key?(:'id')
255
+ self.id = attributes[:'id']
256
+ else
257
+ self.id = nil
258
+ end
259
+
260
+ if attributes.key?(:'production_id')
261
+ self.production_id = attributes[:'production_id']
262
+ end
263
+
264
+ if attributes.key?(:'purchase_order_detail_id')
265
+ self.purchase_order_detail_id = attributes[:'purchase_order_detail_id']
266
+ end
267
+
268
+ if attributes.key?(:'material_name')
269
+ self.material_name = attributes[:'material_name']
270
+ end
271
+
272
+ if attributes.key?(:'quantity_used')
273
+ self.quantity_used = attributes[:'quantity_used']
274
+ else
275
+ self.quantity_used = nil
276
+ end
277
+
278
+ if attributes.key?(:'unit')
279
+ self.unit = attributes[:'unit']
280
+ end
281
+
282
+ if attributes.key?(:'tenant_id')
283
+ self.tenant_id = attributes[:'tenant_id']
284
+ end
285
+
286
+ if attributes.key?(:'environment_type')
287
+ self.environment_type = attributes[:'environment_type']
288
+ else
289
+ self.environment_type = nil
290
+ end
291
+
292
+ if attributes.key?(:'created_by')
293
+ self.created_by = attributes[:'created_by']
294
+ end
295
+
296
+ if attributes.key?(:'created_at')
297
+ self.created_at = attributes[:'created_at']
298
+ end
299
+
300
+ if attributes.key?(:'company_id')
301
+ self.company_id = attributes[:'company_id']
302
+ end
303
+
304
+ if attributes.key?(:'receipt_id')
305
+ self.receipt_id = attributes[:'receipt_id']
306
+ end
307
+
308
+ if attributes.key?(:'status')
309
+ self.status = attributes[:'status']
310
+ end
311
+
312
+ if attributes.key?(:'updated_by')
313
+ self.updated_by = attributes[:'updated_by']
314
+ end
315
+
316
+ if attributes.key?(:'updated_at')
317
+ self.updated_at = attributes[:'updated_at']
318
+ end
319
+
320
+ if attributes.key?(:'loss')
321
+ self.loss = attributes[:'loss']
322
+ end
323
+
324
+ if attributes.key?(:'available_quantity')
325
+ self.available_quantity = attributes[:'available_quantity']
326
+ end
327
+
328
+ if attributes.key?(:'u_name')
329
+ self.u_name = attributes[:'u_name']
330
+ end
331
+
332
+ if attributes.key?(:'order_number')
333
+ self.order_number = attributes[:'order_number']
334
+ end
335
+
336
+ if attributes.key?(:'line_number')
337
+ self.line_number = attributes[:'line_number']
338
+ end
339
+
340
+ if attributes.key?(:'unique_no')
341
+ self.unique_no = attributes[:'unique_no']
342
+ end
343
+
344
+ if attributes.key?(:'material_code')
345
+ self.material_code = attributes[:'material_code']
346
+ end
347
+
348
+ if attributes.key?(:'scope_code')
349
+ self.scope_code = attributes[:'scope_code']
350
+ end
351
+
352
+ if attributes.key?(:'single_component')
353
+ self.single_component = attributes[:'single_component']
354
+ end
355
+
356
+ if attributes.key?(:'parent_id')
357
+ self.parent_id = attributes[:'parent_id']
358
+ end
359
+
360
+ if attributes.key?(:'supplier_name')
361
+ self.supplier_name = attributes[:'supplier_name']
362
+ end
363
+
364
+ if attributes.key?(:'attachments')
365
+ if (value = attributes[:'attachments']).is_a?(Array)
366
+ self.attachments = value
367
+ end
368
+ end
369
+
370
+ if attributes.key?(:'quantity')
371
+ self.quantity = attributes[:'quantity']
372
+ end
373
+
374
+ if attributes.key?(:'po_unit')
375
+ self.po_unit = attributes[:'po_unit']
376
+ end
377
+
378
+ if attributes.key?(:'po_status')
379
+ self.po_status = attributes[:'po_status']
380
+ end
381
+
382
+ if attributes.key?(:'unit_code')
383
+ self.unit_code = attributes[:'unit_code']
384
+ end
385
+
386
+ if attributes.key?(:'u_id')
387
+ self.u_id = attributes[:'u_id']
388
+ end
389
+
390
+ if attributes.key?(:'is_transfer')
391
+ self.is_transfer = attributes[:'is_transfer']
392
+ end
393
+ end
394
+
395
+ # Show invalid properties with the reasons. Usually used together with valid?
396
+ # @return Array for valid properties with the reasons
397
+ def list_invalid_properties
398
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
399
+ invalid_properties = Array.new
400
+ if @id.nil?
401
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
402
+ end
403
+
404
+ if @quantity_used.nil?
405
+ invalid_properties.push('invalid value for "quantity_used", quantity_used cannot be nil.')
406
+ end
407
+
408
+ if @environment_type.nil?
409
+ invalid_properties.push('invalid value for "environment_type", environment_type cannot be nil.')
410
+ end
411
+
412
+ invalid_properties
413
+ end
414
+
415
+ # Check to see if the all the properties in the model are valid
416
+ # @return true if the model is valid
417
+ def valid?
418
+ warn '[DEPRECATED] the `valid?` method is obsolete'
419
+ return false if @id.nil?
420
+ return false if @quantity_used.nil?
421
+ return false if @environment_type.nil?
422
+ true
423
+ end
424
+
425
+ # Custom attribute writer method with validation
426
+ # @param [Object] id Value to be assigned
427
+ def id=(id)
428
+ if id.nil?
429
+ fail ArgumentError, 'id cannot be nil'
430
+ end
431
+
432
+ @id = id
433
+ end
434
+
435
+ # Custom attribute writer method with validation
436
+ # @param [Object] quantity_used Value to be assigned
437
+ def quantity_used=(quantity_used)
438
+ if quantity_used.nil?
439
+ fail ArgumentError, 'quantity_used cannot be nil'
440
+ end
441
+
442
+ @quantity_used = quantity_used
443
+ end
444
+
445
+ # Custom attribute writer method with validation
446
+ # @param [Object] environment_type Value to be assigned
447
+ def environment_type=(environment_type)
448
+ if environment_type.nil?
449
+ fail ArgumentError, 'environment_type cannot be nil'
450
+ end
451
+
452
+ @environment_type = environment_type
453
+ end
454
+
455
+ # Checks equality by comparing each attribute.
456
+ # @param [Object] Object to be compared
457
+ def ==(o)
458
+ return true if self.equal?(o)
459
+ self.class == o.class &&
460
+ id == o.id &&
461
+ production_id == o.production_id &&
462
+ purchase_order_detail_id == o.purchase_order_detail_id &&
463
+ material_name == o.material_name &&
464
+ quantity_used == o.quantity_used &&
465
+ unit == o.unit &&
466
+ tenant_id == o.tenant_id &&
467
+ environment_type == o.environment_type &&
468
+ created_by == o.created_by &&
469
+ created_at == o.created_at &&
470
+ company_id == o.company_id &&
471
+ receipt_id == o.receipt_id &&
472
+ status == o.status &&
473
+ updated_by == o.updated_by &&
474
+ updated_at == o.updated_at &&
475
+ loss == o.loss &&
476
+ available_quantity == o.available_quantity &&
477
+ u_name == o.u_name &&
478
+ order_number == o.order_number &&
479
+ line_number == o.line_number &&
480
+ unique_no == o.unique_no &&
481
+ material_code == o.material_code &&
482
+ scope_code == o.scope_code &&
483
+ single_component == o.single_component &&
484
+ parent_id == o.parent_id &&
485
+ supplier_name == o.supplier_name &&
486
+ attachments == o.attachments &&
487
+ quantity == o.quantity &&
488
+ po_unit == o.po_unit &&
489
+ po_status == o.po_status &&
490
+ unit_code == o.unit_code &&
491
+ u_id == o.u_id &&
492
+ is_transfer == o.is_transfer
493
+ end
494
+
495
+ # @see the `==` method
496
+ # @param [Object] Object to be compared
497
+ def eql?(o)
498
+ self == o
499
+ end
500
+
501
+ # Calculates hash code according to all attributes.
502
+ # @return [Integer] Hash code
503
+ def hash
504
+ [id, production_id, purchase_order_detail_id, material_name, quantity_used, unit, tenant_id, environment_type, created_by, created_at, company_id, receipt_id, status, updated_by, updated_at, loss, available_quantity, u_name, order_number, line_number, unique_no, material_code, scope_code, single_component, parent_id, supplier_name, attachments, quantity, po_unit, po_status, unit_code, u_id, is_transfer].hash
505
+ end
506
+
507
+ # Builds the object from hash
508
+ # @param [Hash] attributes Model attributes in the form of hash
509
+ # @return [Object] Returns the model itself
510
+ def self.build_from_hash(attributes)
511
+ return nil unless attributes.is_a?(Hash)
512
+ attributes = attributes.transform_keys(&:to_sym)
513
+ transformed_hash = {}
514
+ openapi_types.each_pair do |key, type|
515
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
516
+ transformed_hash["#{key}"] = nil
517
+ elsif type =~ /\AArray<(.*)>/i
518
+ # check to ensure the input is an array given that the attribute
519
+ # is documented as an array but the input is not
520
+ if attributes[attribute_map[key]].is_a?(Array)
521
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
522
+ end
523
+ elsif !attributes[attribute_map[key]].nil?
524
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
525
+ end
526
+ end
527
+ new(transformed_hash)
528
+ end
529
+
530
+ # Returns the object in the form of hash
531
+ # @return [Hash] Returns the object in the form of hash
532
+ def to_hash
533
+ hash = {}
534
+ self.class.attribute_map.each_pair do |attr, param|
535
+ value = self.send(attr)
536
+ if value.nil?
537
+ is_nullable = self.class.openapi_nullable.include?(attr)
538
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
539
+ end
540
+
541
+ hash[param] = _to_hash(value)
542
+ end
543
+ hash
544
+ end
545
+
546
+ end
547
+
548
+ end