mx-platform-ruby 0.22.0 → 0.22.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -25
  3. data/lib/mx-platform-ruby/api/mx_platform_api.rb +1 -1
  4. data/lib/mx-platform-ruby/api_client.rb +90 -55
  5. data/lib/mx-platform-ruby/api_error.rb +2 -1
  6. data/lib/mx-platform-ruby/configuration.rb +102 -26
  7. data/lib/mx-platform-ruby/models/account_create_request.rb +18 -18
  8. data/lib/mx-platform-ruby/models/account_create_request_body.rb +14 -18
  9. data/lib/mx-platform-ruby/models/account_number_response.rb +14 -18
  10. data/lib/mx-platform-ruby/models/account_numbers_response_body.rb +14 -18
  11. data/lib/mx-platform-ruby/models/account_owner_response.rb +14 -18
  12. data/lib/mx-platform-ruby/models/account_owners_response_body.rb +14 -18
  13. data/lib/mx-platform-ruby/models/account_response.rb +14 -18
  14. data/lib/mx-platform-ruby/models/account_response_body.rb +14 -18
  15. data/lib/mx-platform-ruby/models/account_update_request.rb +14 -18
  16. data/lib/mx-platform-ruby/models/account_update_request_body.rb +14 -18
  17. data/lib/mx-platform-ruby/models/accounts_response_body.rb +14 -18
  18. data/lib/mx-platform-ruby/models/authorization_code_request.rb +14 -18
  19. data/lib/mx-platform-ruby/models/authorization_code_request_body.rb +14 -18
  20. data/lib/mx-platform-ruby/models/authorization_code_response.rb +14 -18
  21. data/lib/mx-platform-ruby/models/authorization_code_response_body.rb +14 -18
  22. data/lib/mx-platform-ruby/models/categories_response_body.rb +14 -18
  23. data/lib/mx-platform-ruby/models/category_create_request.rb +16 -18
  24. data/lib/mx-platform-ruby/models/category_create_request_body.rb +14 -18
  25. data/lib/mx-platform-ruby/models/category_response.rb +14 -18
  26. data/lib/mx-platform-ruby/models/category_response_body.rb +14 -18
  27. data/lib/mx-platform-ruby/models/category_update_request.rb +14 -18
  28. data/lib/mx-platform-ruby/models/category_update_request_body.rb +14 -18
  29. data/lib/mx-platform-ruby/models/challenge_response.rb +14 -18
  30. data/lib/mx-platform-ruby/models/challenges_response_body.rb +14 -18
  31. data/lib/mx-platform-ruby/models/connect_widget_request.rb +14 -18
  32. data/lib/mx-platform-ruby/models/connect_widget_request_body.rb +14 -18
  33. data/lib/mx-platform-ruby/models/connect_widget_response.rb +14 -18
  34. data/lib/mx-platform-ruby/models/connect_widget_response_body.rb +14 -18
  35. data/lib/mx-platform-ruby/models/credential_request.rb +14 -18
  36. data/lib/mx-platform-ruby/models/credential_response.rb +14 -18
  37. data/lib/mx-platform-ruby/models/credentials_response_body.rb +14 -18
  38. data/lib/mx-platform-ruby/models/enhance_transaction_response.rb +14 -18
  39. data/lib/mx-platform-ruby/models/enhance_transactions_request.rb +18 -18
  40. data/lib/mx-platform-ruby/models/enhance_transactions_request_body.rb +14 -18
  41. data/lib/mx-platform-ruby/models/enhance_transactions_response_body.rb +14 -18
  42. data/lib/mx-platform-ruby/models/holding_response.rb +14 -18
  43. data/lib/mx-platform-ruby/models/holding_response_body.rb +14 -18
  44. data/lib/mx-platform-ruby/models/holdings_response_body.rb +14 -18
  45. data/lib/mx-platform-ruby/models/image_option_response.rb +14 -18
  46. data/lib/mx-platform-ruby/models/institution_response.rb +14 -18
  47. data/lib/mx-platform-ruby/models/institution_response_body.rb +14 -18
  48. data/lib/mx-platform-ruby/models/institutions_response_body.rb +14 -18
  49. data/lib/mx-platform-ruby/models/managed_account_create_request.rb +20 -18
  50. data/lib/mx-platform-ruby/models/managed_account_create_request_body.rb +14 -18
  51. data/lib/mx-platform-ruby/models/managed_account_update_request.rb +14 -18
  52. data/lib/mx-platform-ruby/models/managed_account_update_request_body.rb +14 -18
  53. data/lib/mx-platform-ruby/models/managed_member_create_request.rb +16 -18
  54. data/lib/mx-platform-ruby/models/managed_member_create_request_body.rb +14 -18
  55. data/lib/mx-platform-ruby/models/managed_member_update_request.rb +14 -18
  56. data/lib/mx-platform-ruby/models/managed_member_update_request_body.rb +14 -18
  57. data/lib/mx-platform-ruby/models/managed_transaction_create_request.rb +24 -18
  58. data/lib/mx-platform-ruby/models/managed_transaction_create_request_body.rb +14 -18
  59. data/lib/mx-platform-ruby/models/managed_transaction_update_request.rb +14 -18
  60. data/lib/mx-platform-ruby/models/managed_transaction_update_request_body.rb +14 -18
  61. data/lib/mx-platform-ruby/models/member_create_request.rb +18 -18
  62. data/lib/mx-platform-ruby/models/member_create_request_body.rb +14 -18
  63. data/lib/mx-platform-ruby/models/member_response.rb +14 -18
  64. data/lib/mx-platform-ruby/models/member_response_body.rb +14 -18
  65. data/lib/mx-platform-ruby/models/member_resume_request.rb +14 -18
  66. data/lib/mx-platform-ruby/models/member_resume_request_body.rb +14 -18
  67. data/lib/mx-platform-ruby/models/member_status_response.rb +14 -18
  68. data/lib/mx-platform-ruby/models/member_status_response_body.rb +14 -18
  69. data/lib/mx-platform-ruby/models/member_update_request.rb +14 -18
  70. data/lib/mx-platform-ruby/models/member_update_request_body.rb +14 -18
  71. data/lib/mx-platform-ruby/models/members_response_body.rb +14 -18
  72. data/lib/mx-platform-ruby/models/merchant_location_response.rb +14 -18
  73. data/lib/mx-platform-ruby/models/merchant_location_response_body.rb +14 -18
  74. data/lib/mx-platform-ruby/models/merchant_response.rb +14 -18
  75. data/lib/mx-platform-ruby/models/merchant_response_body.rb +14 -18
  76. data/lib/mx-platform-ruby/models/merchants_response_body.rb +14 -18
  77. data/lib/mx-platform-ruby/models/o_auth_window_response.rb +14 -18
  78. data/lib/mx-platform-ruby/models/o_auth_window_response_body.rb +14 -18
  79. data/lib/mx-platform-ruby/models/option_response.rb +14 -18
  80. data/lib/mx-platform-ruby/models/pagination_response.rb +14 -18
  81. data/lib/mx-platform-ruby/models/payment_processor_authorization_code_request.rb +14 -18
  82. data/lib/mx-platform-ruby/models/payment_processor_authorization_code_request_body.rb +14 -18
  83. data/lib/mx-platform-ruby/models/payment_processor_authorization_code_response.rb +14 -18
  84. data/lib/mx-platform-ruby/models/payment_processor_authorization_code_response_body.rb +14 -18
  85. data/lib/mx-platform-ruby/models/spending_plan_account_response.rb +14 -18
  86. data/lib/mx-platform-ruby/models/spending_plan_accounts_response.rb +14 -18
  87. data/lib/mx-platform-ruby/models/spending_plan_iteration_item_create_request_body.rb +16 -18
  88. data/lib/mx-platform-ruby/models/spending_plan_iteration_item_response.rb +14 -18
  89. data/lib/mx-platform-ruby/models/spending_plan_iteration_items_response_body.rb +14 -18
  90. data/lib/mx-platform-ruby/models/spending_plan_iteration_response.rb +14 -18
  91. data/lib/mx-platform-ruby/models/spending_plan_iterations_response.rb +14 -18
  92. data/lib/mx-platform-ruby/models/spending_plan_response.rb +14 -18
  93. data/lib/mx-platform-ruby/models/spending_plans_response_body.rb +14 -18
  94. data/lib/mx-platform-ruby/models/statement_response.rb +14 -18
  95. data/lib/mx-platform-ruby/models/statement_response_body.rb +14 -18
  96. data/lib/mx-platform-ruby/models/statements_response_body.rb +14 -18
  97. data/lib/mx-platform-ruby/models/tag_create_request.rb +16 -18
  98. data/lib/mx-platform-ruby/models/tag_create_request_body.rb +14 -18
  99. data/lib/mx-platform-ruby/models/tag_response.rb +14 -18
  100. data/lib/mx-platform-ruby/models/tag_response_body.rb +14 -18
  101. data/lib/mx-platform-ruby/models/tag_update_request.rb +16 -18
  102. data/lib/mx-platform-ruby/models/tag_update_request_body.rb +14 -18
  103. data/lib/mx-platform-ruby/models/tagging_create_request.rb +18 -18
  104. data/lib/mx-platform-ruby/models/tagging_create_request_body.rb +14 -18
  105. data/lib/mx-platform-ruby/models/tagging_response.rb +14 -18
  106. data/lib/mx-platform-ruby/models/tagging_response_body.rb +14 -18
  107. data/lib/mx-platform-ruby/models/tagging_update_request.rb +16 -18
  108. data/lib/mx-platform-ruby/models/tagging_update_request_body.rb +14 -18
  109. data/lib/mx-platform-ruby/models/taggings_response_body.rb +14 -18
  110. data/lib/mx-platform-ruby/models/tags_response_body.rb +14 -18
  111. data/lib/mx-platform-ruby/models/tax_document_response.rb +14 -18
  112. data/lib/mx-platform-ruby/models/tax_document_response_body.rb +14 -18
  113. data/lib/mx-platform-ruby/models/tax_documents_response_body.rb +14 -18
  114. data/lib/mx-platform-ruby/models/transaction_response.rb +14 -18
  115. data/lib/mx-platform-ruby/models/transaction_response_body.rb +14 -18
  116. data/lib/mx-platform-ruby/models/transaction_rule_create_request.rb +18 -18
  117. data/lib/mx-platform-ruby/models/transaction_rule_create_request_body.rb +14 -18
  118. data/lib/mx-platform-ruby/models/transaction_rule_response.rb +14 -18
  119. data/lib/mx-platform-ruby/models/transaction_rule_response_body.rb +14 -18
  120. data/lib/mx-platform-ruby/models/transaction_rule_update_request.rb +14 -18
  121. data/lib/mx-platform-ruby/models/transaction_rule_update_request_body.rb +14 -18
  122. data/lib/mx-platform-ruby/models/transaction_rules_response_body.rb +14 -18
  123. data/lib/mx-platform-ruby/models/transaction_update_request.rb +16 -18
  124. data/lib/mx-platform-ruby/models/transaction_update_request_body.rb +14 -18
  125. data/lib/mx-platform-ruby/models/transactions_response_body.rb +14 -18
  126. data/lib/mx-platform-ruby/models/user_create_request.rb +14 -18
  127. data/lib/mx-platform-ruby/models/user_create_request_body.rb +14 -18
  128. data/lib/mx-platform-ruby/models/user_response.rb +14 -18
  129. data/lib/mx-platform-ruby/models/user_response_body.rb +14 -18
  130. data/lib/mx-platform-ruby/models/user_update_request.rb +14 -18
  131. data/lib/mx-platform-ruby/models/user_update_request_body.rb +14 -18
  132. data/lib/mx-platform-ruby/models/users_response_body.rb +14 -18
  133. data/lib/mx-platform-ruby/models/widget_request.rb +16 -18
  134. data/lib/mx-platform-ruby/models/widget_request_body.rb +14 -18
  135. data/lib/mx-platform-ruby/models/widget_response.rb +14 -18
  136. data/lib/mx-platform-ruby/models/widget_response_body.rb +14 -18
  137. data/lib/mx-platform-ruby/version.rb +2 -2
  138. data/lib/mx-platform-ruby.rb +1 -1
  139. data/mx-platform-ruby.gemspec +3 -2
  140. data/openapi/config.yml +1 -1
  141. data/openapitools.json +1 -1
  142. data/spec/api/mx_platform_api_spec.rb +114 -114
  143. data/spec/api_client_spec.rb +36 -1
  144. data/spec/configuration_spec.rb +41 -1
  145. data/spec/models/account_create_request_body_spec.rb +2 -2
  146. data/spec/models/account_create_request_spec.rb +22 -22
  147. data/spec/models/account_number_response_spec.rb +10 -10
  148. data/spec/models/account_numbers_response_body_spec.rb +3 -3
  149. data/spec/models/account_owner_response_spec.rb +15 -15
  150. data/spec/models/account_owners_response_body_spec.rb +3 -3
  151. data/spec/models/account_response_body_spec.rb +2 -2
  152. data/spec/models/account_response_spec.rb +57 -57
  153. data/spec/models/account_update_request_body_spec.rb +2 -2
  154. data/spec/models/account_update_request_spec.rb +22 -22
  155. data/spec/models/accounts_response_body_spec.rb +3 -3
  156. data/spec/models/authorization_code_request_body_spec.rb +2 -2
  157. data/spec/models/authorization_code_request_spec.rb +2 -2
  158. data/spec/models/authorization_code_response_body_spec.rb +2 -2
  159. data/spec/models/authorization_code_response_spec.rb +2 -2
  160. data/spec/models/categories_response_body_spec.rb +3 -3
  161. data/spec/models/category_create_request_body_spec.rb +2 -2
  162. data/spec/models/category_create_request_spec.rb +4 -4
  163. data/spec/models/category_response_body_spec.rb +2 -2
  164. data/spec/models/category_response_spec.rb +9 -9
  165. data/spec/models/category_update_request_body_spec.rb +2 -2
  166. data/spec/models/category_update_request_spec.rb +3 -3
  167. data/spec/models/challenge_response_spec.rb +8 -8
  168. data/spec/models/challenges_response_body_spec.rb +3 -3
  169. data/spec/models/connect_widget_request_body_spec.rb +2 -2
  170. data/spec/models/connect_widget_request_spec.rb +15 -15
  171. data/spec/models/connect_widget_response_body_spec.rb +2 -2
  172. data/spec/models/connect_widget_response_spec.rb +3 -3
  173. data/spec/models/credential_request_spec.rb +3 -3
  174. data/spec/models/credential_response_spec.rb +7 -7
  175. data/spec/models/credentials_response_body_spec.rb +3 -3
  176. data/spec/models/enhance_transaction_response_spec.rb +24 -24
  177. data/spec/models/enhance_transactions_request_body_spec.rb +2 -2
  178. data/spec/models/enhance_transactions_request_spec.rb +8 -8
  179. data/spec/models/enhance_transactions_response_body_spec.rb +2 -2
  180. data/spec/models/holding_response_body_spec.rb +2 -2
  181. data/spec/models/holding_response_spec.rb +20 -20
  182. data/spec/models/holdings_response_body_spec.rb +3 -3
  183. data/spec/models/image_option_response_spec.rb +4 -4
  184. data/spec/models/institution_response_body_spec.rb +2 -2
  185. data/spec/models/institution_response_spec.rb +15 -15
  186. data/spec/models/institutions_response_body_spec.rb +3 -3
  187. data/spec/models/managed_account_create_request_body_spec.rb +2 -2
  188. data/spec/models/managed_account_create_request_spec.rb +32 -32
  189. data/spec/models/managed_account_update_request_body_spec.rb +2 -2
  190. data/spec/models/managed_account_update_request_spec.rb +32 -32
  191. data/spec/models/managed_member_create_request_body_spec.rb +2 -2
  192. data/spec/models/managed_member_create_request_spec.rb +5 -5
  193. data/spec/models/managed_member_update_request_body_spec.rb +2 -2
  194. data/spec/models/managed_member_update_request_spec.rb +4 -4
  195. data/spec/models/managed_transaction_create_request_body_spec.rb +2 -2
  196. data/spec/models/managed_transaction_create_request_spec.rb +21 -21
  197. data/spec/models/managed_transaction_update_request_body_spec.rb +2 -2
  198. data/spec/models/managed_transaction_update_request_spec.rb +21 -21
  199. data/spec/models/member_create_request_body_spec.rb +6 -6
  200. data/spec/models/member_create_request_spec.rb +8 -8
  201. data/spec/models/member_response_body_spec.rb +2 -2
  202. data/spec/models/member_response_spec.rb +16 -16
  203. data/spec/models/member_resume_request_body_spec.rb +2 -2
  204. data/spec/models/member_resume_request_spec.rb +2 -2
  205. data/spec/models/member_status_response_body_spec.rb +2 -2
  206. data/spec/models/member_status_response_spec.rb +10 -10
  207. data/spec/models/member_update_request_body_spec.rb +2 -2
  208. data/spec/models/member_update_request_spec.rb +6 -6
  209. data/spec/models/members_response_body_spec.rb +3 -3
  210. data/spec/models/merchant_location_response_body_spec.rb +2 -2
  211. data/spec/models/merchant_location_response_spec.rb +13 -13
  212. data/spec/models/merchant_response_body_spec.rb +2 -2
  213. data/spec/models/merchant_response_spec.rb +7 -7
  214. data/spec/models/merchants_response_body_spec.rb +3 -3
  215. data/spec/models/o_auth_window_response_body_spec.rb +2 -2
  216. data/spec/models/o_auth_window_response_spec.rb +3 -3
  217. data/spec/models/option_response_spec.rb +3 -3
  218. data/spec/models/pagination_response_spec.rb +5 -5
  219. data/spec/models/payment_processor_authorization_code_request_body_spec.rb +2 -2
  220. data/spec/models/payment_processor_authorization_code_request_spec.rb +4 -4
  221. data/spec/models/payment_processor_authorization_code_response_body_spec.rb +2 -2
  222. data/spec/models/payment_processor_authorization_code_response_spec.rb +2 -2
  223. data/spec/models/spending_plan_account_response_spec.rb +8 -8
  224. data/spec/models/spending_plan_accounts_response_spec.rb +3 -3
  225. data/spec/models/spending_plan_iteration_item_create_request_body_spec.rb +6 -6
  226. data/spec/models/spending_plan_iteration_item_response_spec.rb +13 -13
  227. data/spec/models/spending_plan_iteration_items_response_body_spec.rb +3 -3
  228. data/spec/models/spending_plan_iteration_response_spec.rb +9 -9
  229. data/spec/models/spending_plan_iterations_response_spec.rb +3 -3
  230. data/spec/models/spending_plan_response_spec.rb +6 -6
  231. data/spec/models/spending_plans_response_body_spec.rb +3 -3
  232. data/spec/models/statement_response_body_spec.rb +2 -2
  233. data/spec/models/statement_response_spec.rb +9 -9
  234. data/spec/models/statements_response_body_spec.rb +3 -3
  235. data/spec/models/tag_create_request_body_spec.rb +2 -2
  236. data/spec/models/tag_create_request_spec.rb +2 -2
  237. data/spec/models/tag_response_body_spec.rb +2 -2
  238. data/spec/models/tag_response_spec.rb +4 -4
  239. data/spec/models/tag_update_request_body_spec.rb +2 -2
  240. data/spec/models/tag_update_request_spec.rb +2 -2
  241. data/spec/models/tagging_create_request_body_spec.rb +2 -2
  242. data/spec/models/tagging_create_request_spec.rb +3 -3
  243. data/spec/models/tagging_response_body_spec.rb +2 -2
  244. data/spec/models/tagging_response_spec.rb +6 -6
  245. data/spec/models/tagging_update_request_body_spec.rb +2 -2
  246. data/spec/models/tagging_update_request_spec.rb +2 -2
  247. data/spec/models/taggings_response_body_spec.rb +3 -3
  248. data/spec/models/tags_response_body_spec.rb +3 -3
  249. data/spec/models/tax_document_response_body_spec.rb +2 -2
  250. data/spec/models/tax_document_response_spec.rb +11 -11
  251. data/spec/models/tax_documents_response_body_spec.rb +3 -3
  252. data/spec/models/transaction_response_body_spec.rb +2 -2
  253. data/spec/models/transaction_response_spec.rb +44 -44
  254. data/spec/models/transaction_rule_create_request_body_spec.rb +2 -2
  255. data/spec/models/transaction_rule_create_request_spec.rb +4 -4
  256. data/spec/models/transaction_rule_response_body_spec.rb +2 -2
  257. data/spec/models/transaction_rule_response_spec.rb +8 -8
  258. data/spec/models/transaction_rule_update_request_body_spec.rb +2 -2
  259. data/spec/models/transaction_rule_update_request_spec.rb +4 -4
  260. data/spec/models/transaction_rules_response_body_spec.rb +3 -3
  261. data/spec/models/transaction_update_request_body_spec.rb +2 -2
  262. data/spec/models/transaction_update_request_spec.rb +2 -2
  263. data/spec/models/transactions_response_body_spec.rb +3 -3
  264. data/spec/models/user_create_request_body_spec.rb +2 -2
  265. data/spec/models/user_create_request_spec.rb +5 -5
  266. data/spec/models/user_response_body_spec.rb +2 -2
  267. data/spec/models/user_response_spec.rb +6 -6
  268. data/spec/models/user_update_request_body_spec.rb +2 -2
  269. data/spec/models/user_update_request_spec.rb +5 -5
  270. data/spec/models/users_response_body_spec.rb +3 -3
  271. data/spec/models/widget_request_body_spec.rb +2 -2
  272. data/spec/models/widget_request_spec.rb +17 -17
  273. data/spec/models/widget_response_body_spec.rb +2 -2
  274. data/spec/models/widget_response_spec.rb +4 -4
  275. data/spec/spec_helper.rb +1 -1
  276. metadata +132 -118
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -65,6 +65,7 @@ module MxPlatformRuby
65
65
  # Show invalid properties with the reasons. Usually used together with valid?
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
69
  invalid_properties = Array.new
