talon_one 7.0.0 → 9.0.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 (360) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -12
  3. data/docs/Achievement.md +6 -4
  4. data/docs/AchievementAdditionalProperties.md +5 -3
  5. data/docs/AchievementBase.md +35 -0
  6. data/docs/AchievementProgress.md +3 -15
  7. data/docs/AchievementProgressWithDefinition.md +45 -0
  8. data/docs/AchievementStatusEntry.md +45 -0
  9. data/docs/AddFreeItemEffectProps.md +3 -1
  10. data/docs/AdditionalCampaignProperties.md +4 -2
  11. data/docs/AnalyticsProduct.md +6 -6
  12. data/docs/AnalyticsSKU.md +23 -0
  13. data/docs/ApplicationCIF.md +1 -1
  14. data/docs/ApplicationCIFExpression.md +1 -1
  15. data/docs/ApplicationCIFReferences.md +19 -0
  16. data/docs/ApplicationEntity.md +1 -1
  17. data/docs/ApplicationEvent.md +1 -1
  18. data/docs/ApplicationReferee.md +1 -1
  19. data/docs/ApplicationSession.md +2 -2
  20. data/docs/Audience.md +1 -1
  21. data/docs/BaseLoyaltyProgram.md +1 -1
  22. data/docs/Binding.md +1 -1
  23. data/docs/Campaign.md +4 -2
  24. data/docs/CampaignDetail.md +19 -0
  25. data/docs/CampaignEvaluationGroup.md +1 -1
  26. data/docs/CampaignNotificationPolicy.md +3 -1
  27. data/docs/CampaignSet.md +1 -1
  28. data/docs/CampaignStoreBudget.md +1 -1
  29. data/docs/CampaignStoreBudgetLimitConfig.md +25 -0
  30. data/docs/CampaignTemplate.md +3 -1
  31. data/docs/CardExpiringPointsNotificationPolicy.md +3 -1
  32. data/docs/CatalogsStrikethroughNotificationPolicy.md +3 -1
  33. data/docs/CouponCreationJob.md +1 -1
  34. data/docs/CouponDeletionJob.md +1 -1
  35. data/docs/CouponsNotificationPolicy.md +5 -1
  36. data/docs/CreateAchievement.md +1 -1
  37. data/docs/CustomerInventory.md +1 -1
  38. data/docs/CustomerSession.md +1 -1
  39. data/docs/CustomerSessionV2.md +2 -4
  40. data/docs/Environment.md +1 -1
  41. data/docs/Event.md +1 -1
  42. data/docs/ExpiringCouponsNotificationPolicy.md +3 -1
  43. data/docs/ExpiringPointsNotificationPolicy.md +3 -1
  44. data/docs/HiddenConditionsEffects.md +23 -0
  45. data/docs/InlineResponse2001.md +3 -3
  46. data/docs/InlineResponse20010.md +3 -3
  47. data/docs/InlineResponse20011.md +3 -3
  48. data/docs/InlineResponse20012.md +1 -1
  49. data/docs/InlineResponse20013.md +1 -1
  50. data/docs/InlineResponse20014.md +1 -1
  51. data/docs/InlineResponse20015.md +3 -3
  52. data/docs/InlineResponse20016.md +3 -3
  53. data/docs/InlineResponse20017.md +3 -5
  54. data/docs/InlineResponse20018.md +2 -2
  55. data/docs/InlineResponse20019.md +3 -3
  56. data/docs/InlineResponse2002.md +3 -3
  57. data/docs/InlineResponse20020.md +5 -3
  58. data/docs/InlineResponse20021.md +3 -5
  59. data/docs/InlineResponse20022.md +2 -4
  60. data/docs/InlineResponse20023.md +3 -5
  61. data/docs/InlineResponse20024.md +5 -3
  62. data/docs/InlineResponse20025.md +4 -2
  63. data/docs/InlineResponse20026.md +3 -1
  64. data/docs/InlineResponse20027.md +1 -1
  65. data/docs/InlineResponse20028.md +3 -3
  66. data/docs/InlineResponse20029.md +1 -3
  67. data/docs/InlineResponse2003.md +1 -1
  68. data/docs/InlineResponse20030.md +2 -2
  69. data/docs/InlineResponse20031.md +3 -3
  70. data/docs/InlineResponse20032.md +1 -1
  71. data/docs/InlineResponse20033.md +3 -3
  72. data/docs/InlineResponse20034.md +1 -3
  73. data/docs/InlineResponse20035.md +5 -3
  74. data/docs/InlineResponse20036.md +1 -1
  75. data/docs/InlineResponse20037.md +5 -3
  76. data/docs/InlineResponse20038.md +1 -1
  77. data/docs/InlineResponse20039.md +1 -1
  78. data/docs/InlineResponse2004.md +1 -1
  79. data/docs/InlineResponse20040.md +1 -1
  80. data/docs/InlineResponse20041.md +2 -4
  81. data/docs/InlineResponse20042.md +1 -1
  82. data/docs/InlineResponse20043.md +1 -1
  83. data/docs/InlineResponse20044.md +4 -4
  84. data/docs/InlineResponse20045.md +3 -3
  85. data/docs/InlineResponse20046.md +3 -3
  86. data/docs/InlineResponse20047.md +5 -3
  87. data/docs/InlineResponse20048.md +19 -0
  88. data/docs/InlineResponse20049.md +19 -0
  89. data/docs/InlineResponse2005.md +3 -3
  90. data/docs/InlineResponse2006.md +3 -3
  91. data/docs/InlineResponse2007.md +1 -1
  92. data/docs/InlineResponse2008.md +1 -1
  93. data/docs/InlineResponse2009.md +3 -3
  94. data/docs/IntegrationApi.md +159 -19
  95. data/docs/LedgerInfo.md +4 -0
  96. data/docs/LedgerTransactionLogEntryIntegrationAPI.md +3 -1
  97. data/docs/LimitCounter.md +1 -1
  98. data/docs/LoyaltyBalance.md +3 -1
  99. data/docs/LoyaltyBalanceWithTier.md +2 -0
  100. data/docs/LoyaltyBalances.md +1 -1
  101. data/docs/LoyaltyBalancesWithTiers.md +1 -1
  102. data/docs/LoyaltyCardBalances.md +1 -1
  103. data/docs/LoyaltyLedger.md +1 -1
  104. data/docs/LoyaltyLedgerEntry.md +3 -1
  105. data/docs/LoyaltyLedgerEntryFlags.md +17 -0
  106. data/docs/LoyaltyProgram.md +1 -1
  107. data/docs/LoyaltyProgramBalance.md +5 -1
  108. data/docs/LoyaltyProgramTransaction.md +3 -1
  109. data/docs/LoyaltySubLedger.md +2 -0
  110. data/docs/ManagementApi.md +345 -436
  111. data/docs/ManagementKey.md +3 -1
  112. data/docs/MessageTest.md +27 -0
  113. data/docs/ModelReturn.md +1 -1
  114. data/docs/NewAudience.md +1 -1
  115. data/docs/NewCampaignSet.md +1 -1
  116. data/docs/NewLoyaltyProgram.md +1 -1
  117. data/docs/NewManagementKey.md +2 -0
  118. data/docs/NewMessageTest.md +29 -0
  119. data/docs/PendingPointsNotificationPolicy.md +3 -1
  120. data/docs/ProductSearchMatch.md +2 -2
  121. data/docs/ProductUnitAnalytics.md +4 -10
  122. data/docs/ProductUnitAnalyticsDataPoint.md +25 -0
  123. data/docs/ProductUnitAnalyticsTotals.md +17 -0
  124. data/docs/SkuUnitAnalytics.md +19 -0
  125. data/docs/SkuUnitAnalyticsDataPoint.md +23 -0
  126. data/docs/Store.md +1 -1
  127. data/docs/StrikethroughEffect.md +5 -1
  128. data/docs/StrikethroughLabelingNotification.md +6 -2
  129. data/docs/SummaryCampaignStoreBudget.md +3 -1
  130. data/docs/TemplateDef.md +1 -1
  131. data/docs/TierDowngradeNotificationPolicy.md +3 -1
  132. data/docs/TierUpgradeNotificationPolicy.md +3 -1
  133. data/docs/TierWillDowngradeNotificationPolicy.md +2 -0
  134. data/docs/UpdateAchievement.md +2 -2
  135. data/docs/UpdateLoyaltyProgram.md +1 -1
  136. data/lib/talon_one/api/integration_api.rb +223 -29
  137. data/lib/talon_one/api/management_api.rb +434 -518
  138. data/lib/talon_one/models/achievement.rb +27 -15
  139. data/lib/talon_one/models/achievement_additional_properties.rb +49 -10
  140. data/lib/talon_one/models/achievement_base.rb +377 -0
  141. data/lib/talon_one/models/achievement_progress.rb +4 -137
  142. data/lib/talon_one/models/achievement_progress_with_definition.rb +490 -0
  143. data/lib/talon_one/models/achievement_status_entry.rb +472 -0
  144. data/lib/talon_one/models/add_free_item_effect_props.rb +14 -4
  145. data/lib/talon_one/models/additional_campaign_properties.rb +16 -9
  146. data/lib/talon_one/models/analytics_product.rb +20 -21
  147. data/lib/talon_one/models/analytics_sku.rb +246 -0
  148. data/lib/talon_one/models/application_api_key.rb +2 -2
  149. data/lib/talon_one/models/application_cif.rb +1 -1
  150. data/lib/talon_one/models/application_cif_expression.rb +1 -1
  151. data/lib/talon_one/models/application_cif_references.rb +219 -0
  152. data/lib/talon_one/models/application_entity.rb +1 -1
  153. data/lib/talon_one/models/application_event.rb +1 -1
  154. data/lib/talon_one/models/application_referee.rb +1 -1
  155. data/lib/talon_one/models/application_session.rb +2 -2
  156. data/lib/talon_one/models/audience.rb +1 -1
  157. data/lib/talon_one/models/base_loyalty_program.rb +3 -3
  158. data/lib/talon_one/models/campaign.rb +14 -7
  159. data/lib/talon_one/models/campaign_detail.rb +232 -0
  160. data/lib/talon_one/models/campaign_evaluation_group.rb +1 -1
  161. data/lib/talon_one/models/campaign_notification_policy.rb +14 -4
  162. data/lib/talon_one/models/campaign_set.rb +1 -1
  163. data/lib/talon_one/models/campaign_store_budget.rb +1 -1
  164. data/lib/talon_one/models/campaign_store_budget_limit_config.rb +322 -0
  165. data/lib/talon_one/models/campaign_template.rb +16 -4
  166. data/lib/talon_one/models/card_expiring_points_notification_policy.rb +14 -4
  167. data/lib/talon_one/models/catalogs_strikethrough_notification_policy.rb +38 -4
  168. data/lib/talon_one/models/coupon_creation_job.rb +1 -1
  169. data/lib/talon_one/models/coupon_deletion_job.rb +1 -1
  170. data/lib/talon_one/models/coupons_notification_policy.rb +24 -4
  171. data/lib/talon_one/models/create_achievement.rb +0 -5
  172. data/lib/talon_one/models/create_application_api_key.rb +2 -2
  173. data/lib/talon_one/models/customer_inventory.rb +1 -1
  174. data/lib/talon_one/models/customer_session.rb +1 -1
  175. data/lib/talon_one/models/customer_session_v2.rb +5 -15
  176. data/lib/talon_one/models/delete_user_request.rb +0 -1
  177. data/lib/talon_one/models/environment.rb +1 -1
  178. data/lib/talon_one/models/event.rb +1 -1
  179. data/lib/talon_one/models/expiring_coupons_notification_policy.rb +14 -4
  180. data/lib/talon_one/models/expiring_points_notification_policy.rb +14 -4
  181. data/lib/talon_one/models/hidden_conditions_effects.rb +246 -0
  182. data/lib/talon_one/models/inline_response2001.rb +11 -11
  183. data/lib/talon_one/models/inline_response20010.rb +11 -11
  184. data/lib/talon_one/models/inline_response20011.rb +11 -11
  185. data/lib/talon_one/models/inline_response20012.rb +1 -1
  186. data/lib/talon_one/models/inline_response20013.rb +1 -1
  187. data/lib/talon_one/models/inline_response20014.rb +1 -1
  188. data/lib/talon_one/models/inline_response20015.rb +11 -11
  189. data/lib/talon_one/models/inline_response20016.rb +11 -13
  190. data/lib/talon_one/models/inline_response20017.rb +7 -11
  191. data/lib/talon_one/models/inline_response20018.rb +1 -1
  192. data/lib/talon_one/models/inline_response20019.rb +3 -1
  193. data/lib/talon_one/models/inline_response2002.rb +11 -11
  194. data/lib/talon_one/models/inline_response20020.rb +11 -7
  195. data/lib/talon_one/models/inline_response20021.rb +7 -11
  196. data/lib/talon_one/models/inline_response20022.rb +7 -11
  197. data/lib/talon_one/models/inline_response20023.rb +7 -11
  198. data/lib/talon_one/models/inline_response20024.rb +11 -7
  199. data/lib/talon_one/models/inline_response20025.rb +11 -7
  200. data/lib/talon_one/models/inline_response20026.rb +11 -2
  201. data/lib/talon_one/models/inline_response20027.rb +1 -1
  202. data/lib/talon_one/models/inline_response20028.rb +11 -11
  203. data/lib/talon_one/models/inline_response20029.rb +2 -11
  204. data/lib/talon_one/models/inline_response2003.rb +1 -1
  205. data/lib/talon_one/models/inline_response20030.rb +6 -1
  206. data/lib/talon_one/models/inline_response20031.rb +13 -8
  207. data/lib/talon_one/models/inline_response20032.rb +1 -1
  208. data/lib/talon_one/models/inline_response20033.rb +8 -13
  209. data/lib/talon_one/models/inline_response20034.rb +2 -11
  210. data/lib/talon_one/models/inline_response20035.rb +11 -7
  211. data/lib/talon_one/models/inline_response20036.rb +1 -1
  212. data/lib/talon_one/models/inline_response20037.rb +11 -7
  213. data/lib/talon_one/models/inline_response20038.rb +1 -1
  214. data/lib/talon_one/models/inline_response20039.rb +1 -1
  215. data/lib/talon_one/models/inline_response2004.rb +1 -1
  216. data/lib/talon_one/models/inline_response20040.rb +1 -1
  217. data/lib/talon_one/models/inline_response20041.rb +7 -11
  218. data/lib/talon_one/models/inline_response20042.rb +1 -1
  219. data/lib/talon_one/models/inline_response20043.rb +1 -1
  220. data/lib/talon_one/models/inline_response20044.rb +11 -11
  221. data/lib/talon_one/models/inline_response20045.rb +13 -8
  222. data/lib/talon_one/models/inline_response20046.rb +11 -11
  223. data/lib/talon_one/models/inline_response20047.rb +11 -7
  224. data/lib/talon_one/models/inline_response20048.rb +222 -0
  225. data/lib/talon_one/models/inline_response20049.rb +227 -0
  226. data/lib/talon_one/models/inline_response2005.rb +11 -11
  227. data/lib/talon_one/models/inline_response2006.rb +11 -11
  228. data/lib/talon_one/models/inline_response2007.rb +1 -1
  229. data/lib/talon_one/models/inline_response2008.rb +1 -1
  230. data/lib/talon_one/models/inline_response2009.rb +11 -11
  231. data/lib/talon_one/models/ledger_info.rb +31 -1
  232. data/lib/talon_one/models/ledger_transaction_log_entry_integration_api.rb +13 -4
  233. data/lib/talon_one/models/limit_counter.rb +1 -1
  234. data/lib/talon_one/models/loyalty_balance.rb +14 -4
  235. data/lib/talon_one/models/loyalty_balance_with_tier.rb +11 -1
  236. data/lib/talon_one/models/loyalty_ledger_entry.rb +13 -4
  237. data/lib/talon_one/models/loyalty_ledger_entry_flags.rb +208 -0
  238. data/lib/talon_one/models/loyalty_program.rb +3 -3
  239. data/lib/talon_one/models/loyalty_program_balance.rb +34 -4
  240. data/lib/talon_one/models/loyalty_program_transaction.rb +13 -4
  241. data/lib/talon_one/models/loyalty_sub_ledger.rb +16 -1
  242. data/lib/talon_one/models/management_key.rb +14 -4
  243. data/lib/talon_one/models/message_test.rb +227 -0
  244. data/lib/talon_one/models/model_return.rb +1 -1
  245. data/lib/talon_one/models/new_application_api_key.rb +2 -2
  246. data/lib/talon_one/models/new_audience.rb +1 -1
  247. data/lib/talon_one/models/new_campaign_set.rb +1 -1
  248. data/lib/talon_one/models/new_loyalty_program.rb +3 -3
  249. data/lib/talon_one/models/new_management_key.rb +11 -1
  250. data/lib/talon_one/models/new_message_test.rb +322 -0
  251. data/lib/talon_one/models/pending_points_notification_policy.rb +14 -4
  252. data/lib/talon_one/models/product.rb +0 -19
  253. data/lib/talon_one/models/product_search_match.rb +1 -6
  254. data/lib/talon_one/models/product_unit_analytics.rb +21 -65
  255. data/lib/talon_one/models/product_unit_analytics_data_point.rb +271 -0
  256. data/lib/talon_one/models/product_unit_analytics_totals.rb +206 -0
  257. data/lib/talon_one/models/sku_unit_analytics.rb +227 -0
  258. data/lib/talon_one/models/sku_unit_analytics_data_point.rb +256 -0
  259. data/lib/talon_one/models/store.rb +1 -1
  260. data/lib/talon_one/models/strikethrough_effect.rb +24 -4
  261. data/lib/talon_one/models/strikethrough_labeling_notification.rb +56 -2
  262. data/lib/talon_one/models/summary_campaign_store_budget.rb +18 -4
  263. data/lib/talon_one/models/template_def.rb +1 -1
  264. data/lib/talon_one/models/tier_downgrade_notification_policy.rb +14 -4
  265. data/lib/talon_one/models/tier_upgrade_notification_policy.rb +14 -4
  266. data/lib/talon_one/models/tier_will_downgrade_notification_policy.rb +11 -1
  267. data/lib/talon_one/models/update_achievement.rb +2 -2
  268. data/lib/talon_one/models/update_loyalty_program.rb +3 -3
  269. data/lib/talon_one/version.rb +1 -1
  270. data/lib/talon_one.rb +20 -5
  271. data/spec/api/integration_api_spec.rb +46 -9
  272. data/spec/api/management_api_spec.rb +132 -144
  273. data/spec/models/achievement_additional_properties_spec.rb +10 -0
  274. data/spec/models/achievement_base_spec.rb +103 -0
  275. data/spec/models/achievement_progress_spec.rb +1 -37
  276. data/spec/models/achievement_progress_with_definition_spec.rb +137 -0
  277. data/spec/models/achievement_spec.rb +10 -0
  278. data/spec/models/achievement_status_entry_spec.rb +137 -0
  279. data/spec/models/add_free_item_effect_props_spec.rb +6 -0
  280. data/spec/models/additional_campaign_properties_spec.rb +6 -0
  281. data/spec/models/analytics_product_spec.rb +3 -3
  282. data/spec/models/analytics_sku_spec.rb +59 -0
  283. data/spec/models/application_api_key_spec.rb +1 -1
  284. data/spec/models/application_cif_references_spec.rb +47 -0
  285. data/spec/models/base_loyalty_program_spec.rb +1 -1
  286. data/spec/models/campaign_detail_spec.rb +47 -0
  287. data/spec/models/campaign_notification_policy_spec.rb +6 -0
  288. data/spec/models/campaign_spec.rb +6 -0
  289. data/spec/models/campaign_store_budget_limit_config_spec.rb +73 -0
  290. data/spec/models/campaign_template_spec.rb +6 -0
  291. data/spec/models/card_expiring_points_notification_policy_spec.rb +6 -0
  292. data/spec/models/catalogs_strikethrough_notification_policy_spec.rb +6 -0
  293. data/spec/models/coupons_notification_policy_spec.rb +12 -0
  294. data/spec/models/create_application_api_key_spec.rb +1 -1
  295. data/spec/models/customer_session_v2_spec.rb +0 -6
  296. data/spec/models/expiring_coupons_notification_policy_spec.rb +6 -0
  297. data/spec/models/expiring_points_notification_policy_spec.rb +6 -0
  298. data/spec/models/hidden_conditions_effects_spec.rb +59 -0
  299. data/spec/models/inline_response20010_spec.rb +1 -1
  300. data/spec/models/inline_response20011_spec.rb +1 -1
  301. data/spec/models/inline_response20015_spec.rb +1 -1
  302. data/spec/models/inline_response20016_spec.rb +1 -1
  303. data/spec/models/inline_response20017_spec.rb +0 -6
  304. data/spec/models/inline_response2001_spec.rb +1 -1
  305. data/spec/models/inline_response20020_spec.rb +6 -0
  306. data/spec/models/inline_response20021_spec.rb +0 -6
  307. data/spec/models/inline_response20022_spec.rb +0 -6
  308. data/spec/models/inline_response20023_spec.rb +0 -6
  309. data/spec/models/inline_response20024_spec.rb +6 -0
  310. data/spec/models/inline_response20025_spec.rb +6 -0
  311. data/spec/models/inline_response20026_spec.rb +6 -0
  312. data/spec/models/inline_response20028_spec.rb +1 -1
  313. data/spec/models/inline_response20029_spec.rb +0 -6
  314. data/spec/models/inline_response2002_spec.rb +1 -1
  315. data/spec/models/inline_response20031_spec.rb +1 -1
  316. data/spec/models/inline_response20033_spec.rb +1 -1
  317. data/spec/models/inline_response20034_spec.rb +0 -6
  318. data/spec/models/inline_response20035_spec.rb +6 -0
  319. data/spec/models/inline_response20037_spec.rb +6 -0
  320. data/spec/models/inline_response20041_spec.rb +0 -6
  321. data/spec/models/inline_response20044_spec.rb +2 -2
  322. data/spec/models/inline_response20045_spec.rb +1 -1
  323. data/spec/models/inline_response20046_spec.rb +1 -1
  324. data/spec/models/inline_response20047_spec.rb +6 -0
  325. data/spec/models/inline_response20048_spec.rb +47 -0
  326. data/spec/models/inline_response20049_spec.rb +47 -0
  327. data/spec/models/inline_response2005_spec.rb +1 -1
  328. data/spec/models/inline_response2006_spec.rb +1 -1
  329. data/spec/models/inline_response2009_spec.rb +1 -1
  330. data/spec/models/ledger_info_spec.rb +12 -0
  331. data/spec/models/ledger_transaction_log_entry_integration_api_spec.rb +6 -0
  332. data/spec/models/loyalty_balance_spec.rb +6 -0
  333. data/spec/models/loyalty_balance_with_tier_spec.rb +6 -0
  334. data/spec/models/loyalty_ledger_entry_flags_spec.rb +41 -0
  335. data/spec/models/loyalty_ledger_entry_spec.rb +6 -0
  336. data/spec/models/loyalty_program_balance_spec.rb +12 -0
  337. data/spec/models/loyalty_program_spec.rb +1 -1
  338. data/spec/models/loyalty_program_transaction_spec.rb +6 -0
  339. data/spec/models/loyalty_sub_ledger_spec.rb +6 -0
  340. data/spec/models/management_key_spec.rb +6 -0
  341. data/spec/models/message_test_spec.rb +47 -0
  342. data/spec/models/new_application_api_key_spec.rb +1 -1
  343. data/spec/models/new_loyalty_program_spec.rb +1 -1
  344. data/spec/models/new_management_key_spec.rb +6 -0
  345. data/spec/models/new_message_test_spec.rb +79 -0
  346. data/spec/models/pending_points_notification_policy_spec.rb +6 -0
  347. data/spec/models/product_unit_analytics_data_point_spec.rb +65 -0
  348. data/spec/models/product_unit_analytics_spec.rb +2 -20
  349. data/spec/models/product_unit_analytics_totals_spec.rb +41 -0
  350. data/spec/models/revision_activation_request_spec.rb +47 -0
  351. data/spec/models/sku_unit_analytics_data_point_spec.rb +59 -0
  352. data/spec/models/sku_unit_analytics_spec.rb +47 -0
  353. data/spec/models/strikethrough_effect_spec.rb +12 -0
  354. data/spec/models/strikethrough_labeling_notification_spec.rb +16 -0
  355. data/spec/models/summary_campaign_store_budget_spec.rb +6 -0
  356. data/spec/models/tier_downgrade_notification_policy_spec.rb +6 -0
  357. data/spec/models/tier_upgrade_notification_policy_spec.rb +6 -0
  358. data/spec/models/tier_will_downgrade_notification_policy_spec.rb +6 -0
  359. data/spec/models/update_loyalty_program_spec.rb +1 -1
  360. metadata +578 -508
