talon_one 1.3.0

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