69
70
  invalid_properties
70
71
  end
@@ -72,6 +73,7 @@ module MxPlatformRuby
72
73
  # Check to see if the all the properties in the model are valid
73
74
  # @return true if the model is valid
74
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
77
  true
76
78
  end
77
79
 
@@ -99,36 +101,30 @@ module MxPlatformRuby
99
101
  # @param [Hash] attributes Model attributes in the form of hash
100
102
  # @return [Object] Returns the model itself
101
103
  def self.build_from_hash(attributes)
102
- new.build_from_hash(attributes)
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
104
  return nil unless attributes.is_a?(Hash)
110
- self.class.openapi_types.each_pair do |key, type|
111
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
- self.send("#{key}=", nil)
105
+ attributes = attributes.transform_keys(&:to_sym)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
113
110
  elsif type =~ /\AArray<(.*)>/i
114
111
  # check to ensure the input is an array given that the attribute
115
112
  # is documented as an array but the input is not
116
- if attributes[self.class.attribute_map[key]].is_a?(Array)
117
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
118
115
  end
119
- elsif !attributes[self.class.attribute_map[key]].nil?
120
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
121
118
  end
122
119
  end
123
-
124
- self
120
+ new(transformed_hash)
125
121
  end
126
122
 
127
123
  # Deserializes the data based on type
