talon_one 0.1.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (524) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile +4 -0
  4. data/README.md +398 -57
  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/fck.rb +64 -0
  171. data/git_push.sh +55 -0
  172. data/lib/talon_one.rb +200 -4
  173. data/lib/talon_one/api/integration_api.rb +531 -0
  174. data/lib/talon_one/api/management_api.rb +5520 -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 +312 -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 +368 -0
  193. data/lib/talon_one/models/application_session_entity.rb +189 -0
  194. data/lib/talon_one/models/application_storage.rb +292 -0
  195. data/lib/talon_one/models/application_storage_data.rb +175 -0
  196. data/lib/talon_one/models/application_storage_tuple.rb +283 -0
  197. data/lib/talon_one/models/attribute.rb +416 -0
  198. data/lib/talon_one/models/attribute_query.rb +174 -0
  199. data/lib/talon_one/models/binding.rb +206 -0
  200. data/lib/talon_one/models/campaign.rb +514 -0
  201. data/lib/talon_one/models/campaign_analytics.rb +399 -0
  202. data/lib/talon_one/models/campaign_copy.rb +201 -0
  203. data/lib/talon_one/models/campaign_entity.rb +189 -0
  204. data/lib/talon_one/models/campaign_search.rb +189 -0
  205. data/lib/talon_one/models/campaign_set.rb +234 -0
  206. data/lib/talon_one/models/campaign_set_branch_node.rb +282 -0
  207. data/lib/talon_one/models/campaign_set_leaf_node.rb +238 -0
  208. data/lib/talon_one/models/campaign_set_node.rb +188 -0
  209. data/lib/talon_one/models/cart_item.rb +365 -0
  210. data/lib/talon_one/models/cart_item_adjustment.rb +248 -0
  211. data/lib/talon_one/models/change.rb +255 -0
  212. data/lib/talon_one/models/code_generator_settings.rb +225 -0
  213. data/lib/talon_one/models/coupon.rb +392 -0
  214. data/lib/talon_one/models/coupon_constraints.rb +228 -0
  215. data/lib/talon_one/models/coupon_rejection_reason.rb +251 -0
  216. data/lib/talon_one/models/coupon_reservations.rb +191 -0
  217. data/lib/talon_one/models/coupon_search.rb +189 -0
  218. data/lib/talon_one/models/coupon_value.rb +199 -0
  219. data/lib/talon_one/models/create_application_api_key.rb +204 -0
  220. data/lib/talon_one/models/customer_activity_report.rb +365 -0
  221. data/lib/talon_one/models/customer_analytics.rb +280 -0
  222. data/lib/talon_one/models/customer_profile.rb +297 -0
  223. data/lib/talon_one/models/customer_profile_search_query.rb +206 -0
  224. data/lib/talon_one/models/customer_session.rb +407 -0
  225. data/lib/talon_one/models/email_entity.rb +189 -0
  226. data/lib/talon_one/models/entity.rb +204 -0
  227. data/lib/talon_one/models/environment.rb +285 -0
  228. data/lib/talon_one/models/error_response.rb +201 -0
  229. data/lib/talon_one/models/error_source.rb +205 -0
  230. data/lib/talon_one/models/event.rb +356 -0
  231. data/lib/talon_one/models/event_type.rb +426 -0
  232. data/lib/talon_one/models/export.rb +299 -0
  233. data/lib/talon_one/models/feature_flag.rb +224 -0
  234. data/lib/talon_one/models/feature_flags.rb +220 -0
  235. data/lib/talon_one/models/features_feed.rb +193 -0
  236. data/lib/talon_one/models/func_arg_def.rb +243 -0
  237. data/lib/talon_one/models/function_def.rb +260 -0
  238. data/lib/talon_one/models/import.rb +318 -0
  239. data/lib/talon_one/models/import_coupons.rb +188 -0
  240. data/lib/talon_one/models/inline_response_200.rb +204 -0
  241. data/lib/talon_one/models/inline_response_200_1.rb +204 -0
  242. data/lib/talon_one/models/inline_response_200_10.rb +204 -0
  243. data/lib/talon_one/models/inline_response_200_11.rb +204 -0
  244. data/lib/talon_one/models/inline_response_200_12.rb +204 -0
  245. data/lib/talon_one/models/inline_response_200_13.rb +204 -0
  246. data/lib/talon_one/models/inline_response_200_14.rb +204 -0
  247. data/lib/talon_one/models/inline_response_200_15.rb +204 -0
  248. data/lib/talon_one/models/inline_response_200_16.rb +204 -0
  249. data/lib/talon_one/models/inline_response_200_17.rb +204 -0
  250. data/lib/talon_one/models/inline_response_200_18.rb +204 -0
  251. data/lib/talon_one/models/inline_response_200_19.rb +204 -0
  252. data/lib/talon_one/models/inline_response_200_2.rb +204 -0
  253. data/lib/talon_one/models/inline_response_200_20.rb +204 -0
  254. data/lib/talon_one/models/inline_response_200_21.rb +204 -0
  255. data/lib/talon_one/models/inline_response_200_22.rb +204 -0
  256. data/lib/talon_one/models/inline_response_200_23.rb +204 -0
  257. data/lib/talon_one/models/inline_response_200_24.rb +204 -0
  258. data/lib/talon_one/models/inline_response_200_25.rb +204 -0
  259. data/lib/talon_one/models/inline_response_200_26.rb +204 -0
  260. data/lib/talon_one/models/inline_response_200_27.rb +204 -0
  261. data/lib/talon_one/models/inline_response_200_28.rb +204 -0
  262. data/lib/talon_one/models/inline_response_200_3.rb +204 -0
  263. data/lib/talon_one/models/inline_response_200_4.rb +204 -0
  264. data/lib/talon_one/models/inline_response_200_5.rb +204 -0
  265. data/lib/talon_one/models/inline_response_200_6.rb +204 -0
  266. data/lib/talon_one/models/inline_response_200_7.rb +204 -0
  267. data/lib/talon_one/models/inline_response_200_8.rb +204 -0
  268. data/lib/talon_one/models/inline_response_200_9.rb +204 -0
  269. data/lib/talon_one/models/integration_entity.rb +204 -0
  270. data/lib/talon_one/models/integration_profile_entity.rb +184 -0
  271. data/lib/talon_one/models/integration_state.rb +226 -0
  272. data/lib/talon_one/models/ledger_entry.rb +320 -0
  273. data/lib/talon_one/models/library_attribute.rb +330 -0
  274. data/lib/talon_one/models/limit_config.rb +274 -0
  275. data/lib/talon_one/models/login_params.rb +205 -0
  276. data/lib/talon_one/models/loyalty.rb +192 -0
  277. data/lib/talon_one/models/loyalty_ledger.rb +202 -0
  278. data/lib/talon_one/models/loyalty_ledger_entry.rb +336 -0
  279. data/lib/talon_one/models/loyalty_membership.rb +199 -0
  280. data/lib/talon_one/models/loyalty_points.rb +220 -0
  281. data/lib/talon_one/models/loyalty_program.rb +297 -0
  282. data/lib/talon_one/models/loyalty_program_balance.rb +189 -0
  283. data/lib/talon_one/models/loyalty_program_ledgers.rb +232 -0
  284. data/lib/talon_one/models/loyalty_sub_ledger.rb +213 -0
  285. data/lib/talon_one/models/manager_config.rb +188 -0
  286. data/lib/talon_one/models/meta.rb +212 -0
  287. data/lib/talon_one/models/misc_update_user_latest_feature.rb +183 -0
  288. data/lib/talon_one/models/multi_application_entity.rb +191 -0
  289. data/lib/talon_one/models/mutable_entity.rb +189 -0
  290. data/lib/talon_one/models/new_account.rb +207 -0
  291. data/lib/talon_one/models/new_account_sign_up.rb +238 -0
  292. data/lib/talon_one/models/new_application.rb +404 -0
  293. data/lib/talon_one/models/new_application_api_key.rb +295 -0
  294. data/lib/talon_one/models/new_application_storage.rb +214 -0
  295. data/lib/talon_one/models/new_application_storage_data.rb +175 -0
  296. data/lib/talon_one/models/new_application_storage_tuple.rb +222 -0
  297. data/lib/talon_one/models/new_attribute.rb +337 -0
  298. data/lib/talon_one/models/new_campaign.rb +378 -0
  299. data/lib/talon_one/models/new_campaign_set.rb +204 -0
  300. data/lib/talon_one/models/new_coupons.rb +334 -0
  301. data/lib/talon_one/models/new_customer_profile.rb +184 -0
  302. data/lib/talon_one/models/new_customer_session.rb +295 -0
  303. data/lib/talon_one/models/new_event.rb +268 -0
  304. data/lib/talon_one/models/new_event_type.rb +396 -0
  305. data/lib/talon_one/models/new_feature_flags.rb +204 -0
  306. data/lib/talon_one/models/new_import.rb +224 -0
  307. data/lib/talon_one/models/new_invitation.rb +226 -0
  308. data/lib/talon_one/models/new_invite_email.rb +240 -0
  309. data/lib/talon_one/models/new_loyalty_program.rb +257 -0
  310. data/lib/talon_one/models/new_password.rb +222 -0
  311. data/lib/talon_one/models/new_password_email.rb +207 -0
  312. data/lib/talon_one/models/new_referral.rb +234 -0
  313. data/lib/talon_one/models/new_role.rb +232 -0
  314. data/lib/talon_one/models/new_ruleset.rb +228 -0
  315. data/lib/talon_one/models/new_template_def.rb +308 -0
  316. data/lib/talon_one/models/new_user.rb +248 -0
  317. data/lib/talon_one/models/new_webhook.rb +330 -0
  318. data/lib/talon_one/models/referral.rb +348 -0
  319. data/lib/talon_one/models/role.rb +247 -0
  320. data/lib/talon_one/models/role_assign.rb +209 -0
  321. data/lib/talon_one/models/role_membership.rb +204 -0
  322. data/lib/talon_one/models/rule.rb +245 -0
  323. data/lib/talon_one/models/ruleset.rb +299 -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_campaign.rb +373 -0
  330. data/lib/talon_one/models/update_coupon.rb +249 -0
  331. data/lib/talon_one/models/update_coupon_batch.rb +254 -0
  332. data/lib/talon_one/models/update_loyalty_program.rb +227 -0
  333. data/lib/talon_one/models/update_role.rb +216 -0
  334. data/lib/talon_one/models/update_user.rb +306 -0
  335. data/lib/talon_one/models/user.rb +381 -0
  336. data/lib/talon_one/models/user_entity.rb +189 -0
  337. data/lib/talon_one/models/webhook.rb +392 -0
  338. data/lib/talon_one/models/webhook_activation_log_entry.rb +250 -0
  339. data/lib/talon_one/models/webhook_log_entry.rb +305 -0
  340. data/lib/talon_one/version.rb +15 -0
  341. data/spec/api/integration_api_spec.rb +147 -0
  342. data/spec/api/management_api_spec.rb +1299 -0
  343. data/spec/api_client_spec.rb +226 -0
  344. data/spec/configuration_spec.rb +42 -0
  345. data/spec/models/access_log_entry_spec.rb +77 -0
  346. data/spec/models/account_analytics_spec.rb +119 -0
  347. data/spec/models/account_entity_spec.rb +41 -0
  348. data/spec/models/account_limits_spec.rb +101 -0
  349. data/spec/models/account_spec.rb +147 -0
  350. data/spec/models/api_error_spec.rb +53 -0
  351. data/spec/models/application_api_health_spec.rb +51 -0
  352. data/spec/models/application_api_key_spec.rb +77 -0
  353. data/spec/models/application_customer_entity_spec.rb +41 -0
  354. data/spec/models/application_customer_search_spec.rb +53 -0
  355. data/spec/models/application_customer_spec.rb +89 -0
  356. data/spec/models/application_entity_spec.rb +41 -0
  357. data/spec/models/application_event_spec.rb +83 -0
  358. data/spec/models/application_session_entity_spec.rb +41 -0
  359. data/spec/models/application_session_spec.rb +105 -0
  360. data/spec/models/application_spec.rb +117 -0
  361. data/spec/models/application_storage_data_spec.rb +35 -0
  362. data/spec/models/application_storage_spec.rb +83 -0
  363. data/spec/models/application_storage_tuple_spec.rb +71 -0
  364. data/spec/models/attribute_query_spec.rb +35 -0
  365. data/spec/models/attribute_spec.rb +121 -0
  366. data/spec/models/binding_spec.rb +47 -0
  367. data/spec/models/campaign_analytics_spec.rb +125 -0
  368. data/spec/models/campaign_copy_spec.rb +47 -0
  369. data/spec/models/campaign_entity_spec.rb +41 -0
  370. data/spec/models/campaign_search_spec.rb +41 -0
  371. data/spec/models/campaign_set_branch_node_spec.rb +67 -0
  372. data/spec/models/campaign_set_leaf_node_spec.rb +51 -0
  373. data/spec/models/campaign_set_node_spec.rb +41 -0
  374. data/spec/models/campaign_set_spec.rb +59 -0
  375. data/spec/models/campaign_spec.rb +181 -0
  376. data/spec/models/cart_item_adjustment_spec.rb +53 -0
  377. data/spec/models/cart_item_spec.rb +107 -0
  378. data/spec/models/change_spec.rb +71 -0
  379. data/spec/models/code_generator_settings_spec.rb +47 -0
  380. data/spec/models/coupon_constraints_spec.rb +53 -0
  381. data/spec/models/coupon_rejection_reason_spec.rb +57 -0
  382. data/spec/models/coupon_reservations_spec.rb +41 -0
  383. data/spec/models/coupon_search_spec.rb +41 -0
  384. data/spec/models/coupon_spec.rb +119 -0
  385. data/spec/models/coupon_value_spec.rb +41 -0
  386. data/spec/models/create_application_api_key_spec.rb +47 -0
  387. data/spec/models/customer_activity_report_spec.rb +113 -0
  388. data/spec/models/customer_analytics_spec.rb +77 -0
  389. data/spec/models/customer_profile_search_query_spec.rb +53 -0
  390. data/spec/models/customer_profile_spec.rb +83 -0
  391. data/spec/models/customer_session_spec.rb +117 -0
  392. data/spec/models/email_entity_spec.rb +41 -0
  393. data/spec/models/entity_spec.rb +47 -0
  394. data/spec/models/environment_spec.rb +77 -0
  395. data/spec/models/error_response_spec.rb +47 -0
  396. data/spec/models/error_source_spec.rb +53 -0
  397. data/spec/models/event_spec.rb +95 -0
  398. data/spec/models/event_type_spec.rb +115 -0
  399. data/spec/models/export_spec.rb +75 -0
  400. data/spec/models/feature_flag_spec.rb +59 -0
  401. data/spec/models/feature_flags_spec.rb +59 -0
  402. data/spec/models/features_feed_spec.rb +47 -0
  403. data/spec/models/func_arg_def_spec.rb +51 -0
  404. data/spec/models/function_def_spec.rb +65 -0
  405. data/spec/models/import_coupons_spec.rb +41 -0
  406. data/spec/models/import_spec.rb +75 -0
  407. data/spec/models/inline_response_200_10_spec.rb +47 -0
  408. data/spec/models/inline_response_200_11_spec.rb +47 -0
  409. data/spec/models/inline_response_200_12_spec.rb +47 -0
  410. data/spec/models/inline_response_200_13_spec.rb +47 -0
  411. data/spec/models/inline_response_200_14_spec.rb +47 -0
  412. data/spec/models/inline_response_200_15_spec.rb +47 -0
  413. data/spec/models/inline_response_200_16_spec.rb +47 -0
  414. data/spec/models/inline_response_200_17_spec.rb +47 -0
  415. data/spec/models/inline_response_200_18_spec.rb +47 -0
  416. data/spec/models/inline_response_200_19_spec.rb +47 -0
  417. data/spec/models/inline_response_200_1_spec.rb +47 -0
  418. data/spec/models/inline_response_200_20_spec.rb +47 -0
  419. data/spec/models/inline_response_200_21_spec.rb +47 -0
  420. data/spec/models/inline_response_200_22_spec.rb +47 -0
  421. data/spec/models/inline_response_200_23_spec.rb +47 -0
  422. data/spec/models/inline_response_200_24_spec.rb +47 -0
  423. data/spec/models/inline_response_200_25_spec.rb +47 -0
  424. data/spec/models/inline_response_200_26_spec.rb +47 -0
  425. data/spec/models/inline_response_200_27_spec.rb +47 -0
  426. data/spec/models/inline_response_200_28_spec.rb +47 -0
  427. data/spec/models/inline_response_200_2_spec.rb +47 -0
  428. data/spec/models/inline_response_200_3_spec.rb +47 -0
  429. data/spec/models/inline_response_200_4_spec.rb +47 -0
  430. data/spec/models/inline_response_200_5_spec.rb +47 -0
  431. data/spec/models/inline_response_200_6_spec.rb +47 -0
  432. data/spec/models/inline_response_200_7_spec.rb +47 -0
  433. data/spec/models/inline_response_200_8_spec.rb +47 -0
  434. data/spec/models/inline_response_200_9_spec.rb +47 -0
  435. data/spec/models/inline_response_200_spec.rb +47 -0
  436. data/spec/models/integration_entity_spec.rb +47 -0
  437. data/spec/models/integration_profile_entity_spec.rb +41 -0
  438. data/spec/models/integration_state_spec.rb +59 -0
  439. data/spec/models/ledger_entry_spec.rb +95 -0
  440. data/spec/models/library_attribute_spec.rb +85 -0
  441. data/spec/models/limit_config_spec.rb +61 -0
  442. data/spec/models/login_params_spec.rb +47 -0
  443. data/spec/models/loyalty_ledger_entry_spec.rb +99 -0
  444. data/spec/models/loyalty_ledger_spec.rb +47 -0
  445. data/spec/models/loyalty_membership_spec.rb +47 -0
  446. data/spec/models/loyalty_points_spec.rb +59 -0
  447. data/spec/models/loyalty_program_balance_spec.rb +41 -0
  448. data/spec/models/loyalty_program_ledgers_spec.rb +59 -0
  449. data/spec/models/loyalty_program_spec.rb +83 -0
  450. data/spec/models/loyalty_spec.rb +41 -0
  451. data/spec/models/loyalty_sub_ledger_spec.rb +53 -0
  452. data/spec/models/manager_config_spec.rb +41 -0
  453. data/spec/models/meta_spec.rb +59 -0
  454. data/spec/models/misc_update_user_latest_feature_spec.rb +41 -0
  455. data/spec/models/multi_application_entity_spec.rb +41 -0
  456. data/spec/models/mutable_entity_spec.rb +41 -0
  457. data/spec/models/new_account_sign_up_spec.rb +53 -0
  458. data/spec/models/new_account_spec.rb +41 -0
  459. data/spec/models/new_application_api_key_spec.rb +83 -0
  460. data/spec/models/new_application_spec.rb +87 -0
  461. data/spec/models/new_application_storage_data_spec.rb +35 -0
  462. data/spec/models/new_application_storage_spec.rb +53 -0
  463. data/spec/models/new_application_storage_tuple_spec.rb +47 -0
  464. data/spec/models/new_attribute_spec.rb +91 -0
  465. data/spec/models/new_campaign_set_spec.rb +47 -0
  466. data/spec/models/new_campaign_spec.rb +115 -0
  467. data/spec/models/new_coupons_spec.rb +89 -0
  468. data/spec/models/new_customer_profile_spec.rb +41 -0
  469. data/spec/models/new_customer_session_spec.rb +87 -0
  470. data/spec/models/new_event_spec.rb +59 -0
  471. data/spec/models/new_event_type_spec.rb +103 -0
  472. data/spec/models/new_feature_flags_spec.rb +53 -0
  473. data/spec/models/new_import_spec.rb +45 -0
  474. data/spec/models/new_invitation_spec.rb +59 -0
  475. data/spec/models/new_invite_email_spec.rb +47 -0
  476. data/spec/models/new_loyalty_program_spec.rb +71 -0
  477. data/spec/models/new_password_email_spec.rb +41 -0
  478. data/spec/models/new_password_spec.rb +47 -0
  479. data/spec/models/new_referral_spec.rb +65 -0
  480. data/spec/models/new_role_spec.rb +59 -0
  481. data/spec/models/new_ruleset_spec.rb +59 -0
  482. data/spec/models/new_template_def_spec.rb +77 -0
  483. data/spec/models/new_user_spec.rb +59 -0
  484. data/spec/models/new_webhook_spec.rb +87 -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/session_spec.rb +53 -0
  492. data/spec/models/slot_def_spec.rb +71 -0
  493. data/spec/models/template_arg_def_spec.rb +63 -0
  494. data/spec/models/template_def_spec.rb +101 -0
  495. data/spec/models/update_account_spec.rb +53 -0
  496. data/spec/models/update_campaign_spec.rb +115 -0
  497. data/spec/models/update_coupon_batch_spec.rb +65 -0
  498. data/spec/models/update_coupon_spec.rb +65 -0
  499. data/spec/models/update_loyalty_program_spec.rb +65 -0
  500. data/spec/models/update_role_spec.rb +59 -0
  501. data/spec/models/update_user_spec.rb +93 -0
  502. data/spec/models/user_entity_spec.rb +41 -0
  503. data/spec/models/user_spec.rb +111 -0
  504. data/spec/models/webhook_activation_log_entry_spec.rb +65 -0
  505. data/spec/models/webhook_log_entry_spec.rb +95 -0
  506. data/spec/models/webhook_spec.rb +111 -0
  507. data/spec/spec_helper.rb +111 -0
  508. data/talon_one.gemspec +43 -15
  509. metadata +825 -31
  510. data/.gitignore +0 -4
  511. data/.travis.yml +0 -5
  512. data/lib/integration/client.rb +0 -95
  513. data/lib/integration/client_error.rb +0 -9
  514. data/lib/integration/customer_profile.rb +0 -21
  515. data/lib/integration/effect.rb +0 -24
  516. data/lib/integration/event.rb +0 -50
  517. data/lib/integration/meta_data.rb +0 -18
  518. data/lib/integration/referral_code.rb +0 -49
  519. data/lib/integration/rule_engine_result.rb +0 -23
  520. data/lib/integration/search_profiles_result.rb +0 -17
  521. data/lib/management/client.rb +0 -116
  522. data/test/test_helper.rb +0 -20
  523. data/test/test_integration_api_live.rb +0 -94
  524. data/test/test_integration_params.rb +0 -23