@@ -0,0 +1,271 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
5
+
6
+ The version of the OpenAPI document:
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ class ProductUnitAnalyticsDataPoint
17
+ # The start of the aggregation time frame in UTC.
18
+ attr_accessor :start_time
19
+
20
+ # The end of the aggregation time frame in UTC.
21
+ attr_accessor :end_time
22
+
23
+ attr_accessor :units_sold
24
+
25
+ # The ID of the product.
26
+ attr_accessor :product_id
27
+
28
+ # The name of the product.
29
+ attr_accessor :product_name
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'start_time' => :'startTime',
35
+ :'end_time' => :'endTime',
36
+ :'units_sold' => :'unitsSold',
37
+ :'product_id' => :'productId',
38
+ :'product_name' => :'productName'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'start_time' => :'DateTime',
46
+ :'end_time' => :'DateTime',
47
+ :'units_sold' => :'AnalyticsDataPointWithTrend',
48
+ :'product_id' => :'Integer',
49
+ :'product_name' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::ProductUnitAnalyticsDataPoint` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::ProductUnitAnalyticsDataPoint`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'start_time')
75
+ self.start_time = attributes[:'start_time']
76
+ end
77
+
78
+ if attributes.key?(:'end_time')
79
+ self.end_time = attributes[:'end_time']
80
+ end
81
+
82
+ if attributes.key?(:'units_sold')
83
+ self.units_sold = attributes[:'units_sold']
84
+ end
85
+
86
+ if attributes.key?(:'product_id')
87
+ self.product_id = attributes[:'product_id']
88
+ end
89
+
90
+ if attributes.key?(:'product_name')
91
+ self.product_name = attributes[:'product_name']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @start_time.nil?
100
+ invalid_properties.push('invalid value for "start_time", start_time cannot be nil.')
101
+ end
102
+
103
+ if @end_time.nil?
104
+ invalid_properties.push('invalid value for "end_time", end_time cannot be nil.')
105
+ end
106
+
107
+ if @units_sold.nil?
108
+ invalid_properties.push('invalid value for "units_sold", units_sold cannot be nil.')
109
+ end
110
+
111
+ if @product_id.nil?
112
+ invalid_properties.push('invalid value for "product_id", product_id cannot be nil.')
113
+ end
114
+
115
+ if @product_name.nil?
116
+ invalid_properties.push('invalid value for "product_name", product_name cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ return false if @start_time.nil?
126
+ return false if @end_time.nil?
127
+ return false if @units_sold.nil?
128
+ return false if @product_id.nil?
129
+ return false if @product_name.nil?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ start_time == o.start_time &&
139
+ end_time == o.end_time &&
140
+ units_sold == o.units_sold &&
141
+ product_id == o.product_id &&
142
+ product_name == o.product_name
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [start_time, end_time, units_sold, product_id, product_name].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ new.build_from_hash(attributes)
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ self.class.openapi_types.each_pair do |key, type|
170
+ if type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
174
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
175
+ end
176
+ elsif !attributes[self.class.attribute_map[key]].nil?
177
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
179
+ end
180
+
181
+ self
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def _deserialize(type, value)
189
+ case type.to_sym
190
+ when :DateTime
191
+ DateTime.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ TalonOne.const_get(type).build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ if value.nil?
244
+ is_nullable = self.class.openapi_nullable.include?(attr)
245
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
246
+ end
247
+
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map { |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+ end
271
+ end
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
5
+
6
+ The version of the OpenAPI document:
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ class ProductUnitAnalyticsTotals
17
+ attr_accessor :units_sold
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'units_sold' => :'unitsSold'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'units_sold' => :'AnalyticsDataPointWithTrend'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::ProductUnitAnalyticsTotals` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::ProductUnitAnalyticsTotals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'units_sold')
55
+ self.units_sold = attributes[:'units_sold']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ units_sold == o.units_sold
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Integer] Hash code
88
+ def hash
89
+ [units_sold].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def self.build_from_hash(attributes)
96
+ new.build_from_hash(attributes)
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.openapi_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :Boolean
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ TalonOne.const_get(type).build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # to_body is an alias to to_hash (backward compatibility)
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
5
+
6
+ The version of the OpenAPI document:
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ class SkuUnitAnalytics
17
+ attr_accessor :data
18
+
19
+ attr_accessor :totals
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data',
25
+ :'totals' => :'totals'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'data' => :'Array<SkuUnitAnalyticsDataPoint>',
33
+ :'totals' => :'ProductUnitAnalyticsTotals'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::SkuUnitAnalytics` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::SkuUnitAnalytics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'data')
59
+ if (value = attributes[:'data']).is_a?(Array)
60
+ self.data = value
61
+ end
62
+ end
63
+
64
+ if attributes.key?(:'totals')
65
+ self.totals = attributes[:'totals']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @data.nil?
74
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
75
+ end
76
+
77
+ if @totals.nil?
78
+ invalid_properties.push('invalid value for "totals", totals cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @data.nil?
88
+ return false if @totals.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ data == o.data &&
98
+ totals == o.totals
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [data, totals].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ TalonOne.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end