128
124
  # @param string type Data type
129
125
  # @param string value Value to be deserialized
130
126
  # @return [Object] Deserialized data
131
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
132
128
  case type.to_sym
133
129
  when :Time
134
130
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -73,6 +73,7 @@ module MxPlatformRuby
73
73
  # Show invalid properties with the reasons. Usually used together with valid?
74
74
  # @return Array for valid properties with the reasons
75
75
  def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
77
  invalid_properties = Array.new
77
78
  invalid_properties
78
79
  end
@@ -80,6 +81,7 @@ module MxPlatformRuby
80
81
  # Check to see if the all the properties in the model are valid
81
82
  # @return true if the model is valid
82
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
85
  true
84
86
  end
85
87
 
@@ -108,36 +110,30 @@ module MxPlatformRuby
108
110
  # @param [Hash] attributes Model attributes in the form of hash
109
111
  # @return [Object] Returns the model itself
110
112
  def self.build_from_hash(attributes)
111
- new.build_from_hash(attributes)
112
- end
113
-
114
- # Builds the object from hash
115
- # @param [Hash] attributes Model attributes in the form of hash
116
- # @return [Object] Returns the model itself
117
- def build_from_hash(attributes)
118
113
  return nil unless attributes.is_a?(Hash)
119
- self.class.openapi_types.each_pair do |key, type|
120
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
121
- self.send("#{key}=", nil)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
122
119
  elsif type =~ /\AArray<(.*)>/i
