talon_one 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (516) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +63 -0
  3. data/Gemfile +7 -0
  4. data/README.md +415 -0
  5. data/Rakefile +8 -0
  6. data/docs/APIError.md +10 -0
  7. data/docs/AccessLogEntry.md +14 -0
  8. data/docs/Account.md +25 -0
  9. data/docs/AccountAnalytics.md +21 -0
  10. data/docs/AccountEntity.md +8 -0
  11. data/docs/AccountLimits.md +18 -0
  12. data/docs/Application.md +20 -0
  13. data/docs/ApplicationAPIKey.md +14 -0
  14. data/docs/ApplicationApiHealth.md +9 -0
  15. data/docs/ApplicationCustomer.md +16 -0
  16. data/docs/ApplicationCustomerEntity.md +8 -0
  17. data/docs/ApplicationCustomerSearch.md +10 -0
  18. data/docs/ApplicationEntity.md +8 -0
  19. data/docs/ApplicationEvent.md +15 -0
  20. data/docs/ApplicationSession.md +19 -0
  21. data/docs/ApplicationSessionEntity.md +8 -0
  22. data/docs/Attribute.md +18 -0
  23. data/docs/AttributeQuery.md +7 -0
  24. data/docs/Binding.md +9 -0
  25. data/docs/Campaign.md +32 -0
  26. data/docs/CampaignAnalytics.md +22 -0
  27. data/docs/CampaignCopy.md +9 -0
  28. data/docs/CampaignEntity.md +8 -0
  29. data/docs/CampaignSearch.md +8 -0
  30. data/docs/CampaignSet.md +11 -0
  31. data/docs/CampaignSetBranchNode.md +11 -0
  32. data/docs/CampaignSetLeafNode.md +9 -0
  33. data/docs/CampaignSetNode.md +8 -0
  34. data/docs/CartItem.md +19 -0
  35. data/docs/CartItemAdjustment.md +10 -0
  36. data/docs/Change.md +13 -0
  37. data/docs/CodeGeneratorSettings.md +9 -0
  38. data/docs/Coupon.md +21 -0
  39. data/docs/CouponConstraints.md +10 -0
  40. data/docs/CouponRejectionReason.md +10 -0
  41. data/docs/CouponReservations.md +8 -0
  42. data/docs/CouponSearch.md +8 -0
  43. data/docs/CouponValue.md +8 -0
  44. data/docs/CreateApplicationAPIKey.md +9 -0
  45. data/docs/CustomerActivityReport.md +20 -0
  46. data/docs/CustomerAnalytics.md +14 -0
  47. data/docs/CustomerProfile.md +15 -0
  48. data/docs/CustomerProfileSearchQuery.md +10 -0
  49. data/docs/CustomerSession.md +20 -0
  50. data/docs/EmailEntity.md +8 -0
  51. data/docs/Entity.md +9 -0
  52. data/docs/Environment.md +14 -0
  53. data/docs/ErrorResponse.md +9 -0
  54. data/docs/ErrorSource.md +11 -0
  55. data/docs/Event.md +17 -0
  56. data/docs/EventType.md +19 -0
  57. data/docs/Export.md +13 -0
  58. data/docs/FeatureFlag.md +11 -0
  59. data/docs/FeatureFlags.md +11 -0
  60. data/docs/FeaturesFeed.md +9 -0
  61. data/docs/FuncArgDef.md +9 -0
  62. data/docs/FunctionDef.md +12 -0
  63. data/docs/Import.md +13 -0
  64. data/docs/ImportCoupons.md +8 -0
  65. data/docs/InlineResponse200.md +9 -0
  66. data/docs/InlineResponse2001.md +9 -0
  67. data/docs/InlineResponse20010.md +9 -0
  68. data/docs/InlineResponse20011.md +9 -0
  69. data/docs/InlineResponse20012.md +9 -0
  70. data/docs/InlineResponse20013.md +9 -0
  71. data/docs/InlineResponse20014.md +9 -0
  72. data/docs/InlineResponse20015.md +9 -0
  73. data/docs/InlineResponse20016.md +9 -0
  74. data/docs/InlineResponse20017.md +9 -0
  75. data/docs/InlineResponse20018.md +9 -0
  76. data/docs/InlineResponse20019.md +9 -0
  77. data/docs/InlineResponse2002.md +9 -0
  78. data/docs/InlineResponse20020.md +9 -0
  79. data/docs/InlineResponse20021.md +9 -0
  80. data/docs/InlineResponse20022.md +9 -0
  81. data/docs/InlineResponse20023.md +9 -0
  82. data/docs/InlineResponse20024.md +9 -0
  83. data/docs/InlineResponse20025.md +10 -0
  84. data/docs/InlineResponse20026.md +9 -0
  85. data/docs/InlineResponse20027.md +9 -0
  86. data/docs/InlineResponse20028.md +9 -0
  87. data/docs/InlineResponse2003.md +9 -0
  88. data/docs/InlineResponse2004.md +9 -0
  89. data/docs/InlineResponse2005.md +9 -0
  90. data/docs/InlineResponse2006.md +9 -0
  91. data/docs/InlineResponse2007.md +9 -0
  92. data/docs/InlineResponse2008.md +9 -0
  93. data/docs/InlineResponse2009.md +9 -0
  94. data/docs/IntegrationApi.md +558 -0
  95. data/docs/IntegrationEntity.md +9 -0
  96. data/docs/IntegrationEvent.md +10 -0
  97. data/docs/IntegrationProfileEntity.md +8 -0
  98. data/docs/IntegrationState.md +12 -0
  99. data/docs/LedgerEntry.md +17 -0
  100. data/docs/LibraryAttribute.md +14 -0
  101. data/docs/LimitConfig.md +10 -0
  102. data/docs/LoginParams.md +9 -0
  103. data/docs/Loyalty.md +8 -0
  104. data/docs/LoyaltyLedger.md +9 -0
  105. data/docs/LoyaltyLedgerEntry.md +17 -0
  106. data/docs/LoyaltyMembership.md +9 -0
  107. data/docs/LoyaltyPoints.md +11 -0
  108. data/docs/LoyaltyProgram.md +15 -0
  109. data/docs/LoyaltyProgramBalance.md +8 -0
  110. data/docs/LoyaltyProgramLedgers.md +11 -0
  111. data/docs/LoyaltySubLedger.md +10 -0
  112. data/docs/ManagementApi.md +5077 -0
  113. data/docs/ManagerConfig.md +8 -0
  114. data/docs/Meta.md +12 -0
  115. data/docs/MiscUpdateUserLatestFeature.md +8 -0
  116. data/docs/MultiApplicationEntity.md +8 -0
  117. data/docs/MutableEntity.md +8 -0
  118. data/docs/NewAccount.md +8 -0
  119. data/docs/NewAccountSignUp.md +10 -0
  120. data/docs/NewApplication.md +15 -0
  121. data/docs/NewApplicationAPIKey.md +15 -0
  122. data/docs/NewAttribute.md +15 -0
  123. data/docs/NewCampaign.md +19 -0
  124. data/docs/NewCampaignSet.md +9 -0
  125. data/docs/NewCoupons.md +16 -0
  126. data/docs/NewCustomerProfile.md +8 -0
  127. data/docs/NewCustomerSession.md +15 -0
  128. data/docs/NewEvent.md +11 -0
  129. data/docs/NewEventType.md +17 -0
  130. data/docs/NewFeatureFlags.md +10 -0
  131. data/docs/NewImport.md +8 -0
  132. data/docs/NewInvitation.md +11 -0
  133. data/docs/NewInviteEmail.md +9 -0
  134. data/docs/NewLoyaltyProgram.md +13 -0
  135. data/docs/NewPassword.md +9 -0
  136. data/docs/NewPasswordEmail.md +8 -0
  137. data/docs/NewReferral.md +12 -0
  138. data/docs/NewRole.md +11 -0
  139. data/docs/NewRuleset.md +11 -0
  140. data/docs/NewSamlConnection.md +15 -0
  141. data/docs/NewTemplateDef.md +14 -0
  142. data/docs/NewUser.md +11 -0
  143. data/docs/NewWebhook.md +15 -0
  144. data/docs/Notification.md +10 -0
  145. data/docs/Notifications.md +7 -0
  146. data/docs/Referral.md +17 -0
  147. data/docs/ReferralRejectionReason.md +10 -0
  148. data/docs/Role.md +13 -0
  149. data/docs/RoleAssign.md +9 -0
  150. data/docs/RoleMembership.md +9 -0
  151. data/docs/Rule.md +12 -0
  152. data/docs/Ruleset.md +16 -0
  153. data/docs/SamlConnection.md +19 -0
  154. data/docs/Session.md +10 -0
  155. data/docs/SlotDef.md +13 -0
  156. data/docs/TemplateArgDef.md +11 -0
  157. data/docs/TemplateDef.md +18 -0
  158. data/docs/UpdateAccount.md +10 -0
  159. data/docs/UpdateApplication.md +14 -0
  160. data/docs/UpdateCampaign.md +19 -0
  161. data/docs/UpdateCoupon.md +12 -0
  162. data/docs/UpdateCouponBatch.md +12 -0
  163. data/docs/UpdateLoyaltyProgram.md +12 -0
  164. data/docs/UpdateRole.md +11 -0
  165. data/docs/UpdateUser.md +17 -0
  166. data/docs/User.md +21 -0
  167. data/docs/UserEntity.md +8 -0
  168. data/docs/Webhook.md +18 -0
  169. data/docs/WebhookActivationLogEntry.md +12 -0
  170. data/docs/WebhookLogEntry.md +17 -0
  171. data/git_push.sh +55 -0
  172. data/lib/talon_one.rb +204 -0
  173. data/lib/talon_one/api/integration_api.rb +531 -0
  174. data/lib/talon_one/api/management_api.rb +5535 -0
  175. data/lib/talon_one/api_client.rb +389 -0
  176. data/lib/talon_one/api_error.rb +38 -0
  177. data/lib/talon_one/configuration.rb +223 -0
  178. data/lib/talon_one/models/access_log_entry.rb +280 -0
  179. data/lib/talon_one/models/account.rb +462 -0
  180. data/lib/talon_one/models/account_analytics.rb +384 -0
  181. data/lib/talon_one/models/account_entity.rb +189 -0
  182. data/lib/talon_one/models/account_limits.rb +341 -0
  183. data/lib/talon_one/models/api_error.rb +213 -0
  184. data/lib/talon_one/models/application.rb +482 -0
  185. data/lib/talon_one/models/application_api_health.rb +239 -0
  186. data/lib/talon_one/models/application_api_key.rb +279 -0
  187. data/lib/talon_one/models/application_customer.rb +307 -0
  188. data/lib/talon_one/models/application_customer_entity.rb +184 -0
  189. data/lib/talon_one/models/application_customer_search.rb +206 -0
  190. data/lib/talon_one/models/application_entity.rb +189 -0
  191. data/lib/talon_one/models/application_event.rb +287 -0
  192. data/lib/talon_one/models/application_session.rb +378 -0
  193. data/lib/talon_one/models/application_session_entity.rb +189 -0
  194. data/lib/talon_one/models/attribute.rb +382 -0
  195. data/lib/talon_one/models/attribute_query.rb +174 -0
  196. data/lib/talon_one/models/binding.rb +206 -0
  197. data/lib/talon_one/models/campaign.rb +534 -0
  198. data/lib/talon_one/models/campaign_analytics.rb +399 -0
  199. data/lib/talon_one/models/campaign_copy.rb +201 -0
  200. data/lib/talon_one/models/campaign_entity.rb +189 -0
  201. data/lib/talon_one/models/campaign_search.rb +189 -0
  202. data/lib/talon_one/models/campaign_set.rb +234 -0
  203. data/lib/talon_one/models/campaign_set_branch_node.rb +282 -0
  204. data/lib/talon_one/models/campaign_set_leaf_node.rb +238 -0
  205. data/lib/talon_one/models/campaign_set_node.rb +188 -0
  206. data/lib/talon_one/models/cart_item.rb +365 -0
  207. data/lib/talon_one/models/cart_item_adjustment.rb +248 -0
  208. data/lib/talon_one/models/change.rb +255 -0
  209. data/lib/talon_one/models/code_generator_settings.rb +225 -0
  210. data/lib/talon_one/models/coupon.rb +392 -0
  211. data/lib/talon_one/models/coupon_constraints.rb +228 -0
  212. data/lib/talon_one/models/coupon_rejection_reason.rb +251 -0
  213. data/lib/talon_one/models/coupon_reservations.rb +191 -0
  214. data/lib/talon_one/models/coupon_search.rb +189 -0
  215. data/lib/talon_one/models/coupon_value.rb +199 -0
  216. data/lib/talon_one/models/create_application_api_key.rb +204 -0
  217. data/lib/talon_one/models/customer_activity_report.rb +365 -0
  218. data/lib/talon_one/models/customer_analytics.rb +280 -0
  219. data/lib/talon_one/models/customer_profile.rb +292 -0
  220. data/lib/talon_one/models/customer_profile_search_query.rb +206 -0
  221. data/lib/talon_one/models/customer_session.rb +407 -0
  222. data/lib/talon_one/models/email_entity.rb +189 -0
  223. data/lib/talon_one/models/entity.rb +204 -0
  224. data/lib/talon_one/models/environment.rb +285 -0
  225. data/lib/talon_one/models/error_response.rb +201 -0
  226. data/lib/talon_one/models/error_source.rb +215 -0
  227. data/lib/talon_one/models/event.rb +332 -0
  228. data/lib/talon_one/models/event_type.rb +426 -0
  229. data/lib/talon_one/models/export.rb +299 -0
  230. data/lib/talon_one/models/feature_flag.rb +224 -0
  231. data/lib/talon_one/models/feature_flags.rb +220 -0
  232. data/lib/talon_one/models/features_feed.rb +193 -0
  233. data/lib/talon_one/models/func_arg_def.rb +243 -0
  234. data/lib/talon_one/models/function_def.rb +260 -0
  235. data/lib/talon_one/models/import.rb +318 -0
  236. data/lib/talon_one/models/import_coupons.rb +188 -0
  237. data/lib/talon_one/models/inline_response_200.rb +204 -0
  238. data/lib/talon_one/models/inline_response_200_1.rb +204 -0
  239. data/lib/talon_one/models/inline_response_200_10.rb +204 -0
  240. data/lib/talon_one/models/inline_response_200_11.rb +204 -0
  241. data/lib/talon_one/models/inline_response_200_12.rb +204 -0
  242. data/lib/talon_one/models/inline_response_200_13.rb +204 -0
  243. data/lib/talon_one/models/inline_response_200_14.rb +204 -0
  244. data/lib/talon_one/models/inline_response_200_15.rb +204 -0
  245. data/lib/talon_one/models/inline_response_200_16.rb +204 -0
  246. data/lib/talon_one/models/inline_response_200_17.rb +204 -0
  247. data/lib/talon_one/models/inline_response_200_18.rb +204 -0
  248. data/lib/talon_one/models/inline_response_200_19.rb +204 -0
  249. data/lib/talon_one/models/inline_response_200_2.rb +204 -0
  250. data/lib/talon_one/models/inline_response_200_20.rb +204 -0
  251. data/lib/talon_one/models/inline_response_200_21.rb +204 -0
  252. data/lib/talon_one/models/inline_response_200_22.rb +204 -0
  253. data/lib/talon_one/models/inline_response_200_23.rb +204 -0
  254. data/lib/talon_one/models/inline_response_200_24.rb +204 -0
  255. data/lib/talon_one/models/inline_response_200_25.rb +208 -0
  256. data/lib/talon_one/models/inline_response_200_26.rb +204 -0
  257. data/lib/talon_one/models/inline_response_200_27.rb +204 -0
  258. data/lib/talon_one/models/inline_response_200_28.rb +204 -0
  259. data/lib/talon_one/models/inline_response_200_3.rb +204 -0
  260. data/lib/talon_one/models/inline_response_200_4.rb +204 -0
  261. data/lib/talon_one/models/inline_response_200_5.rb +204 -0
  262. data/lib/talon_one/models/inline_response_200_6.rb +204 -0
  263. data/lib/talon_one/models/inline_response_200_7.rb +204 -0
  264. data/lib/talon_one/models/inline_response_200_8.rb +204 -0
  265. data/lib/talon_one/models/inline_response_200_9.rb +204 -0
  266. data/lib/talon_one/models/integration_entity.rb +204 -0
  267. data/lib/talon_one/models/integration_event.rb +234 -0
  268. data/lib/talon_one/models/integration_profile_entity.rb +184 -0
  269. data/lib/talon_one/models/integration_state.rb +235 -0
  270. data/lib/talon_one/models/ledger_entry.rb +320 -0
  271. data/lib/talon_one/models/library_attribute.rb +330 -0
  272. data/lib/talon_one/models/limit_config.rb +274 -0
  273. data/lib/talon_one/models/login_params.rb +205 -0
  274. data/lib/talon_one/models/loyalty.rb +192 -0
  275. data/lib/talon_one/models/loyalty_ledger.rb +202 -0
  276. data/lib/talon_one/models/loyalty_ledger_entry.rb +336 -0
  277. data/lib/talon_one/models/loyalty_membership.rb +199 -0
  278. data/lib/talon_one/models/loyalty_points.rb +220 -0
  279. data/lib/talon_one/models/loyalty_program.rb +297 -0
  280. data/lib/talon_one/models/loyalty_program_balance.rb +189 -0
  281. data/lib/talon_one/models/loyalty_program_ledgers.rb +232 -0
  282. data/lib/talon_one/models/loyalty_sub_ledger.rb +213 -0
  283. data/lib/talon_one/models/manager_config.rb +188 -0
  284. data/lib/talon_one/models/meta.rb +221 -0
  285. data/lib/talon_one/models/misc_update_user_latest_feature.rb +183 -0
  286. data/lib/talon_one/models/multi_application_entity.rb +191 -0
  287. data/lib/talon_one/models/mutable_entity.rb +189 -0
  288. data/lib/talon_one/models/new_account.rb +207 -0
  289. data/lib/talon_one/models/new_account_sign_up.rb +238 -0
  290. data/lib/talon_one/models/new_application.rb +396 -0
  291. data/lib/talon_one/models/new_application_api_key.rb +295 -0
  292. data/lib/talon_one/models/new_attribute.rb +337 -0
  293. data/lib/talon_one/models/new_campaign.rb +378 -0
  294. data/lib/talon_one/models/new_campaign_set.rb +204 -0
  295. data/lib/talon_one/models/new_coupons.rb +334 -0
  296. data/lib/talon_one/models/new_customer_profile.rb +184 -0
  297. data/lib/talon_one/models/new_customer_session.rb +295 -0
  298. data/lib/talon_one/models/new_event.rb +268 -0
  299. data/lib/talon_one/models/new_event_type.rb +396 -0
  300. data/lib/talon_one/models/new_feature_flags.rb +204 -0
  301. data/lib/talon_one/models/new_import.rb +224 -0
  302. data/lib/talon_one/models/new_invitation.rb +226 -0
  303. data/lib/talon_one/models/new_invite_email.rb +240 -0
  304. data/lib/talon_one/models/new_loyalty_program.rb +257 -0
  305. data/lib/talon_one/models/new_password.rb +222 -0
  306. data/lib/talon_one/models/new_password_email.rb +207 -0
  307. data/lib/talon_one/models/new_referral.rb +234 -0
  308. data/lib/talon_one/models/new_role.rb +232 -0
  309. data/lib/talon_one/models/new_ruleset.rb +228 -0
  310. data/lib/talon_one/models/new_saml_connection.rb +356 -0
  311. data/lib/talon_one/models/new_template_def.rb +308 -0
  312. data/lib/talon_one/models/new_user.rb +248 -0
  313. data/lib/talon_one/models/new_webhook.rb +330 -0
  314. data/lib/talon_one/models/notification.rb +219 -0
  315. data/lib/talon_one/models/notifications.rb +174 -0
  316. data/lib/talon_one/models/referral.rb +348 -0
  317. data/lib/talon_one/models/referral_rejection_reason.rb +251 -0
  318. data/lib/talon_one/models/role.rb +247 -0
  319. data/lib/talon_one/models/role_assign.rb +209 -0
  320. data/lib/talon_one/models/role_membership.rb +204 -0
  321. data/lib/talon_one/models/rule.rb +245 -0
  322. data/lib/talon_one/models/ruleset.rb +299 -0
  323. data/lib/talon_one/models/saml_connection.rb +420 -0
  324. data/lib/talon_one/models/session.rb +219 -0
  325. data/lib/talon_one/models/slot_def.rb +254 -0
  326. data/lib/talon_one/models/template_arg_def.rb +293 -0
  327. data/lib/talon_one/models/template_def.rb +398 -0
  328. data/lib/talon_one/models/update_account.rb +233 -0
  329. data/lib/talon_one/models/update_application.rb +352 -0
  330. data/lib/talon_one/models/update_campaign.rb +373 -0
  331. data/lib/talon_one/models/update_coupon.rb +249 -0
  332. data/lib/talon_one/models/update_coupon_batch.rb +254 -0
  333. data/lib/talon_one/models/update_loyalty_program.rb +227 -0
  334. data/lib/talon_one/models/update_role.rb +216 -0
  335. data/lib/talon_one/models/update_user.rb +315 -0
  336. data/lib/talon_one/models/user.rb +400 -0
  337. data/lib/talon_one/models/user_entity.rb +189 -0
  338. data/lib/talon_one/models/webhook.rb +375 -0
  339. data/lib/talon_one/models/webhook_activation_log_entry.rb +250 -0
  340. data/lib/talon_one/models/webhook_log_entry.rb +305 -0
  341. data/lib/talon_one/version.rb +15 -0
  342. data/spec/api/integration_api_spec.rb +147 -0
  343. data/spec/api/management_api_spec.rb +1304 -0
  344. data/spec/api_client_spec.rb +226 -0
  345. data/spec/configuration_spec.rb +42 -0
  346. data/spec/models/access_log_entry_spec.rb +77 -0
  347. data/spec/models/account_analytics_spec.rb +119 -0
  348. data/spec/models/account_entity_spec.rb +41 -0
  349. data/spec/models/account_limits_spec.rb +101 -0
  350. data/spec/models/account_spec.rb +147 -0
  351. data/spec/models/api_error_spec.rb +53 -0
  352. data/spec/models/application_api_health_spec.rb +51 -0
  353. data/spec/models/application_api_key_spec.rb +77 -0
  354. data/spec/models/application_customer_entity_spec.rb +41 -0
  355. data/spec/models/application_customer_search_spec.rb +53 -0
  356. data/spec/models/application_customer_spec.rb +89 -0
  357. data/spec/models/application_entity_spec.rb +41 -0
  358. data/spec/models/application_event_spec.rb +83 -0
  359. data/spec/models/application_session_entity_spec.rb +41 -0
  360. data/spec/models/application_session_spec.rb +111 -0
  361. data/spec/models/application_spec.rb +117 -0
  362. data/spec/models/attribute_query_spec.rb +35 -0
  363. data/spec/models/attribute_spec.rb +109 -0
  364. data/spec/models/binding_spec.rb +47 -0
  365. data/spec/models/campaign_analytics_spec.rb +125 -0
  366. data/spec/models/campaign_copy_spec.rb +47 -0
  367. data/spec/models/campaign_entity_spec.rb +41 -0
  368. data/spec/models/campaign_search_spec.rb +41 -0
  369. data/spec/models/campaign_set_branch_node_spec.rb +67 -0
  370. data/spec/models/campaign_set_leaf_node_spec.rb +51 -0
  371. data/spec/models/campaign_set_node_spec.rb +41 -0
  372. data/spec/models/campaign_set_spec.rb +59 -0
  373. data/spec/models/campaign_spec.rb +193 -0
  374. data/spec/models/cart_item_adjustment_spec.rb +53 -0
  375. data/spec/models/cart_item_spec.rb +107 -0
  376. data/spec/models/change_spec.rb +71 -0
  377. data/spec/models/code_generator_settings_spec.rb +47 -0
  378. data/spec/models/coupon_constraints_spec.rb +53 -0
  379. data/spec/models/coupon_rejection_reason_spec.rb +57 -0
  380. data/spec/models/coupon_reservations_spec.rb +41 -0
  381. data/spec/models/coupon_search_spec.rb +41 -0
  382. data/spec/models/coupon_spec.rb +119 -0
  383. data/spec/models/coupon_value_spec.rb +41 -0
  384. data/spec/models/create_application_api_key_spec.rb +47 -0
  385. data/spec/models/customer_activity_report_spec.rb +113 -0
  386. data/spec/models/customer_analytics_spec.rb +77 -0
  387. data/spec/models/customer_profile_search_query_spec.rb +53 -0
  388. data/spec/models/customer_profile_spec.rb +83 -0
  389. data/spec/models/customer_session_spec.rb +117 -0
  390. data/spec/models/email_entity_spec.rb +41 -0
  391. data/spec/models/entity_spec.rb +47 -0
  392. data/spec/models/environment_spec.rb +77 -0
  393. data/spec/models/error_response_spec.rb +47 -0
  394. data/spec/models/error_source_spec.rb +59 -0
  395. data/spec/models/event_spec.rb +95 -0
  396. data/spec/models/event_type_spec.rb +115 -0
  397. data/spec/models/export_spec.rb +75 -0
  398. data/spec/models/feature_flag_spec.rb +59 -0
  399. data/spec/models/feature_flags_spec.rb +59 -0
  400. data/spec/models/features_feed_spec.rb +47 -0
  401. data/spec/models/func_arg_def_spec.rb +51 -0
  402. data/spec/models/function_def_spec.rb +65 -0
  403. data/spec/models/import_coupons_spec.rb +41 -0
  404. data/spec/models/import_spec.rb +75 -0
  405. data/spec/models/inline_response_200_10_spec.rb +47 -0
  406. data/spec/models/inline_response_200_11_spec.rb +47 -0
  407. data/spec/models/inline_response_200_12_spec.rb +47 -0
  408. data/spec/models/inline_response_200_13_spec.rb +47 -0
  409. data/spec/models/inline_response_200_14_spec.rb +47 -0
  410. data/spec/models/inline_response_200_15_spec.rb +47 -0
  411. data/spec/models/inline_response_200_16_spec.rb +47 -0
  412. data/spec/models/inline_response_200_17_spec.rb +47 -0
  413. data/spec/models/inline_response_200_18_spec.rb +47 -0
  414. data/spec/models/inline_response_200_19_spec.rb +47 -0
  415. data/spec/models/inline_response_200_1_spec.rb +47 -0
  416. data/spec/models/inline_response_200_20_spec.rb +47 -0
  417. data/spec/models/inline_response_200_21_spec.rb +47 -0
  418. data/spec/models/inline_response_200_22_spec.rb +47 -0
  419. data/spec/models/inline_response_200_23_spec.rb +47 -0
  420. data/spec/models/inline_response_200_24_spec.rb +47 -0
  421. data/spec/models/inline_response_200_25_spec.rb +53 -0
  422. data/spec/models/inline_response_200_26_spec.rb +47 -0
  423. data/spec/models/inline_response_200_27_spec.rb +47 -0
  424. data/spec/models/inline_response_200_28_spec.rb +47 -0
  425. data/spec/models/inline_response_200_2_spec.rb +47 -0
  426. data/spec/models/inline_response_200_3_spec.rb +47 -0
  427. data/spec/models/inline_response_200_4_spec.rb +47 -0
  428. data/spec/models/inline_response_200_5_spec.rb +47 -0
  429. data/spec/models/inline_response_200_6_spec.rb +47 -0
  430. data/spec/models/inline_response_200_7_spec.rb +47 -0
  431. data/spec/models/inline_response_200_8_spec.rb +47 -0
  432. data/spec/models/inline_response_200_9_spec.rb +47 -0
  433. data/spec/models/inline_response_200_spec.rb +47 -0
  434. data/spec/models/integration_entity_spec.rb +47 -0
  435. data/spec/models/integration_event_spec.rb +53 -0
  436. data/spec/models/integration_profile_entity_spec.rb +41 -0
  437. data/spec/models/integration_state_spec.rb +65 -0
  438. data/spec/models/ledger_entry_spec.rb +95 -0
  439. data/spec/models/library_attribute_spec.rb +85 -0
  440. data/spec/models/limit_config_spec.rb +61 -0
  441. data/spec/models/login_params_spec.rb +47 -0
  442. data/spec/models/loyalty_ledger_entry_spec.rb +99 -0
  443. data/spec/models/loyalty_ledger_spec.rb +47 -0
  444. data/spec/models/loyalty_membership_spec.rb +47 -0
  445. data/spec/models/loyalty_points_spec.rb +59 -0
  446. data/spec/models/loyalty_program_balance_spec.rb +41 -0
  447. data/spec/models/loyalty_program_ledgers_spec.rb +59 -0
  448. data/spec/models/loyalty_program_spec.rb +83 -0
  449. data/spec/models/loyalty_spec.rb +41 -0
  450. data/spec/models/loyalty_sub_ledger_spec.rb +53 -0
  451. data/spec/models/manager_config_spec.rb +41 -0
  452. data/spec/models/meta_spec.rb +65 -0
  453. data/spec/models/misc_update_user_latest_feature_spec.rb +41 -0
  454. data/spec/models/multi_application_entity_spec.rb +41 -0
  455. data/spec/models/mutable_entity_spec.rb +41 -0
  456. data/spec/models/new_account_sign_up_spec.rb +53 -0
  457. data/spec/models/new_account_spec.rb +41 -0
  458. data/spec/models/new_application_api_key_spec.rb +83 -0
  459. data/spec/models/new_application_spec.rb +87 -0
  460. data/spec/models/new_attribute_spec.rb +91 -0
  461. data/spec/models/new_campaign_set_spec.rb +47 -0
  462. data/spec/models/new_campaign_spec.rb +115 -0
  463. data/spec/models/new_coupons_spec.rb +89 -0
  464. data/spec/models/new_customer_profile_spec.rb +41 -0
  465. data/spec/models/new_customer_session_spec.rb +87 -0
  466. data/spec/models/new_event_spec.rb +59 -0
  467. data/spec/models/new_event_type_spec.rb +103 -0
  468. data/spec/models/new_feature_flags_spec.rb +53 -0
  469. data/spec/models/new_import_spec.rb +45 -0
  470. data/spec/models/new_invitation_spec.rb +59 -0
  471. data/spec/models/new_invite_email_spec.rb +47 -0
  472. data/spec/models/new_loyalty_program_spec.rb +71 -0
  473. data/spec/models/new_password_email_spec.rb +41 -0
  474. data/spec/models/new_password_spec.rb +47 -0
  475. data/spec/models/new_referral_spec.rb +65 -0
  476. data/spec/models/new_role_spec.rb +59 -0
  477. data/spec/models/new_ruleset_spec.rb +59 -0
  478. data/spec/models/new_saml_connection_spec.rb +83 -0
  479. data/spec/models/new_template_def_spec.rb +77 -0
  480. data/spec/models/new_user_spec.rb +59 -0
  481. data/spec/models/new_webhook_spec.rb +87 -0
  482. data/spec/models/notification_spec.rb +53 -0
  483. data/spec/models/notifications_spec.rb +35 -0
  484. data/spec/models/referral_rejection_reason_spec.rb +57 -0
  485. data/spec/models/referral_spec.rb +95 -0
  486. data/spec/models/role_assign_spec.rb +47 -0
  487. data/spec/models/role_membership_spec.rb +47 -0
  488. data/spec/models/role_spec.rb +71 -0
  489. data/spec/models/rule_spec.rb +65 -0
  490. data/spec/models/ruleset_spec.rb +89 -0
  491. data/spec/models/saml_connection_spec.rb +107 -0
  492. data/spec/models/session_spec.rb +53 -0
  493. data/spec/models/slot_def_spec.rb +71 -0
  494. data/spec/models/template_arg_def_spec.rb +63 -0
  495. data/spec/models/template_def_spec.rb +101 -0
  496. data/spec/models/update_account_spec.rb +53 -0
  497. data/spec/models/update_application_spec.rb +81 -0
  498. data/spec/models/update_campaign_spec.rb +115 -0
  499. data/spec/models/update_coupon_batch_spec.rb +65 -0
  500. data/spec/models/update_coupon_spec.rb +65 -0
  501. data/spec/models/update_loyalty_program_spec.rb +65 -0
  502. data/spec/models/update_role_spec.rb +59 -0
  503. data/spec/models/update_user_spec.rb +99 -0
  504. data/spec/models/user_entity_spec.rb +41 -0
  505. data/spec/models/user_spec.rb +123 -0
  506. data/spec/models/webhook_activation_log_entry_spec.rb +65 -0
  507. data/spec/models/webhook_log_entry_spec.rb +95 -0
  508. data/spec/models/webhook_spec.rb +105 -0
  509. data/spec/spec_helper.rb +111 -0
  510. data/talon_one-1.0.0.gem +0 -0
  511. data/talon_one-1.1.0.gem +0 -0
  512. data/talon_one-1.1.1.gem +0 -0
  513. data/talon_one-1.1.2.gem +0 -0
  514. data/talon_one-1.2.0.gem +0 -0
  515. data/talon_one.gemspec +45 -0
  516. metadata +908 -0
