talon_one 0.1.0 → 1.1.1

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