123
120
  # check to ensure the input is an array given that the attribute
124
121
  # is documented as an array but the input is not
125
- if attributes[self.class.attribute_map[key]].is_a?(Array)
126
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
124
  end
128
- elsif !attributes[self.class.attribute_map[key]].nil?
129
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
127
  end
131
128
  end
132
-
133
- self
129
+ new(transformed_hash)
134
130
  end
135
131
 
136
132
  # Deserializes the data based on type
137
133
  # @param string type Data type
138
134
  # @param string value Value to be deserialized
139
135
  # @return [Object] Deserialized data
140
- def _deserialize(type, value)
136
+ def self._deserialize(type, value)
141
137
  case type.to_sym
142
138
  when :Time
143
139
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -65,6 +65,7 @@ module MxPlatformRuby
65
65
  # Show invalid properties with the reasons. Usually used together with valid?
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
69
  invalid_properties = Array.new
69
70
  invalid_properties
70
71
  end
@@ -72,6 +73,7 @@ module MxPlatformRuby
72
73
  # Check to see if the all the properties in the model are valid
73
74
  # @return true if the model is valid
74
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
77
  true
76
78
  end
77
79
 
@@ -99,36 +101,30 @@ module MxPlatformRuby
99
101
  # @param [Hash] attributes Model attributes in the form of hash