@@ -0,0 +1,201 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.7
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ class ErrorResponse
17
+ # A message describing the error.
18
+ attr_accessor :message
19
+
20
+ # An array of individual problems encountered during the request.
21
+ attr_accessor :errors
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'message' => :'message',
27
+ :'errors' => :'errors'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'message' => :'String',
35
+ :'errors' => :'Array<APIError>'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'message')
48
+ self.message = attributes[:'message']
49
+ end
50
+
51
+ if attributes.has_key?(:'errors')
52
+ if (value = attributes[:'errors']).is_a?(Array)
53
+ self.errors = value
54
+ end
55
+ end
56
+ end
57
+
58
+ # Show invalid properties with the reasons. Usually used together with valid?
59
+ # @return Array for valid properties with the reasons
60
+ def list_invalid_properties
61
+ invalid_properties = Array.new
62
+ if @message.nil?
63
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
64
+ end
65
+
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ return false if @message.nil?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ message == o.message &&
82
+ errors == o.errors
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Fixnum] Hash code
93
+ def hash
94
+ [message, errors].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ if type =~ /\AArray<(.*)>/i
104
+ # check to ensure the input is an array given that the the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
+ end
109
+ elsif !attributes[self.class.attribute_map[key]].nil?
110
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
112
+ end
113
+
114
+ self
115
+ end
116
+
117
+ # Deserializes the data based on type
118
+ # @param string type Data type
119
+ # @param string value Value to be deserialized
120
+ # @return [Object] Deserialized data
121
+ def _deserialize(type, value)
122
+ case type.to_sym
123
+ when :DateTime
124
+ DateTime.parse(value)
125
+ when :Date
126
+ Date.parse(value)
127
+ when :String
128
+ value.to_s
129
+ when :Integer
130
+ value.to_i
131
+ when :Float
132
+ value.to_f
133
+ when :BOOLEAN
134
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
+ true
136
+ else
137
+ false
138
+ end
139
+ when :Object
140
+ # generic object (usually a Hash), return directly
141
+ value
142
+ when /\AArray<(?<inner_type>.+)>\z/
143
+ inner_type = Regexp.last_match[:inner_type]
144
+ value.map { |v| _deserialize(inner_type, v) }
145
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
+ k_type = Regexp.last_match[:k_type]
147
+ v_type = Regexp.last_match[:v_type]
148
+ {}.tap do |hash|
149
+ value.each do |k, v|
150
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
+ end
152
+ end
153
+ else # model
154
+ temp_model = TalonOne.const_get(type).new
155
+ temp_model.build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ # Outputs non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
185
+ # @param [Object] value Any valid value
186
+ # @return [Hash] Returns the value in the form of hash
187
+ def _to_hash(value)
188
+ if value.is_a?(Array)
189
+ value.compact.map { |v| _to_hash(v) }
190
+ elsif value.is_a?(Hash)
191
+ {}.tap do |hash|
192
+ value.each { |k, v| hash[k] = _to_hash(v) }
193
+ end
194
+ elsif value.respond_to? :to_hash
195
+ value.to_hash
196
+ else
197
+ value
198
+ end
199
+ end
200
+ end
201
+ end
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.7
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ # The source of the current error, exactly one of `pointer`, `parameter` or `line` will be defined.
17
+ class ErrorSource
18
+ # Pointer to the path in the payload that caused this error.
19
+ attr_accessor :pointer
20
+
21
+ # Query parameter that caused this error.
22
+ attr_accessor :parameter
23
+
24
+ # Line number in uploaded multipart file that caused this error. 'N/A' if unknown.
25
+ attr_accessor :line
26
+
27
+ # Pointer to the resource that caused this error
28
+ attr_accessor :resource
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'pointer' => :'pointer',
34
+ :'parameter' => :'parameter',
35
+ :'line' => :'line',
36
+ :'resource' => :'resource'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'pointer' => :'String',
44
+ :'parameter' => :'String',
45
+ :'line' => :'String',
46
+ :'resource' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'pointer')
59
+ self.pointer = attributes[:'pointer']
60
+ end
61
+
62
+ if attributes.has_key?(:'parameter')
63
+ self.parameter = attributes[:'parameter']
64
+ end
65
+
66
+ if attributes.has_key?(:'line')
67
+ self.line = attributes[:'line']
68
+ end
69
+
70
+ if attributes.has_key?(:'resource')
71
+ self.resource = attributes[:'resource']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ pointer == o.pointer &&
94
+ parameter == o.parameter &&
95
+ line == o.line &&
96
+ resource == o.resource
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [pointer, parameter, line, resource].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = TalonOne.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,332 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.7
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ #
17
+ class Event
18
+ # Unique ID for this entity.
19
+ attr_accessor :id
20
+
21
+ # The exact moment this entity was created.
22
+ attr_accessor :created
23
+
24
+ # The ID of the application that owns this entity.
25
+ attr_accessor :application_id
26
+
27
+ # ID of the customers profile as used within this Talon.One account. May be omitted or set to the empty string if the customer does not yet have a known profile ID.
28
+ attr_accessor :profile_id
29
+
30
+ # A string representing the event. Must not be a reserved event name.
31
+ attr_accessor :type
32
+
33
+ # Arbitrary additional JSON data associated with the event.
34
+ attr_accessor :attributes
35
+
36
+ # The ID of the session that this event occurred in.
37
+ attr_accessor :session_id
38
+
39
+ # An array of \"effects\" that must be applied in response to this event. Example effects include `addItemToCart` or `setDiscount`.
40
+ attr_accessor :effects
41
+
42
+ # Ledger entries for the event.
43
+ attr_accessor :ledger_entries
44
+
45
+ attr_accessor :meta
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'id' => :'id',
51
+ :'created' => :'created',
52
+ :'application_id' => :'applicationId',
53
+ :'profile_id' => :'profileId',
54
+ :'type' => :'type',
55
+ :'attributes' => :'attributes',
56
+ :'session_id' => :'sessionId',
57
+ :'effects' => :'effects',
58
+ :'ledger_entries' => :'ledgerEntries',
59
+ :'meta' => :'meta'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'id' => :'Integer',
67
+ :'created' => :'DateTime',
68
+ :'application_id' => :'Integer',
69
+ :'profile_id' => :'String',
70
+ :'type' => :'String',
71
+ :'attributes' => :'Object',
72
+ :'session_id' => :'String',
73
+ :'effects' => :'Array<Object>',
74
+ :'ledger_entries' => :'Array<LedgerEntry>',
75
+ :'meta' => :'Meta'
76
+ }
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ return unless attributes.is_a?(Hash)
83
+
84
+ # convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
86
+
87
+ if attributes.has_key?(:'id')
88
+ self.id = attributes[:'id']
89
+ end
90
+
91
+ if attributes.has_key?(:'created')
92
+ self.created = attributes[:'created']
93
+ end
94
+
95
+ if attributes.has_key?(:'applicationId')
96
+ self.application_id = attributes[:'applicationId']
97
+ end
98
+
99
+ if attributes.has_key?(:'profileId')
100
+ self.profile_id = attributes[:'profileId']
101
+ end
102
+
103
+ if attributes.has_key?(:'type')
104
+ self.type = attributes[:'type']
105
+ end
106
+
107
+ if attributes.has_key?(:'attributes')
108
+ self.attributes = attributes[:'attributes']
109
+ end
110
+
111
+ if attributes.has_key?(:'sessionId')
112
+ self.session_id = attributes[:'sessionId']
113
+ end
114
+
115
+ if attributes.has_key?(:'effects')
116
+ if (value = attributes[:'effects']).is_a?(Array)
117
+ self.effects = value
118
+ end
119
+ end
120
+
121
+ if attributes.has_key?(:'ledgerEntries')
122
+ if (value = attributes[:'ledgerEntries']).is_a?(Array)
123
+ self.ledger_entries = value
124
+ end
125
+ end
126
+
127
+ if attributes.has_key?(:'meta')
128
+ self.meta = attributes[:'meta']
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ if @id.nil?
137
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
138
+ end
139
+
140
+ if @created.nil?
141
+ invalid_properties.push('invalid value for "created", created cannot be nil.')
142
+ end
143
+
144
+ if @application_id.nil?
145
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
146
+ end
147
+
148
+ if @type.nil?
149
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
150
+ end
151
+
152
+ if @type.to_s.length < 1
153
+ invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.')
154
+ end
155
+
156
+ if @attributes.nil?
157
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
158
+ end
159
+
160
+ if @effects.nil?
161
+ invalid_properties.push('invalid value for "effects", effects cannot be nil.')
162
+ end
163
+
164
+ if @ledger_entries.nil?
165
+ invalid_properties.push('invalid value for "ledger_entries", ledger_entries cannot be nil.')
166
+ end
167
+
168
+ invalid_properties
169
+ end
170
+
171
+ # Check to see if the all the properties in the model are valid
172
+ # @return true if the model is valid
173
+ def valid?
174
+ return false if @id.nil?
175
+ return false if @created.nil?
176
+ return false if @application_id.nil?
177
+ return false if @type.nil?
178
+ return false if @type.to_s.length < 1
179
+ return false if @attributes.nil?
180
+ return false if @effects.nil?
181
+ return false if @ledger_entries.nil?
182
+ true
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] type Value to be assigned
187
+ def type=(type)
188
+ if type.nil?
189
+ fail ArgumentError, 'type cannot be nil'
190
+ end
191
+
192
+ if type.to_s.length < 1
193
+ fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.'
194
+ end
195
+
196
+ @type = type
197
+ end
198
+
199
+ # Checks equality by comparing each attribute.
200
+ # @param [Object] Object to be compared
201
+ def ==(o)
202
+ return true if self.equal?(o)
203
+ self.class == o.class &&
204
+ id == o.id &&
205
+ created == o.created &&
206
+ application_id == o.application_id &&
207
+ profile_id == o.profile_id &&
208
+ type == o.type &&
209
+ attributes == o.attributes &&
210
+ session_id == o.session_id &&
211
+ effects == o.effects &&
212
+ ledger_entries == o.ledger_entries &&
213
+ meta == o.meta
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Fixnum] Hash code
224
+ def hash
225
+ [id, created, application_id, profile_id, type, attributes, session_id, effects, ledger_entries, meta].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def build_from_hash(attributes)
232
+ return nil unless attributes.is_a?(Hash)
233
+ self.class.swagger_types.each_pair do |key, type|
234
+ if type =~ /\AArray<(.*)>/i
235
+ # check to ensure the input is an array given that the the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
238
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
239
+ end
240
+ elsif !attributes[self.class.attribute_map[key]].nil?
241
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
242
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
243
+ end
244
+
245
+ self
246
+ end
247
+
248
+ # Deserializes the data based on type
249
+ # @param string type Data type
250
+ # @param string value Value to be deserialized
251
+ # @return [Object] Deserialized data
252
+ def _deserialize(type, value)
253
+ case type.to_sym
254
+ when :DateTime
255
+ DateTime.parse(value)
256
+ when :Date
257
+ Date.parse(value)
258
+ when :String
259
+ value.to_s
260
+ when :Integer
261
+ value.to_i
262
+ when :Float
263
+ value.to_f
264
+ when :BOOLEAN
265
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
266
+ true
267
+ else
268
+ false
269
+ end
270
+ when :Object
271
+ # generic object (usually a Hash), return directly
272
+ value
273
+ when /\AArray<(?<inner_type>.+)>\z/
274
+ inner_type = Regexp.last_match[:inner_type]
275
+ value.map { |v| _deserialize(inner_type, v) }
276
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
277
+ k_type = Regexp.last_match[:k_type]
278
+ v_type = Regexp.last_match[:v_type]
279
+ {}.tap do |hash|
280
+ value.each do |k, v|
281
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
282
+ end
283
+ end
284
+ else # model
285
+ temp_model = TalonOne.const_get(type).new
286
+ temp_model.build_from_hash(value)
287
+ end
288
+ end
289
+
290
+ # Returns the string representation of the object
291
+ # @return [String] String presentation of the object
292
+ def to_s
293
+ to_hash.to_s
294
+ end
295
+
296
+ # to_body is an alias to to_hash (backward compatibility)
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_body
299
+ to_hash
300
+ end
301
+
302
+ # Returns the object in the form of hash
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_hash
305
+ hash = {}
306
+ self.class.attribute_map.each_pair do |attr, param|
307
+ value = self.send(attr)
308
+ next if value.nil?
309
+ hash[param] = _to_hash(value)
310
+ end
311
+ hash
312
+ end
313
+
314
+ # Outputs non-array value in the form of hash
315
+ # For object, use to_hash. Otherwise, just return the value
316
+ # @param [Object] value Any valid value
317
+ # @return [Hash] Returns the value in the form of hash
318
+ def _to_hash(value)
319
+ if value.is_a?(Array)
320
+ value.compact.map { |v| _to_hash(v) }
321
+ elsif value.is_a?(Hash)
322
+ {}.tap do |hash|
323
+ value.each { |k, v| hash[k] = _to_hash(v) }
324
+ end
325
+ elsif value.respond_to? :to_hash
326
+ value.to_hash
327
+ else
328
+ value
329
+ end
330
+ end
331
+ end
332
+ end