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,254 @@
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 OrderStageFormDto < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :form_data
21
+
22
+ attr_accessor :status
23
+
24
+ attr_accessor :submitted_at
25
+
26
+ attr_accessor :tenant_id
27
+
28
+ attr_accessor :file_type
29
+
30
+ attr_accessor :file_url
31
+
32
+ attr_accessor :anaysis_status
33
+
34
+ attr_accessor :is_ai_anaysis_flag
35
+
36
+ attr_accessor :is_operated
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'form_data' => :'formData',
43
+ :'status' => :'status',
44
+ :'submitted_at' => :'submittedAt',
45
+ :'tenant_id' => :'tenantId',
46
+ :'file_type' => :'fileType',
47
+ :'file_url' => :'fileUrl',
48
+ :'anaysis_status' => :'anaysisStatus',
49
+ :'is_ai_anaysis_flag' => :'isAiAnaysisFlag',
50
+ :'is_operated' => :'isOperated'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'id' => :'String',
68
+ :'form_data' => :'String',
69
+ :'status' => :'Integer',
70
+ :'submitted_at' => :'Time',
71
+ :'tenant_id' => :'String',
72
+ :'file_type' => :'String',
73
+ :'file_url' => :'String',
74
+ :'anaysis_status' => :'String',
75
+ :'is_ai_anaysis_flag' => :'Boolean',
76
+ :'is_operated' => :'Boolean'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ :'id',
84
+ :'status',
85
+ :'submitted_at',
86
+ :'tenant_id',
87
+ :'file_type',
88
+ :'file_url',
89
+ :'anaysis_status',
90
+ :'is_ai_anaysis_flag',
91
+ :'is_operated'
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::OrderStageFormDto` 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::OrderStageFormDto`. 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?(:'id')
112
+ self.id = attributes[:'id']
113
+ end
114
+
115
+ if attributes.key?(:'form_data')
116
+ self.form_data = attributes[:'form_data']
117
+ else
118
+ self.form_data = nil
119
+ end
120
+
121
+ if attributes.key?(:'status')
122
+ self.status = attributes[:'status']
123
+ end
124
+
125
+ if attributes.key?(:'submitted_at')
126
+ self.submitted_at = attributes[:'submitted_at']
127
+ end
128
+
129
+ if attributes.key?(:'tenant_id')
130
+ self.tenant_id = attributes[:'tenant_id']
131
+ end
132
+
133
+ if attributes.key?(:'file_type')
134
+ self.file_type = attributes[:'file_type']
135
+ end
136
+
137
+ if attributes.key?(:'file_url')
138
+ self.file_url = attributes[:'file_url']
139
+ end
140
+
141
+ if attributes.key?(:'anaysis_status')
142
+ self.anaysis_status = attributes[:'anaysis_status']
143
+ end
144
+
145
+ if attributes.key?(:'is_ai_anaysis_flag')
146
+ self.is_ai_anaysis_flag = attributes[:'is_ai_anaysis_flag']
147
+ end
148
+
149
+ if attributes.key?(:'is_operated')
150
+ self.is_operated = attributes[:'is_operated']
151
+ end
152
+ end
153
+
154
+ # Show invalid properties with the reasons. Usually used together with valid?
155
+ # @return Array for valid properties with the reasons
156
+ def list_invalid_properties
157
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
158
+ invalid_properties = Array.new
159
+ if @form_data.nil?
160
+ invalid_properties.push('invalid value for "form_data", form_data cannot be nil.')
161
+ end
162
+
163
+ invalid_properties
164
+ end
165
+
166
+ # Check to see if the all the properties in the model are valid
167
+ # @return true if the model is valid
168
+ def valid?
169
+ warn '[DEPRECATED] the `valid?` method is obsolete'
170
+ return false if @form_data.nil?
171
+ true
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] form_data Value to be assigned
176
+ def form_data=(form_data)
177
+ if form_data.nil?
178
+ fail ArgumentError, 'form_data cannot be nil'
179
+ end
180
+
181
+ @form_data = form_data
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ id == o.id &&
190
+ form_data == o.form_data &&
191
+ status == o.status &&
192
+ submitted_at == o.submitted_at &&
193
+ tenant_id == o.tenant_id &&
194
+ file_type == o.file_type &&
195
+ file_url == o.file_url &&
196
+ anaysis_status == o.anaysis_status &&
197
+ is_ai_anaysis_flag == o.is_ai_anaysis_flag &&
198
+ is_operated == o.is_operated
199
+ end
200
+
201
+ # @see the `==` method
202
+ # @param [Object] Object to be compared
203
+ def eql?(o)
204
+ self == o
205
+ end
206
+
207
+ # Calculates hash code according to all attributes.
208
+ # @return [Integer] Hash code
209
+ def hash
210
+ [id, form_data, status, submitted_at, tenant_id, file_type, file_url, anaysis_status, is_ai_anaysis_flag, is_operated].hash
211
+ end
212
+
213
+ # Builds the object from hash
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @return [Object] Returns the model itself
216
+ def self.build_from_hash(attributes)
217
+ return nil unless attributes.is_a?(Hash)
218
+ attributes = attributes.transform_keys(&:to_sym)
219
+ transformed_hash = {}
220
+ openapi_types.each_pair do |key, type|
221
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
222
+ transformed_hash["#{key}"] = nil
223
+ elsif type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[attribute_map[key]].is_a?(Array)
227
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
228
+ end
229
+ elsif !attributes[attribute_map[key]].nil?
230
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
231
+ end
232
+ end
233
+ new(transformed_hash)
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ end
253
+
254
+ end
@@ -0,0 +1,296 @@
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 PagedResponseDeliveryNoteApiDto < ApiModelBase
18
+ attr_accessor :code
19
+
20
+ attr_accessor :message
21
+
22
+ attr_accessor :data
23
+
24
+ attr_accessor :page_index
25
+
26
+ attr_accessor :page_size
27
+
28
+ attr_accessor :total_count
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'code' => :'code',
34
+ :'message' => :'message',
35
+ :'data' => :'data',
36
+ :'page_index' => :'pageIndex',
37
+ :'page_size' => :'pageSize',
38
+ :'total_count' => :'totalCount'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'code' => :'Integer',
56
+ :'message' => :'String',
57
+ :'data' => :'Array<DeliveryNoteApiDto>',
58
+ :'page_index' => :'Integer',
59
+ :'page_size' => :'Integer',
60
+ :'total_count' => :'Integer'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::PagedResponseDeliveryNoteApiDto` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::PagedResponseDeliveryNoteApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'code')
87
+ self.code = attributes[:'code']
88
+ else
89
+ self.code = nil
90
+ end
91
+
92
+ if attributes.key?(:'message')
93
+ self.message = attributes[:'message']
94
+ else
95
+ self.message = nil
96
+ end
97
+
98
+ if attributes.key?(:'data')
99
+ if (value = attributes[:'data']).is_a?(Array)
100
+ self.data = value
101
+ end
102
+ else
103
+ self.data = nil
104
+ end
105
+
106
+ if attributes.key?(:'page_index')
107
+ self.page_index = attributes[:'page_index']
108
+ else
109
+ self.page_index = nil
110
+ end
111
+
112
+ if attributes.key?(:'page_size')
113
+ self.page_size = attributes[:'page_size']
114
+ else
115
+ self.page_size = nil
116
+ end
117
+
118
+ if attributes.key?(:'total_count')
119
+ self.total_count = attributes[:'total_count']
120
+ else
121
+ self.total_count = nil
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @code.nil?
131
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
132
+ end
133
+
134
+ if @message.nil?
135
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
136
+ end
137
+
138
+ if @data.nil?
139
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
140
+ end
141
+
142
+ if @page_index.nil?
143
+ invalid_properties.push('invalid value for "page_index", page_index cannot be nil.')
144
+ end
145
+
146
+ if @page_size.nil?
147
+ invalid_properties.push('invalid value for "page_size", page_size cannot be nil.')
148
+ end
149
+
150
+ if @total_count.nil?
151
+ invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
152
+ end
153
+
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
+ return false if @code.nil?
162
+ return false if @message.nil?
163
+ return false if @data.nil?
164
+ return false if @page_index.nil?
165
+ return false if @page_size.nil?
166
+ return false if @total_count.nil?
167
+ true
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] code Value to be assigned
172
+ def code=(code)
173
+ if code.nil?
174
+ fail ArgumentError, 'code cannot be nil'
175
+ end
176
+
177
+ @code = code
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] message Value to be assigned
182
+ def message=(message)
183
+ if message.nil?
184
+ fail ArgumentError, 'message cannot be nil'
185
+ end
186
+
187
+ @message = message
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] data Value to be assigned
192
+ def data=(data)
193
+ if data.nil?
194
+ fail ArgumentError, 'data cannot be nil'
195
+ end
196
+
197
+ @data = data
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] page_index Value to be assigned
202
+ def page_index=(page_index)
203
+ if page_index.nil?
204
+ fail ArgumentError, 'page_index cannot be nil'
205
+ end
206
+
207
+ @page_index = page_index
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] page_size Value to be assigned
212
+ def page_size=(page_size)
213
+ if page_size.nil?
214
+ fail ArgumentError, 'page_size cannot be nil'
215
+ end
216
+
217
+ @page_size = page_size
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] total_count Value to be assigned
222
+ def total_count=(total_count)
223
+ if total_count.nil?
224
+ fail ArgumentError, 'total_count cannot be nil'
225
+ end
226
+
227
+ @total_count = total_count
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ code == o.code &&
236
+ message == o.message &&
237
+ data == o.data &&
238
+ page_index == o.page_index &&
239
+ page_size == o.page_size &&
240
+ total_count == o.total_count
241
+ end
242
+
243
+ # @see the `==` method
244
+ # @param [Object] Object to be compared
245
+ def eql?(o)
246
+ self == o
247
+ end
248
+
249
+ # Calculates hash code according to all attributes.
250
+ # @return [Integer] Hash code
251
+ def hash
252
+ [code, message, data, page_index, page_size, total_count].hash
253
+ end
254
+
255
+ # Builds the object from hash
256
+ # @param [Hash] attributes Model attributes in the form of hash
257
+ # @return [Object] Returns the model itself
258
+ def self.build_from_hash(attributes)
259
+ return nil unless attributes.is_a?(Hash)
260
+ attributes = attributes.transform_keys(&:to_sym)
261
+ transformed_hash = {}
262
+ openapi_types.each_pair do |key, type|
263
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
264
+ transformed_hash["#{key}"] = nil
265
+ elsif type =~ /\AArray<(.*)>/i
266
+ # check to ensure the input is an array given that the attribute
267
+ # is documented as an array but the input is not
268
+ if attributes[attribute_map[key]].is_a?(Array)
269
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
270
+ end
271
+ elsif !attributes[attribute_map[key]].nil?
272
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
273
+ end
274
+ end
275
+ new(transformed_hash)
276
+ end
277
+
278
+ # Returns the object in the form of hash
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_hash
281
+ hash = {}
282
+ self.class.attribute_map.each_pair do |attr, param|
283
+ value = self.send(attr)
284
+ if value.nil?
285
+ is_nullable = self.class.openapi_nullable.include?(attr)
286
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
+ end
288
+
289
+ hash[param] = _to_hash(value)
290
+ end
291
+ hash
292
+ end
293
+
294
+ end
295
+
296
+ end