100
102
  # @return [Object] Returns the model itself
101
103
  def self.build_from_hash(attributes)
102
- new.build_from_hash(attributes)
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
104
  return nil unless attributes.is_a?(Hash)
110
- self.class.openapi_types.each_pair do |key, type|
111
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
- self.send("#{key}=", nil)
105
+ attributes = attributes.transform_keys(&:to_sym)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
113
110
  elsif type =~ /\AArray<(.*)>/i
114
111
  # check to ensure the input is an array given that the attribute
115
112
  # is documented as an array but the input is not
116
- if attributes[self.class.attribute_map[key]].is_a?(Array)
117
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
118
115
  end
119
- elsif !attributes[self.class.attribute_map[key]].nil?
120
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
121
118
  end
122
119
  end
123
-
124
- self
120
+ new(transformed_hash)
125
121
  end
126
122
 
127
123
  # Deserializes the data based on type
128
124
  # @param string type Data type
129
125
  # @param string value Value to be deserialized
130
126
  # @return [Object] Deserialized data
131
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
132
128
  case type.to_sym
133
129
  when :Time
134
130
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -122,6 +122,7 @@ module MxPlatformRuby
122
122
  # Show invalid properties with the reasons. Usually used together with valid?
123
123
  # @return Array for valid properties with the reasons
