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,545 @@
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 Factory < ApiModelBase
19
+ # 工厂ID
20
+ attr_accessor :id
21
+
22
+ # 关联的公司ID
23
+ attr_accessor :company_id
24
+
25
+ # 所属租户ID
26
+ attr_accessor :belong_tenant_id
27
+
28
+ # 销售范围,单选,多个创建多条数据
29
+ attr_accessor :sales_scope
30
+
31
+ # 状态:-9 禁用, -1 删除, 0 正常
32
+ attr_accessor :status
33
+
34
+ # 租户ID
35
+ attr_accessor :tenant_id
36
+
37
+ # 环境类型:0 正式,1 测试
38
+ attr_accessor :environment_type
39
+
40
+ # 创建用户ID
41
+ attr_accessor :created_by
42
+
43
+ # 修改用户ID
44
+ attr_accessor :updated_by
45
+
46
+ # 创建时间
47
+ attr_accessor :created_at
48
+
49
+ # 更新时间
50
+ attr_accessor :updated_at
51
+
52
+ # 委外审核状态
53
+ attr_accessor :out_audit_status
54
+
55
+ # 工厂类型:0 自有,1 委外
56
+ attr_accessor :factory_type
57
+
58
+ # 审核状态:101 草稿,102 待审核 ,103 重新提交待审, 111 取消审核, 113 审核作废, 114 审核驳回, 115 审核拒绝, 120 审核通过
59
+ attr_accessor :audit_status
60
+
61
+ # 部门ID
62
+ attr_accessor :division_id
63
+
64
+ # 生产能力
65
+ attr_accessor :production_capacity
66
+
67
+ # 质量认证
68
+ attr_accessor :quality_certification
69
+
70
+ # 安全标准
71
+ attr_accessor :safety_standard
72
+
73
+ # 备注
74
+ attr_accessor :remark
75
+
76
+ attr_accessor :company
77
+
78
+ attr_accessor :company_utility_declarations
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'id' => :'id',
84
+ :'company_id' => :'companyId',
85
+ :'belong_tenant_id' => :'belongTenantId',
86
+ :'sales_scope' => :'salesScope',
87
+ :'status' => :'status',
88
+ :'tenant_id' => :'tenantId',
89
+ :'environment_type' => :'environmentType',
90
+ :'created_by' => :'createdBy',
91
+ :'updated_by' => :'updatedBy',
92
+ :'created_at' => :'createdAt',
93
+ :'updated_at' => :'updatedAt',
94
+ :'out_audit_status' => :'outAuditStatus',
95
+ :'factory_type' => :'factoryType',
96
+ :'audit_status' => :'auditStatus',
97
+ :'division_id' => :'divisionId',
98
+ :'production_capacity' => :'productionCapacity',
99
+ :'quality_certification' => :'qualityCertification',
100
+ :'safety_standard' => :'safetyStandard',
101
+ :'remark' => :'remark',
102
+ :'company' => :'company',
103
+ :'company_utility_declarations' => :'companyUtilityDeclarations'
104
+ }
105
+ end
106
+
107
+ # Returns attribute mapping this model knows about
108
+ def self.acceptable_attribute_map
109
+ attribute_map
110
+ end
111
+
112
+ # Returns all the JSON keys this model knows about
113
+ def self.acceptable_attributes
114
+ acceptable_attribute_map.values
115
+ end
116
+
117
+ # Attribute type mapping.
118
+ def self.openapi_types
119
+ {
120
+ :'id' => :'String',
121
+ :'company_id' => :'String',
122
+ :'belong_tenant_id' => :'String',
123
+ :'sales_scope' => :'String',
124
+ :'status' => :'Integer',
125
+ :'tenant_id' => :'String',
126
+ :'environment_type' => :'Integer',
127
+ :'created_by' => :'String',
128
+ :'updated_by' => :'String',
129
+ :'created_at' => :'Time',
130
+ :'updated_at' => :'Time',
131
+ :'out_audit_status' => :'String',
132
+ :'factory_type' => :'Integer',
133
+ :'audit_status' => :'Integer',
134
+ :'division_id' => :'String',
135
+ :'production_capacity' => :'String',
136
+ :'quality_certification' => :'String',
137
+ :'safety_standard' => :'String',
138
+ :'remark' => :'String',
139
+ :'company' => :'Company',
140
+ :'company_utility_declarations' => :'Array<CompanyUtilityDeclaration>'
141
+ }
142
+ end
143
+
144
+ # List of attributes with nullable: true
145
+ def self.openapi_nullable
146
+ Set.new([
147
+ :'belong_tenant_id',
148
+ :'updated_by',
149
+ :'updated_at',
150
+ :'out_audit_status',
151
+ :'division_id',
152
+ :'production_capacity',
153
+ :'quality_certification',
154
+ :'safety_standard',
155
+ :'remark',
156
+ ])
157
+ end
158
+
159
+ # Initializes the object
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ def initialize(attributes = {})
162
+ if (!attributes.is_a?(Hash))
163
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::Factory` initialize method"
164
+ end
165
+
166
+ # check to see if the attribute exists and convert string to symbol for hash key
167
+ acceptable_attribute_map = self.class.acceptable_attribute_map
168
+ attributes = attributes.each_with_object({}) { |(k, v), h|
169
+ if (!acceptable_attribute_map.key?(k.to_sym))
170
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::Factory`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
171
+ end
172
+ h[k.to_sym] = v
173
+ }
174
+
175
+ if attributes.key?(:'id')
176
+ self.id = attributes[:'id']
177
+ else
178
+ self.id = nil
179
+ end
180
+
181
+ if attributes.key?(:'company_id')
182
+ self.company_id = attributes[:'company_id']
183
+ else
184
+ self.company_id = nil
185
+ end
186
+
187
+ if attributes.key?(:'belong_tenant_id')
188
+ self.belong_tenant_id = attributes[:'belong_tenant_id']
189
+ end
190
+
191
+ if attributes.key?(:'sales_scope')
192
+ self.sales_scope = attributes[:'sales_scope']
193
+ else
194
+ self.sales_scope = nil
195
+ end
196
+
197
+ if attributes.key?(:'status')
198
+ self.status = attributes[:'status']
199
+ else
200
+ self.status = nil
201
+ end
202
+
203
+ if attributes.key?(:'tenant_id')
204
+ self.tenant_id = attributes[:'tenant_id']
205
+ else
206
+ self.tenant_id = nil
207
+ end
208
+
209
+ if attributes.key?(:'environment_type')
210
+ self.environment_type = attributes[:'environment_type']
211
+ else
212
+ self.environment_type = nil
213
+ end
214
+
215
+ if attributes.key?(:'created_by')
216
+ self.created_by = attributes[:'created_by']
217
+ else
218
+ self.created_by = nil
219
+ end
220
+
221
+ if attributes.key?(:'updated_by')
222
+ self.updated_by = attributes[:'updated_by']
223
+ end
224
+
225
+ if attributes.key?(:'created_at')
226
+ self.created_at = attributes[:'created_at']
227
+ else
228
+ self.created_at = nil
229
+ end
230
+
231
+ if attributes.key?(:'updated_at')
232
+ self.updated_at = attributes[:'updated_at']
233
+ end
234
+
235
+ if attributes.key?(:'out_audit_status')
236
+ self.out_audit_status = attributes[:'out_audit_status']
237
+ end
238
+
239
+ if attributes.key?(:'factory_type')
240
+ self.factory_type = attributes[:'factory_type']
241
+ else
242
+ self.factory_type = nil
243
+ end
244
+
245
+ if attributes.key?(:'audit_status')
246
+ self.audit_status = attributes[:'audit_status']
247
+ else
248
+ self.audit_status = nil
249
+ end
250
+
251
+ if attributes.key?(:'division_id')
252
+ self.division_id = attributes[:'division_id']
253
+ end
254
+
255
+ if attributes.key?(:'production_capacity')
256
+ self.production_capacity = attributes[:'production_capacity']
257
+ end
258
+
259
+ if attributes.key?(:'quality_certification')
260
+ self.quality_certification = attributes[:'quality_certification']
261
+ end
262
+
263
+ if attributes.key?(:'safety_standard')
264
+ self.safety_standard = attributes[:'safety_standard']
265
+ end
266
+
267
+ if attributes.key?(:'remark')
268
+ self.remark = attributes[:'remark']
269
+ end
270
+
271
+ if attributes.key?(:'company')
272
+ self.company = attributes[:'company']
273
+ end
274
+
275
+ if attributes.key?(:'company_utility_declarations')
276
+ if (value = attributes[:'company_utility_declarations']).is_a?(Array)
277
+ self.company_utility_declarations = value
278
+ end
279
+ else
280
+ self.company_utility_declarations = nil
281
+ end
282
+ end
283
+
284
+ # Show invalid properties with the reasons. Usually used together with valid?
285
+ # @return Array for valid properties with the reasons
286
+ def list_invalid_properties
287
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
288
+ invalid_properties = Array.new
289
+ if @id.nil?
290
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
291
+ end
292
+
293
+ if @company_id.nil?
294
+ invalid_properties.push('invalid value for "company_id", company_id cannot be nil.')
295
+ end
296
+
297
+ if @sales_scope.nil?
298
+ invalid_properties.push('invalid value for "sales_scope", sales_scope cannot be nil.')
299
+ end
300
+
301
+ if @status.nil?
302
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
303
+ end
304
+
305
+ if @tenant_id.nil?
306
+ invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
307
+ end
308
+
309
+ if @environment_type.nil?
310
+ invalid_properties.push('invalid value for "environment_type", environment_type cannot be nil.')
311
+ end
312
+
313
+ if @created_by.nil?
314
+ invalid_properties.push('invalid value for "created_by", created_by cannot be nil.')
315
+ end
316
+
317
+ if @created_at.nil?
318
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
319
+ end
320
+
321
+ if @factory_type.nil?
322
+ invalid_properties.push('invalid value for "factory_type", factory_type cannot be nil.')
323
+ end
324
+
325
+ if @audit_status.nil?
326
+ invalid_properties.push('invalid value for "audit_status", audit_status cannot be nil.')
327
+ end
328
+
329
+ if @company_utility_declarations.nil?
330
+ invalid_properties.push('invalid value for "company_utility_declarations", company_utility_declarations cannot be nil.')
331
+ end
332
+
333
+ invalid_properties
334
+ end
335
+
336
+ # Check to see if the all the properties in the model are valid
337
+ # @return true if the model is valid
338
+ def valid?
339
+ warn '[DEPRECATED] the `valid?` method is obsolete'
340
+ return false if @id.nil?
341
+ return false if @company_id.nil?
342
+ return false if @sales_scope.nil?
343
+ return false if @status.nil?
344
+ return false if @tenant_id.nil?
345
+ return false if @environment_type.nil?
346
+ return false if @created_by.nil?
347
+ return false if @created_at.nil?
348
+ return false if @factory_type.nil?
349
+ return false if @audit_status.nil?
350
+ return false if @company_utility_declarations.nil?
351
+ true
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] id Value to be assigned
356
+ def id=(id)
357
+ if id.nil?
358
+ fail ArgumentError, 'id cannot be nil'
359
+ end
360
+
361
+ @id = id
362
+ end
363
+
364
+ # Custom attribute writer method with validation
365
+ # @param [Object] company_id Value to be assigned
366
+ def company_id=(company_id)
367
+ if company_id.nil?
368
+ fail ArgumentError, 'company_id cannot be nil'
369
+ end
370
+
371
+ @company_id = company_id
372
+ end
373
+
374
+ # Custom attribute writer method with validation
375
+ # @param [Object] sales_scope Value to be assigned
376
+ def sales_scope=(sales_scope)
377
+ if sales_scope.nil?
378
+ fail ArgumentError, 'sales_scope cannot be nil'
379
+ end
380
+
381
+ @sales_scope = sales_scope
382
+ end
383
+
384
+ # Custom attribute writer method with validation
385
+ # @param [Object] status Value to be assigned
386
+ def status=(status)
387
+ if status.nil?
388
+ fail ArgumentError, 'status cannot be nil'
389
+ end
390
+
391
+ @status = status
392
+ end
393
+
394
+ # Custom attribute writer method with validation
395
+ # @param [Object] tenant_id Value to be assigned
396
+ def tenant_id=(tenant_id)
397
+ if tenant_id.nil?
398
+ fail ArgumentError, 'tenant_id cannot be nil'
399
+ end
400
+
401
+ @tenant_id = tenant_id
402
+ end
403
+
404
+ # Custom attribute writer method with validation
405
+ # @param [Object] environment_type Value to be assigned
406
+ def environment_type=(environment_type)
407
+ if environment_type.nil?
408
+ fail ArgumentError, 'environment_type cannot be nil'
409
+ end
410
+
411
+ @environment_type = environment_type
412
+ end
413
+
414
+ # Custom attribute writer method with validation
415
+ # @param [Object] created_by Value to be assigned
416
+ def created_by=(created_by)
417
+ if created_by.nil?
418
+ fail ArgumentError, 'created_by cannot be nil'
419
+ end
420
+
421
+ @created_by = created_by
422
+ end
423
+
424
+ # Custom attribute writer method with validation
425
+ # @param [Object] created_at Value to be assigned
426
+ def created_at=(created_at)
427
+ if created_at.nil?
428
+ fail ArgumentError, 'created_at cannot be nil'
429
+ end
430
+
431
+ @created_at = created_at
432
+ end
433
+
434
+ # Custom attribute writer method with validation
435
+ # @param [Object] factory_type Value to be assigned
436
+ def factory_type=(factory_type)
437
+ if factory_type.nil?
438
+ fail ArgumentError, 'factory_type cannot be nil'
439
+ end
440
+
441
+ @factory_type = factory_type
442
+ end
443
+
444
+ # Custom attribute writer method with validation
445
+ # @param [Object] audit_status Value to be assigned
446
+ def audit_status=(audit_status)
447
+ if audit_status.nil?
448
+ fail ArgumentError, 'audit_status cannot be nil'
449
+ end
450
+
451
+ @audit_status = audit_status
452
+ end
453
+
454
+ # Custom attribute writer method with validation
455
+ # @param [Object] company_utility_declarations Value to be assigned
456
+ def company_utility_declarations=(company_utility_declarations)
457
+ if company_utility_declarations.nil?
458
+ fail ArgumentError, 'company_utility_declarations cannot be nil'
459
+ end
460
+
461
+ @company_utility_declarations = company_utility_declarations
462
+ end
463
+
464
+ # Checks equality by comparing each attribute.
465
+ # @param [Object] Object to be compared
466
+ def ==(o)
467
+ return true if self.equal?(o)
468
+ self.class == o.class &&
469
+ id == o.id &&
470
+ company_id == o.company_id &&
471
+ belong_tenant_id == o.belong_tenant_id &&
472
+ sales_scope == o.sales_scope &&
473
+ status == o.status &&
474
+ tenant_id == o.tenant_id &&
475
+ environment_type == o.environment_type &&
476
+ created_by == o.created_by &&
477
+ updated_by == o.updated_by &&
478
+ created_at == o.created_at &&
479
+ updated_at == o.updated_at &&
480
+ out_audit_status == o.out_audit_status &&
481
+ factory_type == o.factory_type &&
482
+ audit_status == o.audit_status &&
483
+ division_id == o.division_id &&
484
+ production_capacity == o.production_capacity &&
485
+ quality_certification == o.quality_certification &&
486
+ safety_standard == o.safety_standard &&
487
+ remark == o.remark &&
488
+ company == o.company &&
489
+ company_utility_declarations == o.company_utility_declarations
490
+ end
491
+
492
+ # @see the `==` method
493
+ # @param [Object] Object to be compared
494
+ def eql?(o)
495
+ self == o
496
+ end
497
+
498
+ # Calculates hash code according to all attributes.
499
+ # @return [Integer] Hash code
500
+ def hash
501
+ [id, company_id, belong_tenant_id, sales_scope, status, tenant_id, environment_type, created_by, updated_by, created_at, updated_at, out_audit_status, factory_type, audit_status, division_id, production_capacity, quality_certification, safety_standard, remark, company, company_utility_declarations].hash
502
+ end
503
+
504
+ # Builds the object from hash
505
+ # @param [Hash] attributes Model attributes in the form of hash
506
+ # @return [Object] Returns the model itself
507
+ def self.build_from_hash(attributes)
508
+ return nil unless attributes.is_a?(Hash)
509
+ attributes = attributes.transform_keys(&:to_sym)
510
+ transformed_hash = {}
511
+ openapi_types.each_pair do |key, type|
512
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
513
+ transformed_hash["#{key}"] = nil
514
+ elsif type =~ /\AArray<(.*)>/i
515
+ # check to ensure the input is an array given that the attribute
516
+ # is documented as an array but the input is not
517
+ if attributes[attribute_map[key]].is_a?(Array)
518
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
519
+ end
520
+ elsif !attributes[attribute_map[key]].nil?
521
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
522
+ end
523
+ end
524
+ new(transformed_hash)
525
+ end
526
+
527
+ # Returns the object in the form of hash
528
+ # @return [Hash] Returns the object in the form of hash
529
+ def to_hash
530
+ hash = {}
531
+ self.class.attribute_map.each_pair do |attr, param|
532
+ value = self.send(attr)
533
+ if value.nil?
534
+ is_nullable = self.class.openapi_nullable.include?(attr)
535
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
536
+ end
537
+
538
+ hash[param] = _to_hash(value)
539
+ end
540
+ hash
541
+ end
542
+
543
+ end
544
+
545
+ end