@@ -0,0 +1,174 @@
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 AttributeQuery
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+ end
37
+
38
+ # Show invalid properties with the reasons. Usually used together with valid?
39
+ # @return Array for valid properties with the reasons
40
+ def list_invalid_properties
41
+ invalid_properties = Array.new
42
+ invalid_properties
43
+ end
44
+
45
+ # Check to see if the all the properties in the model are valid
46
+ # @return true if the model is valid
47
+ def valid?
48
+ true
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] Object to be compared
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class
56
+ end
57
+
58
+ # @see the `==` method
59
+ # @param [Object] Object to be compared
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculates hash code according to all attributes.
65
+ # @return [Fixnum] Hash code
66
+ def hash
67
+ [].hash
68
+ end
69
+
70
+ # Builds the object from hash
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ # @return [Object] Returns the model itself
73
+ def build_from_hash(attributes)
74
+ return nil unless attributes.is_a?(Hash)
75
+ self.class.swagger_types.each_pair do |key, type|
76
+ if type =~ /\AArray<(.*)>/i
77
+ # check to ensure the input is an array given that the the attribute
78
+ # is documented as an array but the input is not
79
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
80
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
81
+ end
82
+ elsif !attributes[self.class.attribute_map[key]].nil?
83
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
84
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
85
+ end
86
+
87
+ self
88
+ end
89
+
90
+ # Deserializes the data based on type
91
+ # @param string type Data type
92
+ # @param string value Value to be deserialized
93
+ # @return [Object] Deserialized data
94
+ def _deserialize(type, value)
95
+ case type.to_sym
96
+ when :DateTime
97
+ DateTime.parse(value)
98
+ when :Date
99
+ Date.parse(value)
100
+ when :String
101
+ value.to_s
102
+ when :Integer
103
+ value.to_i
104
+ when :Float
105
+ value.to_f
106
+ when :BOOLEAN
107
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
108
+ true
109
+ else
110
+ false
111
+ end
112
+ when :Object
113
+ # generic object (usually a Hash), return directly
114
+ value
115
+ when /\AArray<(?<inner_type>.+)>\z/
116
+ inner_type = Regexp.last_match[:inner_type]
117
+ value.map { |v| _deserialize(inner_type, v) }
118
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
119
+ k_type = Regexp.last_match[:k_type]
120
+ v_type = Regexp.last_match[:v_type]
121
+ {}.tap do |hash|
122
+ value.each do |k, v|
123
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
124
+ end
125
+ end
126
+ else # model
127
+ temp_model = TalonOne.const_get(type).new
128
+ temp_model.build_from_hash(value)
129
+ end
130
+ end
131
+
132
+ # Returns the string representation of the object
133
+ # @return [String] String presentation of the object
134
+ def to_s
135
+ to_hash.to_s
136
+ end
137
+
138
+ # to_body is an alias to to_hash (backward compatibility)
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_body
141
+ to_hash
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = self.send(attr)
150
+ next if value.nil?
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ # Outputs non-array value in the form of hash
157
+ # For object, use to_hash. Otherwise, just return the value
158
+ # @param [Object] value Any valid value
159
+ # @return [Hash] Returns the value in the form of hash
160
+ def _to_hash(value)
161
+ if value.is_a?(Array)
162
+ value.compact.map { |v| _to_hash(v) }
163
+ elsif value.is_a?(Hash)
164
+ {}.tap do |hash|
165
+ value.each { |k, v| hash[k] = _to_hash(v) }
166
+ end
167
+ elsif value.respond_to? :to_hash
168
+ value.to_hash
169
+ else
170
+ value
171
+ end
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,206 @@
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 Binding
17
+ # A descriptive name for the value to be bound.
18
+ attr_accessor :name
19
+
20
+ # A Talang expression that will be evaluated and its result attached to the name of the binding.
21
+ attr_accessor :expression
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name' => :'name',
27
+ :'expression' => :'expression'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'name' => :'String',
35
+ :'expression' => :'Array<Object>'
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?(:'name')
48
+ self.name = attributes[:'name']
49
+ end
50
+
51
+ if attributes.has_key?(:'expression')
52
+ if (value = attributes[:'expression']).is_a?(Array)
53
+ self.expression = 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 @name.nil?
63
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
64
+ end
65
+
66
+ if @expression.nil?
67
+ invalid_properties.push('invalid value for "expression", expression cannot be nil.')
68
+ end
69
+
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ return false if @name.nil?
77
+ return false if @expression.nil?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ name == o.name &&
87
+ expression == o.expression
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [name, expression].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = TalonOne.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,514 @@
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 Campaign
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
+ # The ID of the account that owns this entity.
28
+ attr_accessor :user_id
29
+
30
+ # A friendly name for this campaign.
31
+ attr_accessor :name
32
+
33
+ # A detailed description of the campaign.
34
+ attr_accessor :description
35
+
36
+ # Datetime when the campaign will become active.
37
+ attr_accessor :start_time
38
+
39
+ # Datetime when the campaign will become in-active.
40
+ attr_accessor :end_time
41
+
42
+ # Arbitrary properties associated with this campaign
43
+ attr_accessor :attributes
44
+
45
+ # A disabled or archived campaign is not evaluated for rules or coupons.
46
+ attr_accessor :state
47
+
48
+ # ID of Ruleset this campaign applies on customer session evaluation.
49
+ attr_accessor :active_ruleset_id
50
+
51
+ # A list of tags for the campaign.
52
+ attr_accessor :tags
53
+
54
+ # A list of features for the campaign.
55
+ attr_accessor :features
56
+
57
+ attr_accessor :coupon_settings
58
+
59
+ attr_accessor :referral_settings
60
+
61
+ # The set of limits that will operate for this campaign
62
+ attr_accessor :limits
63
+
64
+ # Number of coupons redeemed in the campaign.
65
+ attr_accessor :coupon_redemption_count
66
+
67
+ # Number of referral codes redeemed in the campaign.
68
+ attr_accessor :referral_redemption_count
69
+
70
+ # Total amount of discounts redeemed in the campaign.
71
+ attr_accessor :discount_count
72
+
73
+ # Timestamp of the most recent event received by this campaign.
74
+ attr_accessor :last_activity
75
+
76
+ # Timestamp of the most recent update to the campaign or any of its elements.
77
+ attr_accessor :updated
78
+
79
+ # Name of the user who created this campaign if available.
80
+ attr_accessor :created_by
81
+
82
+ # Name of the user who last updated this campaign if available.
83
+ attr_accessor :updated_by
84
+
85
+ class EnumAttributeValidator
86
+ attr_reader :datatype
87
+ attr_reader :allowable_values
88
+
89
+ def initialize(datatype, allowable_values)
90
+ @allowable_values = allowable_values.map do |value|
91
+ case datatype.to_s
92
+ when /Integer/i
93
+ value.to_i
94
+ when /Float/i
95
+ value.to_f
96
+ else
97
+ value
98
+ end
99
+ end
100
+ end
101
+
102
+ def valid?(value)
103
+ !value || allowable_values.include?(value)
104
+ end
105
+ end
106
+
107
+ # Attribute mapping from ruby-style variable name to JSON key.
108
+ def self.attribute_map
109
+ {
110
+ :'id' => :'id',
111
+ :'created' => :'created',
112
+ :'application_id' => :'applicationId',
113
+ :'user_id' => :'userId',
114
+ :'name' => :'name',
115
+ :'description' => :'description',
116
+ :'start_time' => :'startTime',
117
+ :'end_time' => :'endTime',
118
+ :'attributes' => :'attributes',
119
+ :'state' => :'state',
120
+ :'active_ruleset_id' => :'activeRulesetId',
121
+ :'tags' => :'tags',
122
+ :'features' => :'features',
123
+ :'coupon_settings' => :'couponSettings',
124
+ :'referral_settings' => :'referralSettings',
125
+ :'limits' => :'limits',
126
+ :'coupon_redemption_count' => :'couponRedemptionCount',
127
+ :'referral_redemption_count' => :'referralRedemptionCount',
128
+ :'discount_count' => :'discountCount',
129
+ :'last_activity' => :'lastActivity',
130
+ :'updated' => :'updated',
131
+ :'created_by' => :'createdBy',
132
+ :'updated_by' => :'updatedBy'
133
+ }
134
+ end
135
+
136
+ # Attribute type mapping.
137
+ def self.swagger_types
138
+ {
139
+ :'id' => :'Integer',
140
+ :'created' => :'DateTime',
141
+ :'application_id' => :'Integer',
142
+ :'user_id' => :'Integer',
143
+ :'name' => :'String',
144
+ :'description' => :'String',
145
+ :'start_time' => :'DateTime',
146
+ :'end_time' => :'DateTime',
147
+ :'attributes' => :'Object',
148
+ :'state' => :'String',
149
+ :'active_ruleset_id' => :'Integer',
150
+ :'tags' => :'Array<String>',
151
+ :'features' => :'Array<String>',
152
+ :'coupon_settings' => :'CodeGeneratorSettings',
153
+ :'referral_settings' => :'CodeGeneratorSettings',
154
+ :'limits' => :'Array<LimitConfig>',
155
+ :'coupon_redemption_count' => :'Integer',
156
+ :'referral_redemption_count' => :'Integer',
157
+ :'discount_count' => :'Integer',
158
+ :'last_activity' => :'DateTime',
159
+ :'updated' => :'DateTime',
160
+ :'created_by' => :'String',
161
+ :'updated_by' => :'String'
162
+ }
163
+ end
164
+
165
+ # Initializes the object
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ def initialize(attributes = {})
168
+ return unless attributes.is_a?(Hash)
169
+
170
+ # convert string to symbol for hash key
171
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
172
+
173
+ if attributes.has_key?(:'id')
174
+ self.id = attributes[:'id']
175
+ end
176
+
177
+ if attributes.has_key?(:'created')
178
+ self.created = attributes[:'created']
179
+ end
180
+
181
+ if attributes.has_key?(:'applicationId')
182
+ self.application_id = attributes[:'applicationId']
183
+ end
184
+
185
+ if attributes.has_key?(:'userId')
186
+ self.user_id = attributes[:'userId']
187
+ end
188
+
189
+ if attributes.has_key?(:'name')
190
+ self.name = attributes[:'name']
191
+ end
192
+
193
+ if attributes.has_key?(:'description')
194
+ self.description = attributes[:'description']
195
+ end
196
+
197
+ if attributes.has_key?(:'startTime')
198
+ self.start_time = attributes[:'startTime']
199
+ end
200
+
201
+ if attributes.has_key?(:'endTime')
202
+ self.end_time = attributes[:'endTime']
203
+ end
204
+
205
+ if attributes.has_key?(:'attributes')
206
+ self.attributes = attributes[:'attributes']
207
+ end
208
+
209
+ if attributes.has_key?(:'state')
210
+ self.state = attributes[:'state']
211
+ else
212
+ self.state = 'enabled'
213
+ end
214
+
215
+ if attributes.has_key?(:'activeRulesetId')
216
+ self.active_ruleset_id = attributes[:'activeRulesetId']
217
+ end
218
+
219
+ if attributes.has_key?(:'tags')
220
+ if (value = attributes[:'tags']).is_a?(Array)
221
+ self.tags = value
222
+ end
223
+ end
224
+
225
+ if attributes.has_key?(:'features')
226
+ if (value = attributes[:'features']).is_a?(Array)
227
+ self.features = value
228
+ end
229
+ end
230
+
231
+ if attributes.has_key?(:'couponSettings')
232
+ self.coupon_settings = attributes[:'couponSettings']
233
+ end
234
+
235
+ if attributes.has_key?(:'referralSettings')
236
+ self.referral_settings = attributes[:'referralSettings']
237
+ end
238
+
239
+ if attributes.has_key?(:'limits')
240
+ if (value = attributes[:'limits']).is_a?(Array)
241
+ self.limits = value
242
+ end
243
+ end
244
+
245
+ if attributes.has_key?(:'couponRedemptionCount')
246
+ self.coupon_redemption_count = attributes[:'couponRedemptionCount']
247
+ end
248
+
249
+ if attributes.has_key?(:'referralRedemptionCount')
250
+ self.referral_redemption_count = attributes[:'referralRedemptionCount']
251
+ end
252
+
253
+ if attributes.has_key?(:'discountCount')
254
+ self.discount_count = attributes[:'discountCount']
255
+ end
256
+
257
+ if attributes.has_key?(:'lastActivity')
258
+ self.last_activity = attributes[:'lastActivity']
259
+ end
260
+
261
+ if attributes.has_key?(:'updated')
262
+ self.updated = attributes[:'updated']
263
+ end
264
+
265
+ if attributes.has_key?(:'createdBy')
266
+ self.created_by = attributes[:'createdBy']
267
+ end
268
+
269
+ if attributes.has_key?(:'updatedBy')
270
+ self.updated_by = attributes[:'updatedBy']
271
+ end
272
+ end
273
+
274
+ # Show invalid properties with the reasons. Usually used together with valid?
275
+ # @return Array for valid properties with the reasons
276
+ def list_invalid_properties
277
+ invalid_properties = Array.new
278
+ if @id.nil?
279
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
280
+ end
281
+
282
+ if @created.nil?
283
+ invalid_properties.push('invalid value for "created", created cannot be nil.')
284
+ end
285
+
286
+ if @application_id.nil?
287
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
288
+ end
289
+
290
+ if @user_id.nil?
291
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
292
+ end
293
+
294
+ if @name.nil?
295
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
296
+ end
297
+
298
+ if @name.to_s.length < 1
299
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
300
+ end
301
+
302
+ if @description.nil?
303
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
304
+ end
305
+
306
+ if @state.nil?
307
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
308
+ end
309
+
310
+ if @tags.nil?
311
+ invalid_properties.push('invalid value for "tags", tags cannot be nil.')
312
+ end
313
+
314
+ if @features.nil?
315
+ invalid_properties.push('invalid value for "features", features cannot be nil.')
316
+ end
317
+
318
+ if @limits.nil?
319
+ invalid_properties.push('invalid value for "limits", limits cannot be nil.')
320
+ end
321
+
322
+ invalid_properties
323
+ end
324
+
325
+ # Check to see if the all the properties in the model are valid
326
+ # @return true if the model is valid
327
+ def valid?
328
+ return false if @id.nil?
329
+ return false if @created.nil?
330
+ return false if @application_id.nil?
331
+ return false if @user_id.nil?
332
+ return false if @name.nil?
333
+ return false if @name.to_s.length < 1
334
+ return false if @description.nil?
335
+ return false if @state.nil?
336
+ state_validator = EnumAttributeValidator.new('String', ['enabled', 'disabled', 'archived'])
337
+ return false unless state_validator.valid?(@state)
338
+ return false if @tags.nil?
339
+ return false if @features.nil?
340
+ return false if @limits.nil?
341
+ true
342
+ end
343
+
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] name Value to be assigned
346
+ def name=(name)
347
+ if name.nil?
348
+ fail ArgumentError, 'name cannot be nil'
349
+ end
350
+
351
+ if name.to_s.length < 1
352
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
353
+ end
354
+
355
+ @name = name
356
+ end
357
+
358
+ # Custom attribute writer method checking allowed values (enum).
359
+ # @param [Object] state Object to be assigned
360
+ def state=(state)
361
+ validator = EnumAttributeValidator.new('String', ['enabled', 'disabled', 'archived'])
362
+ unless validator.valid?(state)
363
+ fail ArgumentError, 'invalid value for "state", must be one of #{validator.allowable_values}.'
364
+ end
365
+ @state = state
366
+ end
367
+
368
+ # Checks equality by comparing each attribute.
369
+ # @param [Object] Object to be compared
370
+ def ==(o)
371
+ return true if self.equal?(o)
372
+ self.class == o.class &&
373
+ id == o.id &&
374
+ created == o.created &&
375
+ application_id == o.application_id &&
376
+ user_id == o.user_id &&
377
+ name == o.name &&
378
+ description == o.description &&
379
+ start_time == o.start_time &&
380
+ end_time == o.end_time &&
381
+ attributes == o.attributes &&
382
+ state == o.state &&
383
+ active_ruleset_id == o.active_ruleset_id &&
384
+ tags == o.tags &&
385
+ features == o.features &&
386
+ coupon_settings == o.coupon_settings &&
387
+ referral_settings == o.referral_settings &&
388
+ limits == o.limits &&
389
+ coupon_redemption_count == o.coupon_redemption_count &&
390
+ referral_redemption_count == o.referral_redemption_count &&
391
+ discount_count == o.discount_count &&
392
+ last_activity == o.last_activity &&
393
+ updated == o.updated &&
394
+ created_by == o.created_by &&
395
+ updated_by == o.updated_by
396
+ end
397
+
398
+ # @see the `==` method
399
+ # @param [Object] Object to be compared
400
+ def eql?(o)
401
+ self == o
402
+ end
403
+
404
+ # Calculates hash code according to all attributes.
405
+ # @return [Fixnum] Hash code
406
+ def hash
407
+ [id, created, application_id, user_id, name, description, start_time, end_time, attributes, state, active_ruleset_id, tags, features, coupon_settings, referral_settings, limits, coupon_redemption_count, referral_redemption_count, discount_count, last_activity, updated, created_by, updated_by].hash
408
+ end
409
+
410
+ # Builds the object from hash
411
+ # @param [Hash] attributes Model attributes in the form of hash
412
+ # @return [Object] Returns the model itself
413
+ def build_from_hash(attributes)
414
+ return nil unless attributes.is_a?(Hash)
415
+ self.class.swagger_types.each_pair do |key, type|
416
+ if type =~ /\AArray<(.*)>/i
417
+ # check to ensure the input is an array given that the the attribute
418
+ # is documented as an array but the input is not
419
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
420
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
421
+ end
422
+ elsif !attributes[self.class.attribute_map[key]].nil?
423
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
424
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
425
+ end
426
+
427
+ self
428
+ end
429
+
430
+ # Deserializes the data based on type
431
+ # @param string type Data type
432
+ # @param string value Value to be deserialized
433
+ # @return [Object] Deserialized data
434
+ def _deserialize(type, value)
435
+ case type.to_sym
436
+ when :DateTime
437
+ DateTime.parse(value)
438
+ when :Date
439
+ Date.parse(value)
440
+ when :String
441
+ value.to_s
442
+ when :Integer
443
+ value.to_i
444
+ when :Float
445
+ value.to_f
446
+ when :BOOLEAN
447
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
448
+ true
449
+ else
450
+ false
451
+ end
452
+ when :Object
453
+ # generic object (usually a Hash), return directly
454
+ value
455
+ when /\AArray<(?<inner_type>.+)>\z/
456
+ inner_type = Regexp.last_match[:inner_type]
457
+ value.map { |v| _deserialize(inner_type, v) }
458
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
459
+ k_type = Regexp.last_match[:k_type]
460
+ v_type = Regexp.last_match[:v_type]
461
+ {}.tap do |hash|
462
+ value.each do |k, v|
463
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
464
+ end
465
+ end
466
+ else # model
467
+ temp_model = TalonOne.const_get(type).new
468
+ temp_model.build_from_hash(value)
469
+ end
470
+ end
471
+
472
+ # Returns the string representation of the object
473
+ # @return [String] String presentation of the object
474
+ def to_s
475
+ to_hash.to_s
476
+ end
477
+
478
+ # to_body is an alias to to_hash (backward compatibility)
479
+ # @return [Hash] Returns the object in the form of hash
480
+ def to_body
481
+ to_hash
482
+ end
483
+
484
+ # Returns the object in the form of hash
485
+ # @return [Hash] Returns the object in the form of hash
486
+ def to_hash
487
+ hash = {}
488
+ self.class.attribute_map.each_pair do |attr, param|
489
+ value = self.send(attr)
490
+ next if value.nil?
491
+ hash[param] = _to_hash(value)
492
+ end
493
+ hash
494
+ end
495
+
496
+ # Outputs non-array value in the form of hash
497
+ # For object, use to_hash. Otherwise, just return the value
498
+ # @param [Object] value Any valid value
499
+ # @return [Hash] Returns the value in the form of hash
500
+ def _to_hash(value)
501
+ if value.is_a?(Array)
502
+ value.compact.map { |v| _to_hash(v) }
503
+ elsif value.is_a?(Hash)
504
+ {}.tap do |hash|
505
+ value.each { |k, v| hash[k] = _to_hash(v) }
506
+ end
507
+ elsif value.respond_to? :to_hash
508
+ value.to_hash
509
+ else
510
+ value
511
+ end
512
+ end
513
+ end
514
+ end