124
124
  def list_invalid_properties
125
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
126
  invalid_properties = Array.new
126
127
  invalid_properties
127
128
  end
@@ -129,6 +130,7 @@ module MxPlatformRuby
129
130
  # Check to see if the all the properties in the model are valid
130
131
  # @return true if the model is valid
131
132
  def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
134
  true
133
135
  end
134
136
 
@@ -162,36 +164,30 @@ module MxPlatformRuby
162
164
  # @param [Hash] attributes Model attributes in the form of hash
163
165
  # @return [Object] Returns the model itself
164
166
  def self.build_from_hash(attributes)
165
- new.build_from_hash(attributes)
166
- end
167
-
168
- # Builds the object from hash
169
- # @param [Hash] attributes Model attributes in the form of hash
170
- # @return [Object] Returns the model itself
171
- def build_from_hash(attributes)
172
167
  return nil unless attributes.is_a?(Hash)
173
- self.class.openapi_types.each_pair do |key, type|
174
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
175
- self.send("#{key}=", nil)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
176
173
  elsif type =~ /\AArray<(.*)>/i
177
174
  # check to ensure the input is an array given that the attribute
178
175
  # is documented as an array but the input is not
179
- if attributes[self.class.attribute_map[key]].is_a?(Array)
180
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
178
  end
