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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +4 -0
- data/README.md +398 -57
- data/Rakefile +6 -8
- data/docs/APIError.md +10 -0
- data/docs/AccessLogEntry.md +14 -0
- data/docs/Account.md +25 -0
- data/docs/AccountAnalytics.md +21 -0
- data/docs/AccountEntity.md +8 -0
- data/docs/AccountLimits.md +18 -0
- data/docs/Application.md +20 -0
- data/docs/ApplicationAPIKey.md +14 -0
- data/docs/ApplicationApiHealth.md +9 -0
- data/docs/ApplicationCustomer.md +16 -0
- data/docs/ApplicationCustomerEntity.md +8 -0
- data/docs/ApplicationCustomerSearch.md +10 -0
- data/docs/ApplicationEntity.md +8 -0
- data/docs/ApplicationEvent.md +15 -0
- data/docs/ApplicationSession.md +18 -0
- data/docs/ApplicationSessionEntity.md +8 -0
- data/docs/ApplicationStorage.md +15 -0
- data/docs/ApplicationStorageData.md +7 -0
- data/docs/ApplicationStorageTuple.md +13 -0
- data/docs/Attribute.md +20 -0
- data/docs/AttributeQuery.md +7 -0
- data/docs/Binding.md +9 -0
- data/docs/Campaign.md +30 -0
- data/docs/CampaignAnalytics.md +22 -0
- data/docs/CampaignCopy.md +9 -0
- data/docs/CampaignEntity.md +8 -0
- data/docs/CampaignSearch.md +8 -0
- data/docs/CampaignSet.md +11 -0
- data/docs/CampaignSetBranchNode.md +11 -0
- data/docs/CampaignSetLeafNode.md +9 -0
- data/docs/CampaignSetNode.md +8 -0
- data/docs/CartItem.md +19 -0
- data/docs/CartItemAdjustment.md +10 -0
- data/docs/Change.md +13 -0
- data/docs/CodeGeneratorSettings.md +9 -0
- data/docs/Coupon.md +21 -0
- data/docs/CouponConstraints.md +10 -0
- data/docs/CouponRejectionReason.md +10 -0
- data/docs/CouponReservations.md +8 -0
- data/docs/CouponSearch.md +8 -0
- data/docs/CouponValue.md +8 -0
- data/docs/CreateApplicationAPIKey.md +9 -0
- data/docs/CustomerActivityReport.md +20 -0
- data/docs/CustomerAnalytics.md +14 -0
- data/docs/CustomerProfile.md +15 -0
- data/docs/CustomerProfileSearchQuery.md +10 -0
- data/docs/CustomerSession.md +20 -0
- data/docs/EmailEntity.md +8 -0
- data/docs/Entity.md +9 -0
- data/docs/Environment.md +14 -0
- data/docs/ErrorResponse.md +9 -0
- data/docs/ErrorSource.md +10 -0
- data/docs/Event.md +17 -0
- data/docs/EventType.md +19 -0
- data/docs/Export.md +13 -0
- data/docs/FeatureFlag.md +11 -0
- data/docs/FeatureFlags.md +11 -0
- data/docs/FeaturesFeed.md +9 -0
- data/docs/FuncArgDef.md +9 -0
- data/docs/FunctionDef.md +12 -0
- data/docs/Import.md +13 -0
- data/docs/ImportCoupons.md +8 -0
- data/docs/InlineResponse200.md +9 -0
- data/docs/InlineResponse2001.md +9 -0
- data/docs/InlineResponse20010.md +9 -0
- data/docs/InlineResponse20011.md +9 -0
- data/docs/InlineResponse20012.md +9 -0
- data/docs/InlineResponse20013.md +9 -0
- data/docs/InlineResponse20014.md +9 -0
- data/docs/InlineResponse20015.md +9 -0
- data/docs/InlineResponse20016.md +9 -0
- data/docs/InlineResponse20017.md +9 -0
- data/docs/InlineResponse20018.md +9 -0
- data/docs/InlineResponse20019.md +9 -0
- data/docs/InlineResponse2002.md +9 -0
- data/docs/InlineResponse20020.md +9 -0
- data/docs/InlineResponse20021.md +9 -0
- data/docs/InlineResponse20022.md +9 -0
- data/docs/InlineResponse20023.md +9 -0
- data/docs/InlineResponse20024.md +9 -0
- data/docs/InlineResponse20025.md +9 -0
- data/docs/InlineResponse20026.md +9 -0
- data/docs/InlineResponse20027.md +9 -0
- data/docs/InlineResponse20028.md +9 -0
- data/docs/InlineResponse2003.md +9 -0
- data/docs/InlineResponse2004.md +9 -0
- data/docs/InlineResponse2005.md +9 -0
- data/docs/InlineResponse2006.md +9 -0
- data/docs/InlineResponse2007.md +9 -0
- data/docs/InlineResponse2008.md +9 -0
- data/docs/InlineResponse2009.md +9 -0
- data/docs/IntegrationApi.md +558 -0
- data/docs/IntegrationEntity.md +9 -0
- data/docs/IntegrationProfileEntity.md +8 -0
- data/docs/IntegrationState.md +11 -0
- data/docs/LedgerEntry.md +17 -0
- data/docs/LibraryAttribute.md +14 -0
- data/docs/LimitConfig.md +10 -0
- data/docs/LoginParams.md +9 -0
- data/docs/Loyalty.md +8 -0
- data/docs/LoyaltyLedger.md +9 -0
- data/docs/LoyaltyLedgerEntry.md +17 -0
- data/docs/LoyaltyMembership.md +9 -0
- data/docs/LoyaltyPoints.md +11 -0
- data/docs/LoyaltyProgram.md +15 -0
- data/docs/LoyaltyProgramBalance.md +8 -0
- data/docs/LoyaltyProgramLedgers.md +11 -0
- data/docs/LoyaltySubLedger.md +10 -0
- data/docs/ManagementApi.md +5067 -0
- data/docs/ManagerConfig.md +8 -0
- data/docs/Meta.md +11 -0
- data/docs/MiscUpdateUserLatestFeature.md +8 -0
- data/docs/MultiApplicationEntity.md +8 -0
- data/docs/MutableEntity.md +8 -0
- data/docs/NewAccount.md +8 -0
- data/docs/NewAccountSignUp.md +10 -0
- data/docs/NewApplication.md +15 -0
- data/docs/NewApplicationAPIKey.md +15 -0
- data/docs/NewApplicationStorage.md +10 -0
- data/docs/NewApplicationStorageData.md +7 -0
- data/docs/NewApplicationStorageTuple.md +9 -0
- data/docs/NewAttribute.md +15 -0
- data/docs/NewCampaign.md +19 -0
- data/docs/NewCampaignSet.md +9 -0
- data/docs/NewCoupons.md +16 -0
- data/docs/NewCustomerProfile.md +8 -0
- data/docs/NewCustomerSession.md +15 -0
- data/docs/NewEvent.md +11 -0
- data/docs/NewEventType.md +17 -0
- data/docs/NewFeatureFlags.md +10 -0
- data/docs/NewImport.md +8 -0
- data/docs/NewInvitation.md +11 -0
- data/docs/NewInviteEmail.md +9 -0
- data/docs/NewLoyaltyProgram.md +13 -0
- data/docs/NewPassword.md +9 -0
- data/docs/NewPasswordEmail.md +8 -0
- data/docs/NewReferral.md +12 -0
- data/docs/NewRole.md +11 -0
- data/docs/NewRuleset.md +11 -0
- data/docs/NewTemplateDef.md +14 -0
- data/docs/NewUser.md +11 -0
- data/docs/NewWebhook.md +15 -0
- data/docs/Referral.md +17 -0
- data/docs/Role.md +13 -0
- data/docs/RoleAssign.md +9 -0
- data/docs/RoleMembership.md +9 -0
- data/docs/Rule.md +12 -0
- data/docs/Ruleset.md +16 -0
- data/docs/Session.md +10 -0
- data/docs/SlotDef.md +13 -0
- data/docs/TemplateArgDef.md +11 -0
- data/docs/TemplateDef.md +18 -0
- data/docs/UpdateAccount.md +10 -0
- data/docs/UpdateCampaign.md +19 -0
- data/docs/UpdateCoupon.md +12 -0
- data/docs/UpdateCouponBatch.md +12 -0
- data/docs/UpdateLoyaltyProgram.md +12 -0
- data/docs/UpdateRole.md +11 -0
- data/docs/UpdateUser.md +16 -0
- data/docs/User.md +19 -0
- data/docs/UserEntity.md +8 -0
- data/docs/Webhook.md +19 -0
- data/docs/WebhookActivationLogEntry.md +12 -0
- data/docs/WebhookLogEntry.md +17 -0
- data/fck.rb +64 -0
- data/git_push.sh +55 -0
- data/lib/talon_one.rb +200 -4
- data/lib/talon_one/api/integration_api.rb +531 -0
- data/lib/talon_one/api/management_api.rb +5520 -0
- data/lib/talon_one/api_client.rb +389 -0
- data/lib/talon_one/api_error.rb +38 -0
- data/lib/talon_one/configuration.rb +223 -0
- data/lib/talon_one/models/access_log_entry.rb +280 -0
- data/lib/talon_one/models/account.rb +462 -0
- data/lib/talon_one/models/account_analytics.rb +384 -0
- data/lib/talon_one/models/account_entity.rb +189 -0
- data/lib/talon_one/models/account_limits.rb +341 -0
- data/lib/talon_one/models/api_error.rb +213 -0
- data/lib/talon_one/models/application.rb +482 -0
- data/lib/talon_one/models/application_api_health.rb +239 -0
- data/lib/talon_one/models/application_api_key.rb +279 -0
- data/lib/talon_one/models/application_customer.rb +312 -0
- data/lib/talon_one/models/application_customer_entity.rb +184 -0
- data/lib/talon_one/models/application_customer_search.rb +206 -0
- data/lib/talon_one/models/application_entity.rb +189 -0
- data/lib/talon_one/models/application_event.rb +287 -0
- data/lib/talon_one/models/application_session.rb +368 -0
- data/lib/talon_one/models/application_session_entity.rb +189 -0
- data/lib/talon_one/models/application_storage.rb +292 -0
- data/lib/talon_one/models/application_storage_data.rb +175 -0
- data/lib/talon_one/models/application_storage_tuple.rb +283 -0
- data/lib/talon_one/models/attribute.rb +416 -0
- data/lib/talon_one/models/attribute_query.rb +174 -0
- data/lib/talon_one/models/binding.rb +206 -0
- data/lib/talon_one/models/campaign.rb +514 -0
- data/lib/talon_one/models/campaign_analytics.rb +399 -0
- data/lib/talon_one/models/campaign_copy.rb +201 -0
- data/lib/talon_one/models/campaign_entity.rb +189 -0
- data/lib/talon_one/models/campaign_search.rb +189 -0
- data/lib/talon_one/models/campaign_set.rb +234 -0
- data/lib/talon_one/models/campaign_set_branch_node.rb +282 -0
- data/lib/talon_one/models/campaign_set_leaf_node.rb +238 -0
- data/lib/talon_one/models/campaign_set_node.rb +188 -0
- data/lib/talon_one/models/cart_item.rb +365 -0
- data/lib/talon_one/models/cart_item_adjustment.rb +248 -0
- data/lib/talon_one/models/change.rb +255 -0
- data/lib/talon_one/models/code_generator_settings.rb +225 -0
- data/lib/talon_one/models/coupon.rb +392 -0
- data/lib/talon_one/models/coupon_constraints.rb +228 -0
- data/lib/talon_one/models/coupon_rejection_reason.rb +251 -0
- data/lib/talon_one/models/coupon_reservations.rb +191 -0
- data/lib/talon_one/models/coupon_search.rb +189 -0
- data/lib/talon_one/models/coupon_value.rb +199 -0
- data/lib/talon_one/models/create_application_api_key.rb +204 -0
- data/lib/talon_one/models/customer_activity_report.rb +365 -0
- data/lib/talon_one/models/customer_analytics.rb +280 -0
- data/lib/talon_one/models/customer_profile.rb +297 -0
- data/lib/talon_one/models/customer_profile_search_query.rb +206 -0
- data/lib/talon_one/models/customer_session.rb +407 -0
- data/lib/talon_one/models/email_entity.rb +189 -0
- data/lib/talon_one/models/entity.rb +204 -0
- data/lib/talon_one/models/environment.rb +285 -0
- data/lib/talon_one/models/error_response.rb +201 -0
- data/lib/talon_one/models/error_source.rb +205 -0
- data/lib/talon_one/models/event.rb +356 -0
- data/lib/talon_one/models/event_type.rb +426 -0
- data/lib/talon_one/models/export.rb +299 -0
- data/lib/talon_one/models/feature_flag.rb +224 -0
- data/lib/talon_one/models/feature_flags.rb +220 -0
- data/lib/talon_one/models/features_feed.rb +193 -0
- data/lib/talon_one/models/func_arg_def.rb +243 -0
- data/lib/talon_one/models/function_def.rb +260 -0
- data/lib/talon_one/models/import.rb +318 -0
- data/lib/talon_one/models/import_coupons.rb +188 -0
- data/lib/talon_one/models/inline_response_200.rb +204 -0
- data/lib/talon_one/models/inline_response_200_1.rb +204 -0
- data/lib/talon_one/models/inline_response_200_10.rb +204 -0
- data/lib/talon_one/models/inline_response_200_11.rb +204 -0
- data/lib/talon_one/models/inline_response_200_12.rb +204 -0
- data/lib/talon_one/models/inline_response_200_13.rb +204 -0
- data/lib/talon_one/models/inline_response_200_14.rb +204 -0
- data/lib/talon_one/models/inline_response_200_15.rb +204 -0
- data/lib/talon_one/models/inline_response_200_16.rb +204 -0
- data/lib/talon_one/models/inline_response_200_17.rb +204 -0
- data/lib/talon_one/models/inline_response_200_18.rb +204 -0
- data/lib/talon_one/models/inline_response_200_19.rb +204 -0
- data/lib/talon_one/models/inline_response_200_2.rb +204 -0
- data/lib/talon_one/models/inline_response_200_20.rb +204 -0
- data/lib/talon_one/models/inline_response_200_21.rb +204 -0
- data/lib/talon_one/models/inline_response_200_22.rb +204 -0
- data/lib/talon_one/models/inline_response_200_23.rb +204 -0
- data/lib/talon_one/models/inline_response_200_24.rb +204 -0
- data/lib/talon_one/models/inline_response_200_25.rb +204 -0
- data/lib/talon_one/models/inline_response_200_26.rb +204 -0
- data/lib/talon_one/models/inline_response_200_27.rb +204 -0
- data/lib/talon_one/models/inline_response_200_28.rb +204 -0
- data/lib/talon_one/models/inline_response_200_3.rb +204 -0
- data/lib/talon_one/models/inline_response_200_4.rb +204 -0
- data/lib/talon_one/models/inline_response_200_5.rb +204 -0
- data/lib/talon_one/models/inline_response_200_6.rb +204 -0
- data/lib/talon_one/models/inline_response_200_7.rb +204 -0
- data/lib/talon_one/models/inline_response_200_8.rb +204 -0
- data/lib/talon_one/models/inline_response_200_9.rb +204 -0
- data/lib/talon_one/models/integration_entity.rb +204 -0
- data/lib/talon_one/models/integration_profile_entity.rb +184 -0
- data/lib/talon_one/models/integration_state.rb +226 -0
- data/lib/talon_one/models/ledger_entry.rb +320 -0
- data/lib/talon_one/models/library_attribute.rb +330 -0
- data/lib/talon_one/models/limit_config.rb +274 -0
- data/lib/talon_one/models/login_params.rb +205 -0
- data/lib/talon_one/models/loyalty.rb +192 -0
- data/lib/talon_one/models/loyalty_ledger.rb +202 -0
- data/lib/talon_one/models/loyalty_ledger_entry.rb +336 -0
- data/lib/talon_one/models/loyalty_membership.rb +199 -0
- data/lib/talon_one/models/loyalty_points.rb +220 -0
- data/lib/talon_one/models/loyalty_program.rb +297 -0
- data/lib/talon_one/models/loyalty_program_balance.rb +189 -0
- data/lib/talon_one/models/loyalty_program_ledgers.rb +232 -0
- data/lib/talon_one/models/loyalty_sub_ledger.rb +213 -0
- data/lib/talon_one/models/manager_config.rb +188 -0
- data/lib/talon_one/models/meta.rb +212 -0
- data/lib/talon_one/models/misc_update_user_latest_feature.rb +183 -0
- data/lib/talon_one/models/multi_application_entity.rb +191 -0
- data/lib/talon_one/models/mutable_entity.rb +189 -0
- data/lib/talon_one/models/new_account.rb +207 -0
- data/lib/talon_one/models/new_account_sign_up.rb +238 -0
- data/lib/talon_one/models/new_application.rb +404 -0
- data/lib/talon_one/models/new_application_api_key.rb +295 -0
- data/lib/talon_one/models/new_application_storage.rb +214 -0
- data/lib/talon_one/models/new_application_storage_data.rb +175 -0
- data/lib/talon_one/models/new_application_storage_tuple.rb +222 -0
- data/lib/talon_one/models/new_attribute.rb +337 -0
- data/lib/talon_one/models/new_campaign.rb +378 -0
- data/lib/talon_one/models/new_campaign_set.rb +204 -0
- data/lib/talon_one/models/new_coupons.rb +334 -0
- data/lib/talon_one/models/new_customer_profile.rb +184 -0
- data/lib/talon_one/models/new_customer_session.rb +295 -0
- data/lib/talon_one/models/new_event.rb +268 -0
- data/lib/talon_one/models/new_event_type.rb +396 -0
- data/lib/talon_one/models/new_feature_flags.rb +204 -0
- data/lib/talon_one/models/new_import.rb +224 -0
- data/lib/talon_one/models/new_invitation.rb +226 -0
- data/lib/talon_one/models/new_invite_email.rb +240 -0
- data/lib/talon_one/models/new_loyalty_program.rb +257 -0
- data/lib/talon_one/models/new_password.rb +222 -0
- data/lib/talon_one/models/new_password_email.rb +207 -0
- data/lib/talon_one/models/new_referral.rb +234 -0
- data/lib/talon_one/models/new_role.rb +232 -0
- data/lib/talon_one/models/new_ruleset.rb +228 -0
- data/lib/talon_one/models/new_template_def.rb +308 -0
- data/lib/talon_one/models/new_user.rb +248 -0
- data/lib/talon_one/models/new_webhook.rb +330 -0
- data/lib/talon_one/models/referral.rb +348 -0
- data/lib/talon_one/models/role.rb +247 -0
- data/lib/talon_one/models/role_assign.rb +209 -0
- data/lib/talon_one/models/role_membership.rb +204 -0
- data/lib/talon_one/models/rule.rb +245 -0
- data/lib/talon_one/models/ruleset.rb +299 -0
- data/lib/talon_one/models/session.rb +219 -0
- data/lib/talon_one/models/slot_def.rb +254 -0
- data/lib/talon_one/models/template_arg_def.rb +293 -0
- data/lib/talon_one/models/template_def.rb +398 -0
- data/lib/talon_one/models/update_account.rb +233 -0
- data/lib/talon_one/models/update_campaign.rb +373 -0
- data/lib/talon_one/models/update_coupon.rb +249 -0
- data/lib/talon_one/models/update_coupon_batch.rb +254 -0
- data/lib/talon_one/models/update_loyalty_program.rb +227 -0
- data/lib/talon_one/models/update_role.rb +216 -0
- data/lib/talon_one/models/update_user.rb +306 -0
- data/lib/talon_one/models/user.rb +381 -0
- data/lib/talon_one/models/user_entity.rb +189 -0
- data/lib/talon_one/models/webhook.rb +392 -0
- data/lib/talon_one/models/webhook_activation_log_entry.rb +250 -0
- data/lib/talon_one/models/webhook_log_entry.rb +305 -0
- data/lib/talon_one/version.rb +15 -0
- data/spec/api/integration_api_spec.rb +147 -0
- data/spec/api/management_api_spec.rb +1299 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_log_entry_spec.rb +77 -0
- data/spec/models/account_analytics_spec.rb +119 -0
- data/spec/models/account_entity_spec.rb +41 -0
- data/spec/models/account_limits_spec.rb +101 -0
- data/spec/models/account_spec.rb +147 -0
- data/spec/models/api_error_spec.rb +53 -0
- data/spec/models/application_api_health_spec.rb +51 -0
- data/spec/models/application_api_key_spec.rb +77 -0
- data/spec/models/application_customer_entity_spec.rb +41 -0
- data/spec/models/application_customer_search_spec.rb +53 -0
- data/spec/models/application_customer_spec.rb +89 -0
- data/spec/models/application_entity_spec.rb +41 -0
- data/spec/models/application_event_spec.rb +83 -0
- data/spec/models/application_session_entity_spec.rb +41 -0
- data/spec/models/application_session_spec.rb +105 -0
- data/spec/models/application_spec.rb +117 -0
- data/spec/models/application_storage_data_spec.rb +35 -0
- data/spec/models/application_storage_spec.rb +83 -0
- data/spec/models/application_storage_tuple_spec.rb +71 -0
- data/spec/models/attribute_query_spec.rb +35 -0
- data/spec/models/attribute_spec.rb +121 -0
- data/spec/models/binding_spec.rb +47 -0
- data/spec/models/campaign_analytics_spec.rb +125 -0
- data/spec/models/campaign_copy_spec.rb +47 -0
- data/spec/models/campaign_entity_spec.rb +41 -0
- data/spec/models/campaign_search_spec.rb +41 -0
- data/spec/models/campaign_set_branch_node_spec.rb +67 -0
- data/spec/models/campaign_set_leaf_node_spec.rb +51 -0
- data/spec/models/campaign_set_node_spec.rb +41 -0
- data/spec/models/campaign_set_spec.rb +59 -0
- data/spec/models/campaign_spec.rb +181 -0
- data/spec/models/cart_item_adjustment_spec.rb +53 -0
- data/spec/models/cart_item_spec.rb +107 -0
- data/spec/models/change_spec.rb +71 -0
- data/spec/models/code_generator_settings_spec.rb +47 -0
- data/spec/models/coupon_constraints_spec.rb +53 -0
- data/spec/models/coupon_rejection_reason_spec.rb +57 -0
- data/spec/models/coupon_reservations_spec.rb +41 -0
- data/spec/models/coupon_search_spec.rb +41 -0
- data/spec/models/coupon_spec.rb +119 -0
- data/spec/models/coupon_value_spec.rb +41 -0
- data/spec/models/create_application_api_key_spec.rb +47 -0
- data/spec/models/customer_activity_report_spec.rb +113 -0
- data/spec/models/customer_analytics_spec.rb +77 -0
- data/spec/models/customer_profile_search_query_spec.rb +53 -0
- data/spec/models/customer_profile_spec.rb +83 -0
- data/spec/models/customer_session_spec.rb +117 -0
- data/spec/models/email_entity_spec.rb +41 -0
- data/spec/models/entity_spec.rb +47 -0
- data/spec/models/environment_spec.rb +77 -0
- data/spec/models/error_response_spec.rb +47 -0
- data/spec/models/error_source_spec.rb +53 -0
- data/spec/models/event_spec.rb +95 -0
- data/spec/models/event_type_spec.rb +115 -0
- data/spec/models/export_spec.rb +75 -0
- data/spec/models/feature_flag_spec.rb +59 -0
- data/spec/models/feature_flags_spec.rb +59 -0
- data/spec/models/features_feed_spec.rb +47 -0
- data/spec/models/func_arg_def_spec.rb +51 -0
- data/spec/models/function_def_spec.rb +65 -0
- data/spec/models/import_coupons_spec.rb +41 -0
- data/spec/models/import_spec.rb +75 -0
- data/spec/models/inline_response_200_10_spec.rb +47 -0
- data/spec/models/inline_response_200_11_spec.rb +47 -0
- data/spec/models/inline_response_200_12_spec.rb +47 -0
- data/spec/models/inline_response_200_13_spec.rb +47 -0
- data/spec/models/inline_response_200_14_spec.rb +47 -0
- data/spec/models/inline_response_200_15_spec.rb +47 -0
- data/spec/models/inline_response_200_16_spec.rb +47 -0
- data/spec/models/inline_response_200_17_spec.rb +47 -0
- data/spec/models/inline_response_200_18_spec.rb +47 -0
- data/spec/models/inline_response_200_19_spec.rb +47 -0
- data/spec/models/inline_response_200_1_spec.rb +47 -0
- data/spec/models/inline_response_200_20_spec.rb +47 -0
- data/spec/models/inline_response_200_21_spec.rb +47 -0
- data/spec/models/inline_response_200_22_spec.rb +47 -0
- data/spec/models/inline_response_200_23_spec.rb +47 -0
- data/spec/models/inline_response_200_24_spec.rb +47 -0
- data/spec/models/inline_response_200_25_spec.rb +47 -0
- data/spec/models/inline_response_200_26_spec.rb +47 -0
- data/spec/models/inline_response_200_27_spec.rb +47 -0
- data/spec/models/inline_response_200_28_spec.rb +47 -0
- data/spec/models/inline_response_200_2_spec.rb +47 -0
- data/spec/models/inline_response_200_3_spec.rb +47 -0
- data/spec/models/inline_response_200_4_spec.rb +47 -0
- data/spec/models/inline_response_200_5_spec.rb +47 -0
- data/spec/models/inline_response_200_6_spec.rb +47 -0
- data/spec/models/inline_response_200_7_spec.rb +47 -0
- data/spec/models/inline_response_200_8_spec.rb +47 -0
- data/spec/models/inline_response_200_9_spec.rb +47 -0
- data/spec/models/inline_response_200_spec.rb +47 -0
- data/spec/models/integration_entity_spec.rb +47 -0
- data/spec/models/integration_profile_entity_spec.rb +41 -0
- data/spec/models/integration_state_spec.rb +59 -0
- data/spec/models/ledger_entry_spec.rb +95 -0
- data/spec/models/library_attribute_spec.rb +85 -0
- data/spec/models/limit_config_spec.rb +61 -0
- data/spec/models/login_params_spec.rb +47 -0
- data/spec/models/loyalty_ledger_entry_spec.rb +99 -0
- data/spec/models/loyalty_ledger_spec.rb +47 -0
- data/spec/models/loyalty_membership_spec.rb +47 -0
- data/spec/models/loyalty_points_spec.rb +59 -0
- data/spec/models/loyalty_program_balance_spec.rb +41 -0
- data/spec/models/loyalty_program_ledgers_spec.rb +59 -0
- data/spec/models/loyalty_program_spec.rb +83 -0
- data/spec/models/loyalty_spec.rb +41 -0
- data/spec/models/loyalty_sub_ledger_spec.rb +53 -0
- data/spec/models/manager_config_spec.rb +41 -0
- data/spec/models/meta_spec.rb +59 -0
- data/spec/models/misc_update_user_latest_feature_spec.rb +41 -0
- data/spec/models/multi_application_entity_spec.rb +41 -0
- data/spec/models/mutable_entity_spec.rb +41 -0
- data/spec/models/new_account_sign_up_spec.rb +53 -0
- data/spec/models/new_account_spec.rb +41 -0
- data/spec/models/new_application_api_key_spec.rb +83 -0
- data/spec/models/new_application_spec.rb +87 -0
- data/spec/models/new_application_storage_data_spec.rb +35 -0
- data/spec/models/new_application_storage_spec.rb +53 -0
- data/spec/models/new_application_storage_tuple_spec.rb +47 -0
- data/spec/models/new_attribute_spec.rb +91 -0
- data/spec/models/new_campaign_set_spec.rb +47 -0
- data/spec/models/new_campaign_spec.rb +115 -0
- data/spec/models/new_coupons_spec.rb +89 -0
- data/spec/models/new_customer_profile_spec.rb +41 -0
- data/spec/models/new_customer_session_spec.rb +87 -0
- data/spec/models/new_event_spec.rb +59 -0
- data/spec/models/new_event_type_spec.rb +103 -0
- data/spec/models/new_feature_flags_spec.rb +53 -0
- data/spec/models/new_import_spec.rb +45 -0
- data/spec/models/new_invitation_spec.rb +59 -0
- data/spec/models/new_invite_email_spec.rb +47 -0
- data/spec/models/new_loyalty_program_spec.rb +71 -0
- data/spec/models/new_password_email_spec.rb +41 -0
- data/spec/models/new_password_spec.rb +47 -0
- data/spec/models/new_referral_spec.rb +65 -0
- data/spec/models/new_role_spec.rb +59 -0
- data/spec/models/new_ruleset_spec.rb +59 -0
- data/spec/models/new_template_def_spec.rb +77 -0
- data/spec/models/new_user_spec.rb +59 -0
- data/spec/models/new_webhook_spec.rb +87 -0
- data/spec/models/referral_spec.rb +95 -0
- data/spec/models/role_assign_spec.rb +47 -0
- data/spec/models/role_membership_spec.rb +47 -0
- data/spec/models/role_spec.rb +71 -0
- data/spec/models/rule_spec.rb +65 -0
- data/spec/models/ruleset_spec.rb +89 -0
- data/spec/models/session_spec.rb +53 -0
- data/spec/models/slot_def_spec.rb +71 -0
- data/spec/models/template_arg_def_spec.rb +63 -0
- data/spec/models/template_def_spec.rb +101 -0
- data/spec/models/update_account_spec.rb +53 -0
- data/spec/models/update_campaign_spec.rb +115 -0
- data/spec/models/update_coupon_batch_spec.rb +65 -0
- data/spec/models/update_coupon_spec.rb +65 -0
- data/spec/models/update_loyalty_program_spec.rb +65 -0
- data/spec/models/update_role_spec.rb +59 -0
- data/spec/models/update_user_spec.rb +93 -0
- data/spec/models/user_entity_spec.rb +41 -0
- data/spec/models/user_spec.rb +111 -0
- data/spec/models/webhook_activation_log_entry_spec.rb +65 -0
- data/spec/models/webhook_log_entry_spec.rb +95 -0
- data/spec/models/webhook_spec.rb +111 -0
- data/spec/spec_helper.rb +111 -0
- data/talon_one.gemspec +43 -15
- metadata +825 -31
- data/.gitignore +0 -4
- data/.travis.yml +0 -5
- data/lib/integration/client.rb +0 -95
- data/lib/integration/client_error.rb +0 -9
- data/lib/integration/customer_profile.rb +0 -21
- data/lib/integration/effect.rb +0 -24
- data/lib/integration/event.rb +0 -50
- data/lib/integration/meta_data.rb +0 -18
- data/lib/integration/referral_code.rb +0 -49
- data/lib/integration/rule_engine_result.rb +0 -23
- data/lib/integration/search_profiles_result.rb +0 -17
- data/lib/management/client.rb +0 -116
- data/test/test_helper.rb +0 -20
- data/test/test_integration_api_live.rb +0 -94
- data/test/test_integration_params.rb +0 -23
@@ -0,0 +1,254 @@
|
|
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 SlotDef
|
17
|
+
# The dot-separated path to this slot for use in Talang.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# The type of this slot, one of string, number, boolean, or list[type].
|
21
|
+
attr_accessor :type
|
22
|
+
|
23
|
+
# Campaigner-friendly name for the slot.
|
24
|
+
attr_accessor :title
|
25
|
+
|
26
|
+
# A short description of the slot.
|
27
|
+
attr_accessor :description
|
28
|
+
|
29
|
+
# Extended help text for the slot.
|
30
|
+
attr_accessor :help
|
31
|
+
|
32
|
+
# Whether or not this slot can be updated by rule effects.
|
33
|
+
attr_accessor :writable
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'name' => :'name',
|
39
|
+
:'type' => :'type',
|
40
|
+
:'title' => :'title',
|
41
|
+
:'description' => :'description',
|
42
|
+
:'help' => :'help',
|
43
|
+
:'writable' => :'writable'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.swagger_types
|
49
|
+
{
|
50
|
+
:'name' => :'String',
|
51
|
+
:'type' => :'String',
|
52
|
+
:'title' => :'String',
|
53
|
+
:'description' => :'String',
|
54
|
+
:'help' => :'String',
|
55
|
+
:'writable' => :'BOOLEAN'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
return unless attributes.is_a?(Hash)
|
63
|
+
|
64
|
+
# convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
66
|
+
|
67
|
+
if attributes.has_key?(:'name')
|
68
|
+
self.name = attributes[:'name']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'type')
|
72
|
+
self.type = attributes[:'type']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'title')
|
76
|
+
self.title = attributes[:'title']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'description')
|
80
|
+
self.description = attributes[:'description']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'help')
|
84
|
+
self.help = attributes[:'help']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'writable')
|
88
|
+
self.writable = attributes[:'writable']
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
93
|
+
# @return Array for valid properties with the reasons
|
94
|
+
def list_invalid_properties
|
95
|
+
invalid_properties = Array.new
|
96
|
+
if @name.nil?
|
97
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
98
|
+
end
|
99
|
+
|
100
|
+
if @type.nil?
|
101
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if @title.nil?
|
105
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @writable.nil?
|
109
|
+
invalid_properties.push('invalid value for "writable", writable cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
invalid_properties
|
113
|
+
end
|
114
|
+
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
return false if @name.nil?
|
119
|
+
return false if @type.nil?
|
120
|
+
return false if @title.nil?
|
121
|
+
return false if @writable.nil?
|
122
|
+
true
|
123
|
+
end
|
124
|
+
|
125
|
+
# Checks equality by comparing each attribute.
|
126
|
+
# @param [Object] Object to be compared
|
127
|
+
def ==(o)
|
128
|
+
return true if self.equal?(o)
|
129
|
+
self.class == o.class &&
|
130
|
+
name == o.name &&
|
131
|
+
type == o.type &&
|
132
|
+
title == o.title &&
|
133
|
+
description == o.description &&
|
134
|
+
help == o.help &&
|
135
|
+
writable == o.writable
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Fixnum] Hash code
|
146
|
+
def hash
|
147
|
+
[name, type, title, description, help, writable].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def build_from_hash(attributes)
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
155
|
+
self.class.swagger_types.each_pair do |key, type|
|
156
|
+
if type =~ /\AArray<(.*)>/i
|
157
|
+
# check to ensure the input is an array given that the the attribute
|
158
|
+
# is documented as an array but the input is not
|
159
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
160
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
161
|
+
end
|
162
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
163
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
164
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
165
|
+
end
|
166
|
+
|
167
|
+
self
|
168
|
+
end
|
169
|
+
|
170
|
+
# Deserializes the data based on type
|
171
|
+
# @param string type Data type
|
172
|
+
# @param string value Value to be deserialized
|
173
|
+
# @return [Object] Deserialized data
|
174
|
+
def _deserialize(type, value)
|
175
|
+
case type.to_sym
|
176
|
+
when :DateTime
|
177
|
+
DateTime.parse(value)
|
178
|
+
when :Date
|
179
|
+
Date.parse(value)
|
180
|
+
when :String
|
181
|
+
value.to_s
|
182
|
+
when :Integer
|
183
|
+
value.to_i
|
184
|
+
when :Float
|
185
|
+
value.to_f
|
186
|
+
when :BOOLEAN
|
187
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
188
|
+
true
|
189
|
+
else
|
190
|
+
false
|
191
|
+
end
|
192
|
+
when :Object
|
193
|
+
# generic object (usually a Hash), return directly
|
194
|
+
value
|
195
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
196
|
+
inner_type = Regexp.last_match[:inner_type]
|
197
|
+
value.map { |v| _deserialize(inner_type, v) }
|
198
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
199
|
+
k_type = Regexp.last_match[:k_type]
|
200
|
+
v_type = Regexp.last_match[:v_type]
|
201
|
+
{}.tap do |hash|
|
202
|
+
value.each do |k, v|
|
203
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
else # model
|
207
|
+
temp_model = TalonOne.const_get(type).new
|
208
|
+
temp_model.build_from_hash(value)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the string representation of the object
|
213
|
+
# @return [String] String presentation of the object
|
214
|
+
def to_s
|
215
|
+
to_hash.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_body
|
221
|
+
to_hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
next if value.nil?
|
231
|
+
hash[param] = _to_hash(value)
|
232
|
+
end
|
233
|
+
hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Outputs non-array value in the form of hash
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
238
|
+
# @param [Object] value Any valid value
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
240
|
+
def _to_hash(value)
|
241
|
+
if value.is_a?(Array)
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
243
|
+
elsif value.is_a?(Hash)
|
244
|
+
{}.tap do |hash|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
246
|
+
end
|
247
|
+
elsif value.respond_to? :to_hash
|
248
|
+
value.to_hash
|
249
|
+
else
|
250
|
+
value
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
@@ -0,0 +1,293 @@
|
|
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 TemplateArgDef
|
18
|
+
# The type of value this argument expects.
|
19
|
+
attr_accessor :type
|
20
|
+
|
21
|
+
# A campaigner-friendly description of the argument, this will also be shown in the rule editor.
|
22
|
+
attr_accessor :description
|
23
|
+
|
24
|
+
# A campaigner friendly name for the argument, this will be shown in the rule editor.
|
25
|
+
attr_accessor :title
|
26
|
+
|
27
|
+
# Arbitrary metadata that may be used to render an input for this argument.
|
28
|
+
attr_accessor :ui
|
29
|
+
|
30
|
+
class EnumAttributeValidator
|
31
|
+
attr_reader :datatype
|
32
|
+
attr_reader :allowable_values
|
33
|
+
|
34
|
+
def initialize(datatype, allowable_values)
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
36
|
+
case datatype.to_s
|
37
|
+
when /Integer/i
|
38
|
+
value.to_i
|
39
|
+
when /Float/i
|
40
|
+
value.to_f
|
41
|
+
else
|
42
|
+
value
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def valid?(value)
|
48
|
+
!value || allowable_values.include?(value)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'type' => :'type',
|
56
|
+
:'description' => :'description',
|
57
|
+
:'title' => :'title',
|
58
|
+
:'ui' => :'ui'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute type mapping.
|
63
|
+
def self.swagger_types
|
64
|
+
{
|
65
|
+
:'type' => :'String',
|
66
|
+
:'description' => :'String',
|
67
|
+
:'title' => :'String',
|
68
|
+
:'ui' => :'Object'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Initializes the object
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
74
|
+
def initialize(attributes = {})
|
75
|
+
return unless attributes.is_a?(Hash)
|
76
|
+
|
77
|
+
# convert string to symbol for hash key
|
78
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
79
|
+
|
80
|
+
if attributes.has_key?(:'type')
|
81
|
+
self.type = attributes[:'type']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'description')
|
85
|
+
self.description = attributes[:'description']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.has_key?(:'title')
|
89
|
+
self.title = attributes[:'title']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.has_key?(:'ui')
|
93
|
+
self.ui = attributes[:'ui']
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
98
|
+
# @return Array for valid properties with the reasons
|
99
|
+
def list_invalid_properties
|
100
|
+
invalid_properties = Array.new
|
101
|
+
if @type.nil?
|
102
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
103
|
+
end
|
104
|
+
|
105
|
+
if @type.to_s.length < 1
|
106
|
+
invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.')
|
107
|
+
end
|
108
|
+
|
109
|
+
if @description.nil?
|
110
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
111
|
+
end
|
112
|
+
|
113
|
+
if @title.nil?
|
114
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if @title.to_s.length < 1
|
118
|
+
invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.')
|
119
|
+
end
|
120
|
+
|
121
|
+
if @ui.nil?
|
122
|
+
invalid_properties.push('invalid value for "ui", ui cannot be nil.')
|
123
|
+
end
|
124
|
+
|
125
|
+
invalid_properties
|
126
|
+
end
|
127
|
+
|
128
|
+
# Check to see if the all the properties in the model are valid
|
129
|
+
# @return true if the model is valid
|
130
|
+
def valid?
|
131
|
+
return false if @type.nil?
|
132
|
+
type_validator = EnumAttributeValidator.new('String', ['string', 'boolean', 'number', 'time'])
|
133
|
+
return false unless type_validator.valid?(@type)
|
134
|
+
return false if @type.to_s.length < 1
|
135
|
+
return false if @description.nil?
|
136
|
+
return false if @title.nil?
|
137
|
+
return false if @title.to_s.length < 1
|
138
|
+
return false if @ui.nil?
|
139
|
+
true
|
140
|
+
end
|
141
|
+
|
142
|
+
# Custom attribute writer method checking allowed values (enum).
|
143
|
+
# @param [Object] type Object to be assigned
|
144
|
+
def type=(type)
|
145
|
+
validator = EnumAttributeValidator.new('String', ['string', 'boolean', 'number', 'time'])
|
146
|
+
unless validator.valid?(type)
|
147
|
+
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
148
|
+
end
|
149
|
+
@type = type
|
150
|
+
end
|
151
|
+
|
152
|
+
# Custom attribute writer method with validation
|
153
|
+
# @param [Object] title Value to be assigned
|
154
|
+
def title=(title)
|
155
|
+
if title.nil?
|
156
|
+
fail ArgumentError, 'title cannot be nil'
|
157
|
+
end
|
158
|
+
|
159
|
+
if title.to_s.length < 1
|
160
|
+
fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.'
|
161
|
+
end
|
162
|
+
|
163
|
+
@title = title
|
164
|
+
end
|
165
|
+
|
166
|
+
# Checks equality by comparing each attribute.
|
167
|
+
# @param [Object] Object to be compared
|
168
|
+
def ==(o)
|
169
|
+
return true if self.equal?(o)
|
170
|
+
self.class == o.class &&
|
171
|
+
type == o.type &&
|
172
|
+
description == o.description &&
|
173
|
+
title == o.title &&
|
174
|
+
ui == o.ui
|
175
|
+
end
|
176
|
+
|
177
|
+
# @see the `==` method
|
178
|
+
# @param [Object] Object to be compared
|
179
|
+
def eql?(o)
|
180
|
+
self == o
|
181
|
+
end
|
182
|
+
|
183
|
+
# Calculates hash code according to all attributes.
|
184
|
+
# @return [Fixnum] Hash code
|
185
|
+
def hash
|
186
|
+
[type, description, title, ui].hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Builds the object from hash
|
190
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
191
|
+
# @return [Object] Returns the model itself
|
192
|
+
def build_from_hash(attributes)
|
193
|
+
return nil unless attributes.is_a?(Hash)
|
194
|
+
self.class.swagger_types.each_pair do |key, type|
|
195
|
+
if type =~ /\AArray<(.*)>/i
|
196
|
+
# check to ensure the input is an array given that the the attribute
|
197
|
+
# is documented as an array but the input is not
|
198
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
199
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
200
|
+
end
|
201
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
202
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
203
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
204
|
+
end
|
205
|
+
|
206
|
+
self
|
207
|
+
end
|
208
|
+
|
209
|
+
# Deserializes the data based on type
|
210
|
+
# @param string type Data type
|
211
|
+
# @param string value Value to be deserialized
|
212
|
+
# @return [Object] Deserialized data
|
213
|
+
def _deserialize(type, value)
|
214
|
+
case type.to_sym
|
215
|
+
when :DateTime
|
216
|
+
DateTime.parse(value)
|
217
|
+
when :Date
|
218
|
+
Date.parse(value)
|
219
|
+
when :String
|
220
|
+
value.to_s
|
221
|
+
when :Integer
|
222
|
+
value.to_i
|
223
|
+
when :Float
|
224
|
+
value.to_f
|
225
|
+
when :BOOLEAN
|
226
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
227
|
+
true
|
228
|
+
else
|
229
|
+
false
|
230
|
+
end
|
231
|
+
when :Object
|
232
|
+
# generic object (usually a Hash), return directly
|
233
|
+
value
|
234
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
235
|
+
inner_type = Regexp.last_match[:inner_type]
|
236
|
+
value.map { |v| _deserialize(inner_type, v) }
|
237
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
238
|
+
k_type = Regexp.last_match[:k_type]
|
239
|
+
v_type = Regexp.last_match[:v_type]
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each do |k, v|
|
242
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
else # model
|
246
|
+
temp_model = TalonOne.const_get(type).new
|
247
|
+
temp_model.build_from_hash(value)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
# Returns the string representation of the object
|
252
|
+
# @return [String] String presentation of the object
|
253
|
+
def to_s
|
254
|
+
to_hash.to_s
|
255
|
+
end
|
256
|
+
|
257
|
+
# to_body is an alias to to_hash (backward compatibility)
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
259
|
+
def to_body
|
260
|
+
to_hash
|
261
|
+
end
|
262
|
+
|
263
|
+
# Returns the object in the form of hash
|
264
|
+
# @return [Hash] Returns the object in the form of hash
|
265
|
+
def to_hash
|
266
|
+
hash = {}
|
267
|
+
self.class.attribute_map.each_pair do |attr, param|
|
268
|
+
value = self.send(attr)
|
269
|
+
next if value.nil?
|
270
|
+
hash[param] = _to_hash(value)
|
271
|
+
end
|
272
|
+
hash
|
273
|
+
end
|
274
|
+
|
275
|
+
# Outputs non-array value in the form of hash
|
276
|
+
# For object, use to_hash. Otherwise, just return the value
|
277
|
+
# @param [Object] value Any valid value
|
278
|
+
# @return [Hash] Returns the value in the form of hash
|
279
|
+
def _to_hash(value)
|
280
|
+
if value.is_a?(Array)
|
281
|
+
value.compact.map { |v| _to_hash(v) }
|
282
|
+
elsif value.is_a?(Hash)
|
283
|
+
{}.tap do |hash|
|
284
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
285
|
+
end
|
286
|
+
elsif value.respond_to? :to_hash
|
287
|
+
value.to_hash
|
288
|
+
else
|
289
|
+
value
|
290
|
+
end
|
291
|
+
end
|
292
|
+
end
|
293
|
+
end
|