182
- elsif !attributes[self.class.attribute_map[key]].nil?
183
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
181
  end
185
182
  end
186
-
187
- self
183
+ new(transformed_hash)
188
184
  end
189
185
 
190
186
  # Deserializes the data based on type
191
187
  # @param string type Data type
192
188
  # @param string value Value to be deserialized
193
189
  # @return [Object] Deserialized data
194
- def _deserialize(type, value)
190
+ def self._deserialize(type, value)
195
191
  case type.to_sym
196
192
  when :Time
197
193
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -75,6 +75,7 @@ module MxPlatformRuby
75
75
  # Show invalid properties with the reasons. Usually used together with valid?
76
76
  # @return Array for valid properties with the reasons
77
77
  def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
79
  invalid_properties = Array.new
79
80
  invalid_properties
80
81
  end
@@ -82,6 +83,7 @@ module MxPlatformRuby
82
83
  # Check to see if the all the properties in the model are valid
83
84
  # @return true if the model is valid
84
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
87
  true
86
88
  end
87
89
 
@@ -110,36 +112,30 @@ module MxPlatformRuby
110
112
  # @param [Hash] attributes Model attributes in the form of hash
111
113
  # @return [Object] Returns the model itself
112
114
  def self.build_from_hash(attributes)
113
- new.build_from_hash(attributes)
114
- end
115
-
116
- # Builds the object from hash
117
- # @param [Hash] attributes Model attributes in the form of hash
118
- # @return [Object] Returns the model itself
119
- def build_from_hash(attributes)
120
115
  return nil unless attributes.is_a?(Hash)
121
- self.class.openapi_types.each_pair do |key, type|
122
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
- self.send("#{key}=", nil)
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
124
121
  elsif type =~ /\AArray<(.*)>/i
125
122
  # check to ensure the input is an array given that the attribute
126
123
  # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
129
126
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
132
129
  end
133
130
  end
134
-
135
- self
131
+ new(transformed_hash)
136
132
  end
137
133
 
138
134
  # Deserializes the data based on type
139
135
  # @param string type Data type
140
136
  # @param string value Value to be deserialized
141
137
  # @return [Object] Deserialized data
142
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
143
139
  case type.to_sym
144
140
  when :Time
145
141
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -169,6 +169,7 @@ module MxPlatformRuby
169
169
  # Show invalid properties with the reasons. Usually used together with valid?
170
170
  # @return Array for valid properties with the reasons
171
171
  def list_invalid_properties
172
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
173
  invalid_properties = Array.new
173
174
  invalid_properties
174
175
  end
@@ -176,6 +177,7 @@ module MxPlatformRuby
176
177
  # Check to see if the all the properties in the model are valid
177
178
  # @return true if the model is valid
178
179
  def valid?
180
+ warn '[DEPRECATED] the `valid?` method is obsolete'
179
181
  true
180
182
  end
181
183
 
@@ -216,36 +218,30 @@ module MxPlatformRuby
216
218
  # @param [Hash] attributes Model attributes in the form of hash
217
219
  # @return [Object] Returns the model itself
218
220
  def self.build_from_hash(attributes)
219
- new.build_from_hash(attributes)
220
- end
221
-
222
- # Builds the object from hash
223
- # @param [Hash] attributes Model attributes in the form of hash
224
- # @return [Object] Returns the model itself
225
- def build_from_hash(attributes)
226
221
  return nil unless attributes.is_a?(Hash)
227
- self.class.openapi_types.each_pair do |key, type|
228
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
229
- self.send("#{key}=", nil)
222
+ attributes = attributes.transform_keys(&:to_sym)
223
+ transformed_hash = {}
224
+ openapi_types.each_pair do |key, type|
225
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
226
+ transformed_hash["#{key}"] = nil
230
227
  elsif type =~ /\AArray<(.*)>/i
231
228
  # check to ensure the input is an array given that the attribute
232
229
  # is documented as an array but the input is not
233
- if attributes[self.class.attribute_map[key]].is_a?(Array)
234
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
230
+ if attributes[attribute_map[key]].is_a?(Array)
231
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
235
232
  end
236
- elsif !attributes[self.class.attribute_map[key]].nil?
237
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
233
+ elsif !attributes[attribute_map[key]].nil?
234
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
238
235
  end
239
236
  end
240
-
241
- self
237
+ new(transformed_hash)
242
238
  end
243
239
 
244
240
  # Deserializes the data based on type
245
241
  # @param string type Data type
246
242
  # @param string value Value to be deserialized
247
243
  # @return [Object] Deserialized data
248
- def _deserialize(type, value)
244
+ def self._deserialize(type, value)
249
245
  case type.to_sym
250
246
  when :Time
251
247
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -65,6 +65,7 @@ module MxPlatformRuby
65
65
  # Show invalid properties with the reasons. Usually used together with valid?
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
69
  invalid_properties = Array.new
69
70
  invalid_properties
70
71
  end
@@ -72,6 +73,7 @@ module MxPlatformRuby
72
73
  # Check to see if the all the properties in the model are valid
73
74
  # @return true if the model is valid
74
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
77
  true
76
78
  end
77
79
 
@@ -99,36 +101,30 @@ module MxPlatformRuby
99
101
  # @param [Hash] attributes Model attributes in the form of hash
100
102
  # @return [Object] Returns the model itself
101
103
  def self.build_from_hash(attributes)
102
- new.build_from_hash(attributes)
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
104
  return nil unless attributes.is_a?(Hash)
110
- self.class.openapi_types.each_pair do |key, type|
111
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
- self.send("#{key}=", nil)
105
+ attributes = attributes.transform_keys(&:to_sym)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
113
110
  elsif type =~ /\AArray<(.*)>/i
114
111
  # check to ensure the input is an array given that the attribute
115
112
  # is documented as an array but the input is not
116
- if attributes[self.class.attribute_map[key]].is_a?(Array)
117
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
118
115
  end
119
- elsif !attributes[self.class.attribute_map[key]].nil?
120
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
121
118
  end
122
119
  end
123
-
124
- self
120
+ new(transformed_hash)
125
121
  end
126
122
 
127
123
  # Deserializes the data based on type
128
124
  # @param string type Data type
129
125
  # @param string value Value to be deserialized
130
126
  # @return [Object] Deserialized data
131
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
132
128
  case type.to_sym
133
129
  when :Time
134
130
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -75,6 +75,7 @@ module MxPlatformRuby
75
75
  # Show invalid properties with the reasons. Usually used together with valid?
76
76
  # @return Array for valid properties with the reasons
77
77
  def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
79
  invalid_properties = Array.new
79
80
  invalid_properties
80
81
  end
@@ -82,6 +83,7 @@ module MxPlatformRuby
82
83
  # Check to see if the all the properties in the model are valid
83
84
  # @return true if the model is valid
84
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
87
  true
86
88
  end
87
89
 
@@ -110,36 +112,30 @@ module MxPlatformRuby
110
112
  # @param [Hash] attributes Model attributes in the form of hash
111
113
  # @return [Object] Returns the model itself
112
114
  def self.build_from_hash(attributes)
113
- new.build_from_hash(attributes)
114
- end
115
-
116
- # Builds the object from hash
117
- # @param [Hash] attributes Model attributes in the form of hash
118
- # @return [Object] Returns the model itself
119
- def build_from_hash(attributes)
120
115
  return nil unless attributes.is_a?(Hash)
121
- self.class.openapi_types.each_pair do |key, type|
122
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
- self.send("#{key}=", nil)
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
124
121
  elsif type =~ /\AArray<(.*)>/i
125
122
  # check to ensure the input is an array given that the attribute
126
123
  # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
129
126
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
132
129
  end
133
130
  end
134
-
135
- self
131
+ new(transformed_hash)
136
132
  end
137
133
 
138
134
  # Deserializes the data based on type
139
135
  # @param string type Data type
140
136
  # @param string value Value to be deserialized
141
137
  # @return [Object] Deserialized data
142
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
143
139
  case type.to_sym
144
140
  when :Time
145
141
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -65,6 +65,7 @@ module MxPlatformRuby
65
65
  # Show invalid properties with the reasons. Usually used together with valid?
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
69
  invalid_properties = Array.new
69
70
  invalid_properties
70
71
  end
@@ -72,6 +73,7 @@ module MxPlatformRuby
72
73
  # Check to see if the all the properties in the model are valid
73
74
  # @return true if the model is valid
74
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
77
  true
76
78
  end
77
79
 
@@ -99,36 +101,30 @@ module MxPlatformRuby
99
101
  # @param [Hash] attributes Model attributes in the form of hash
100
102
  # @return [Object] Returns the model itself
101
103
  def self.build_from_hash(attributes)
102
- new.build_from_hash(attributes)
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
104
  return nil unless attributes.is_a?(Hash)
110
- self.class.openapi_types.each_pair do |key, type|
111
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
- self.send("#{key}=", nil)
105
+ attributes = attributes.transform_keys(&:to_sym)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
113
110
  elsif type =~ /\AArray<(.*)>/i
114
111
  # check to ensure the input is an array given that the attribute
115
112
  # is documented as an array but the input is not
116
- if attributes[self.class.attribute_map[key]].is_a?(Array)
117
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
118
115
  end
119
- elsif !attributes[self.class.attribute_map[key]].nil?
120
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
121
118
  end
122
119
  end
123
-
124
- self
120
+ new(transformed_hash)
125
121
  end
126
122
 
127
123
  # Deserializes the data based on type
128
124
  # @param string type Data type
129
125
  # @param string value Value to be deserialized
130
126
  # @return [Object] Deserialized data
131
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
132
128
  case type.to_sym
133
129
  when :Time
134
130
  Time.parse(value)