talon_one 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +29 -9
- data/docs/AccountAnalytics.md +25 -19
- data/docs/AccountLimits.md +13 -13
- data/docs/AddLoyaltyPointsEffectProps.md +4 -2
- data/docs/Application.md +9 -1
- data/docs/ApplicationAPIKey.md +8 -6
- data/docs/ApplicationCustomer.md +3 -1
- data/docs/ApplicationSession.md +1 -1
- data/docs/Audience.md +27 -0
- data/docs/AudienceMembership.md +19 -0
- data/docs/Campaign.md +2 -0
- data/docs/CampaignAnalytics.md +9 -1
- data/docs/CampaignCopy.md +1 -1
- data/docs/CampaignGroup.md +31 -0
- data/docs/CampaignGroupEntity.md +17 -0
- data/docs/CreateApplicationAPIKey.md +3 -1
- data/docs/CustomerActivityReport.md +1 -1
- data/docs/CustomerInventory.md +2 -0
- data/docs/CustomerProfile.md +3 -1
- data/docs/CustomerProfileAudienceRequest.md +17 -0
- data/docs/CustomerProfileAudienceRequestItem.md +21 -0
- data/docs/CustomerProfileIntegrationRequestV2.md +19 -0
- data/docs/CustomerSession.md +1 -1
- data/docs/CustomerSessionV2.md +1 -1
- data/docs/EntityWithTalangVisibleID.md +19 -0
- data/docs/FeedNotification.md +27 -0
- data/docs/InlineResponse20012.md +3 -1
- data/docs/IntegrationApi.md +139 -18
- data/docs/IntegrationEntity.md +1 -1
- data/docs/LoyaltyLedgerEntry.md +2 -0
- data/docs/LoyaltyPoints.md +4 -2
- data/docs/LoyaltyProgram.md +3 -1
- data/docs/LoyaltyStatistics.md +23 -0
- data/docs/LoyaltySubLedger.md +18 -4
- data/docs/ManagementApi.md +75 -10
- data/docs/Meta.md +1 -1
- data/docs/MultipleCustomerProfileIntegrationRequest.md +17 -0
- data/docs/MultipleCustomerProfileIntegrationRequestItem.md +19 -0
- data/docs/MultipleCustomerProfileIntegrationResponseV2.md +17 -0
- data/docs/NewApplication.md +9 -1
- data/docs/NewApplicationAPIKey.md +7 -5
- data/docs/NewAudience.md +21 -0
- data/docs/NewCampaign.md +3 -1
- data/docs/NewCampaignGroup.md +23 -0
- data/docs/NewLoyaltyProgram.md +3 -1
- data/docs/Role.md +3 -1
- data/docs/SetDiscountEffectProps.md +3 -1
- data/docs/SetDiscountPerItemEffectProps.md +3 -1
- data/docs/UpdateApplication.md +10 -2
- data/docs/UpdateAudience.md +17 -0
- data/docs/UpdateCampaign.md +3 -1
- data/docs/UpdateCampaignGroup.md +23 -0
- data/docs/UpdateLoyaltyProgram.md +3 -1
- data/docs/UpdateUser.md +0 -4
- data/docs/UpdateUserLatestFeedTimestamp.md +17 -0
- data/docs/User.md +3 -5
- data/docs/UserFeedNotifications.md +19 -0
- data/lib/talon_one.rb +20 -3
- data/lib/talon_one/api/integration_api.rb +163 -25
- data/lib/talon_one/api/management_api.rb +86 -14
- data/lib/talon_one/api_client.rb +8 -6
- data/lib/talon_one/api_error.rb +1 -1
- data/lib/talon_one/configuration.rb +1 -1
- data/lib/talon_one/models/accept_coupon_effect_props.rb +1 -1
- data/lib/talon_one/models/accept_referral_effect_props.rb +1 -1
- data/lib/talon_one/models/access_log_entry.rb +1 -1
- data/lib/talon_one/models/account.rb +1 -1
- data/lib/talon_one/models/account_additional_cost.rb +1 -1
- data/lib/talon_one/models/account_analytics.rb +102 -57
- data/lib/talon_one/models/account_entity.rb +1 -1
- data/lib/talon_one/models/account_limits.rb +28 -23
- data/lib/talon_one/models/add_free_item_effect_props.rb +1 -1
- data/lib/talon_one/models/add_loyalty_points_effect_props.rb +19 -14
- data/lib/talon_one/models/additional_cost.rb +1 -1
- data/lib/talon_one/models/api_error.rb +1 -1
- data/lib/talon_one/models/application.rb +55 -3
- data/lib/talon_one/models/application_api_health.rb +1 -1
- data/lib/talon_one/models/application_api_key.rb +79 -34
- data/lib/talon_one/models/application_customer.rb +15 -3
- data/lib/talon_one/models/application_customer_entity.rb +1 -1
- data/lib/talon_one/models/application_customer_search.rb +1 -1
- data/lib/talon_one/models/application_entity.rb +1 -1
- data/lib/talon_one/models/application_event.rb +1 -1
- data/lib/talon_one/models/application_session.rb +2 -2
- data/lib/talon_one/models/application_session_entity.rb +1 -1
- data/lib/talon_one/models/attribute.rb +1 -1
- data/lib/talon_one/models/attributes_mandatory.rb +1 -1
- data/lib/talon_one/models/attributes_settings.rb +1 -1
- data/lib/talon_one/models/audience.rb +360 -0
- data/lib/talon_one/models/audience_membership.rb +227 -0
- data/lib/talon_one/models/base_saml_connection.rb +1 -1
- data/lib/talon_one/models/binding.rb +1 -1
- data/lib/talon_one/models/campaign.rb +14 -2
- data/lib/talon_one/models/campaign_analytics.rb +65 -5
- data/lib/talon_one/models/campaign_copy.rb +2 -2
- data/lib/talon_one/models/campaign_entity.rb +1 -1
- data/lib/talon_one/models/campaign_group.rb +326 -0
- data/lib/talon_one/models/campaign_group_entity.rb +209 -0
- data/lib/talon_one/models/campaign_search.rb +1 -1
- data/lib/talon_one/models/campaign_set.rb +1 -1
- data/lib/talon_one/models/campaign_set_branch_node.rb +1 -1
- data/lib/talon_one/models/campaign_set_leaf_node.rb +1 -1
- data/lib/talon_one/models/campaign_set_node.rb +1 -1
- data/lib/talon_one/models/cart_item.rb +1 -1
- data/lib/talon_one/models/cart_item_adjustment.rb +1 -1
- data/lib/talon_one/models/change.rb +1 -1
- data/lib/talon_one/models/change_profile_password.rb +1 -1
- data/lib/talon_one/models/code_generator_settings.rb +1 -1
- data/lib/talon_one/models/coupon.rb +1 -1
- data/lib/talon_one/models/coupon_constraints.rb +1 -1
- data/lib/talon_one/models/coupon_created_effect_props.rb +1 -1
- data/lib/talon_one/models/coupon_rejection_reason.rb +3 -3
- data/lib/talon_one/models/coupon_reservations.rb +1 -1
- data/lib/talon_one/models/coupon_search.rb +1 -1
- data/lib/talon_one/models/coupon_value.rb +1 -1
- data/lib/talon_one/models/create_application_api_key.rb +49 -5
- data/lib/talon_one/models/customer_activity_report.rb +2 -2
- data/lib/talon_one/models/customer_analytics.rb +1 -1
- data/lib/talon_one/models/customer_inventory.rb +11 -2
- data/lib/talon_one/models/customer_profile.rb +15 -3
- data/lib/talon_one/models/{misc_update_user_latest_feature.rb → customer_profile_audience_request.rb} +13 -11
- data/lib/talon_one/models/customer_profile_audience_request_item.rb +273 -0
- data/lib/talon_one/models/customer_profile_integration_request_v2.rb +242 -0
- data/lib/talon_one/models/customer_profile_search_query.rb +1 -1
- data/lib/talon_one/models/customer_session.rb +2 -2
- data/lib/talon_one/models/customer_session_v2.rb +2 -2
- data/lib/talon_one/models/deduct_loyalty_points_effect_props.rb +1 -1
- data/lib/talon_one/models/effect.rb +1 -1
- data/lib/talon_one/models/effect_entity.rb +1 -1
- data/lib/talon_one/models/email_entity.rb +1 -1
- data/lib/talon_one/models/entity.rb +1 -1
- data/lib/talon_one/models/entity_with_talang_visible_id.rb +227 -0
- data/lib/talon_one/models/environment.rb +1 -1
- data/lib/talon_one/models/error_effect_props.rb +1 -1
- data/lib/talon_one/models/error_response.rb +1 -1
- data/lib/talon_one/models/error_source.rb +1 -1
- data/lib/talon_one/models/event.rb +1 -1
- data/lib/talon_one/models/event_type.rb +1 -1
- data/lib/talon_one/models/export.rb +1 -1
- data/lib/talon_one/models/feature_flag.rb +1 -1
- data/lib/talon_one/models/feature_flags.rb +1 -1
- data/lib/talon_one/models/features_feed.rb +1 -1
- data/lib/talon_one/models/feed_notification.rb +322 -0
- data/lib/talon_one/models/func_arg_def.rb +1 -1
- data/lib/talon_one/models/function_def.rb +1 -1
- data/lib/talon_one/models/import.rb +1 -1
- data/lib/talon_one/models/import_coupons.rb +1 -1
- data/lib/talon_one/models/inline_response200.rb +1 -1
- data/lib/talon_one/models/inline_response2001.rb +1 -1
- data/lib/talon_one/models/inline_response20010.rb +1 -1
- data/lib/talon_one/models/inline_response20011.rb +1 -1
- data/lib/talon_one/models/inline_response20012.rb +11 -7
- data/lib/talon_one/models/inline_response20013.rb +1 -1
- data/lib/talon_one/models/inline_response20014.rb +1 -1
- data/lib/talon_one/models/inline_response20015.rb +1 -1
- data/lib/talon_one/models/inline_response20016.rb +1 -1
- data/lib/talon_one/models/inline_response20017.rb +1 -1
- data/lib/talon_one/models/inline_response20018.rb +1 -1
- data/lib/talon_one/models/inline_response20019.rb +1 -1
- data/lib/talon_one/models/inline_response2002.rb +1 -1
- data/lib/talon_one/models/inline_response20020.rb +1 -1
- data/lib/talon_one/models/inline_response20021.rb +1 -1
- data/lib/talon_one/models/inline_response20022.rb +1 -1
- data/lib/talon_one/models/inline_response20023.rb +1 -1
- data/lib/talon_one/models/inline_response20024.rb +1 -1
- data/lib/talon_one/models/inline_response20025.rb +1 -1
- data/lib/talon_one/models/inline_response20026.rb +1 -1
- data/lib/talon_one/models/inline_response20027.rb +1 -1
- data/lib/talon_one/models/inline_response20028.rb +1 -1
- data/lib/talon_one/models/inline_response20029.rb +1 -1
- data/lib/talon_one/models/inline_response2003.rb +1 -1
- data/lib/talon_one/models/inline_response20030.rb +1 -1
- data/lib/talon_one/models/inline_response2004.rb +1 -1
- data/lib/talon_one/models/inline_response2005.rb +1 -1
- data/lib/talon_one/models/inline_response2006.rb +1 -1
- data/lib/talon_one/models/inline_response2007.rb +1 -1
- data/lib/talon_one/models/inline_response2008.rb +1 -1
- data/lib/talon_one/models/inline_response2009.rb +1 -1
- data/lib/talon_one/models/integration_entity.rb +2 -2
- data/lib/talon_one/models/integration_event.rb +1 -1
- data/lib/talon_one/models/integration_profile_entity.rb +1 -1
- data/lib/talon_one/models/integration_request.rb +1 -1
- data/lib/talon_one/models/integration_state.rb +1 -1
- data/lib/talon_one/models/integration_state_v2.rb +1 -1
- data/lib/talon_one/models/ledger_entry.rb +1 -1
- data/lib/talon_one/models/library_attribute.rb +1 -1
- data/lib/talon_one/models/limit_config.rb +1 -1
- data/lib/talon_one/models/login_params.rb +1 -1
- data/lib/talon_one/models/loyalty.rb +1 -1
- data/lib/talon_one/models/loyalty_ledger.rb +1 -1
- data/lib/talon_one/models/loyalty_ledger_entry.rb +11 -2
- data/lib/talon_one/models/loyalty_membership.rb +1 -1
- data/lib/talon_one/models/loyalty_points.rb +19 -9
- data/lib/talon_one/models/loyalty_program.rb +18 -3
- data/lib/talon_one/models/loyalty_program_balance.rb +1 -1
- data/lib/talon_one/models/loyalty_program_ledgers.rb +1 -1
- data/lib/talon_one/models/loyalty_statistics.rb +258 -0
- data/lib/talon_one/models/loyalty_sub_ledger.rb +104 -7
- data/lib/talon_one/models/manager_config.rb +1 -1
- data/lib/talon_one/models/meta.rb +2 -1
- data/lib/talon_one/models/multi_application_entity.rb +1 -1
- data/lib/talon_one/models/multiple_customer_profile_integration_request.rb +208 -0
- data/lib/talon_one/models/multiple_customer_profile_integration_request_item.rb +223 -0
- data/lib/talon_one/models/{customer_profile_update.rb → multiple_customer_profile_integration_response_v2.rb} +13 -16
- data/lib/talon_one/models/mutable_entity.rb +1 -1
- data/lib/talon_one/models/new_account.rb +1 -1
- data/lib/talon_one/models/new_account_sign_up.rb +1 -1
- data/lib/talon_one/models/new_additional_cost.rb +1 -1
- data/lib/talon_one/models/new_application.rb +55 -3
- data/lib/talon_one/models/new_application_api_key.rb +76 -32
- data/lib/talon_one/models/new_attribute.rb +1 -1
- data/lib/talon_one/models/new_audience.rb +314 -0
- data/lib/talon_one/models/new_campaign.rb +17 -5
- data/lib/talon_one/models/new_campaign_group.rb +265 -0
- data/lib/talon_one/models/new_campaign_set.rb +1 -1
- data/lib/talon_one/models/new_coupons.rb +1 -1
- data/lib/talon_one/models/new_customer_profile.rb +1 -1
- data/lib/talon_one/models/new_customer_session.rb +1 -1
- data/lib/talon_one/models/new_customer_session_v2.rb +1 -1
- data/lib/talon_one/models/new_event.rb +1 -1
- data/lib/talon_one/models/new_event_type.rb +1 -1
- data/lib/talon_one/models/new_feature_flags.rb +1 -1
- data/lib/talon_one/models/new_import.rb +1 -1
- data/lib/talon_one/models/new_invitation.rb +1 -1
- data/lib/talon_one/models/new_invite_email.rb +1 -1
- data/lib/talon_one/models/new_loyalty_program.rb +18 -3
- data/lib/talon_one/models/new_password.rb +1 -1
- data/lib/talon_one/models/new_password_email.rb +1 -1
- data/lib/talon_one/models/new_referral.rb +1 -1
- data/lib/talon_one/models/new_role.rb +1 -1
- data/lib/talon_one/models/new_ruleset.rb +1 -1
- data/lib/talon_one/models/new_saml_connection.rb +1 -1
- data/lib/talon_one/models/new_template_def.rb +1 -1
- data/lib/talon_one/models/new_user.rb +1 -1
- data/lib/talon_one/models/new_webhook.rb +1 -1
- data/lib/talon_one/models/notification.rb +1 -1
- data/lib/talon_one/models/redeem_referral_effect_props.rb +1 -1
- data/lib/talon_one/models/referral.rb +1 -1
- data/lib/talon_one/models/referral_created_effect_props.rb +1 -1
- data/lib/talon_one/models/referral_rejection_reason.rb +3 -3
- data/lib/talon_one/models/reject_coupon_effect_props.rb +1 -1
- data/lib/talon_one/models/reject_referral_effect_props.rb +1 -1
- data/lib/talon_one/models/role.rb +14 -4
- data/lib/talon_one/models/role_assign.rb +1 -1
- data/lib/talon_one/models/role_membership.rb +1 -1
- data/lib/talon_one/models/rollback_coupon_effect_props.rb +1 -1
- data/lib/talon_one/models/rollback_discount_effect_props.rb +1 -1
- data/lib/talon_one/models/rule.rb +1 -1
- data/lib/talon_one/models/ruleset.rb +1 -1
- data/lib/talon_one/models/saml_connection.rb +1 -1
- data/lib/talon_one/models/saml_connection_metadata.rb +1 -1
- data/lib/talon_one/models/saml_login_endpoint.rb +1 -1
- data/lib/talon_one/models/session.rb +1 -1
- data/lib/talon_one/models/set_discount_effect_props.rb +16 -6
- data/lib/talon_one/models/set_discount_per_item_effect_props.rb +15 -5
- data/lib/talon_one/models/show_bundle_metadata_effect_props.rb +1 -1
- data/lib/talon_one/models/show_notification_effect_props.rb +1 -1
- data/lib/talon_one/models/slot_def.rb +1 -1
- data/lib/talon_one/models/template_arg_def.rb +1 -1
- data/lib/talon_one/models/template_def.rb +1 -1
- data/lib/talon_one/models/trigger_webhook_effect_props.rb +1 -1
- data/lib/talon_one/models/update_account.rb +1 -1
- data/lib/talon_one/models/update_application.rb +58 -6
- data/lib/talon_one/models/update_attribute_effect_props.rb +1 -1
- data/lib/talon_one/models/update_audience.rb +231 -0
- data/lib/talon_one/models/update_campaign.rb +17 -5
- data/lib/talon_one/models/update_campaign_group.rb +266 -0
- data/lib/talon_one/models/update_coupon.rb +1 -1
- data/lib/talon_one/models/update_coupon_batch.rb +1 -1
- data/lib/talon_one/models/update_loyalty_program.rb +13 -3
- data/lib/talon_one/models/update_role.rb +1 -1
- data/lib/talon_one/models/update_user.rb +2 -22
- data/lib/talon_one/models/update_user_latest_feed_timestamp.rb +213 -0
- data/lib/talon_one/models/user.rb +11 -26
- data/lib/talon_one/models/user_entity.rb +1 -1
- data/lib/talon_one/models/user_feed_notifications.rb +230 -0
- data/lib/talon_one/models/webhook.rb +1 -1
- data/lib/talon_one/models/webhook_activation_log_entry.rb +1 -1
- data/lib/talon_one/models/webhook_log_entry.rb +1 -1
- data/lib/talon_one/version.rb +2 -2
- data/spec/api/integration_api_spec.rb +36 -8
- data/spec/api/management_api_spec.rb +19 -3
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/accept_coupon_effect_props_spec.rb +1 -1
- data/spec/models/accept_referral_effect_props_spec.rb +1 -1
- data/spec/models/access_log_entry_spec.rb +1 -1
- data/spec/models/account_additional_cost_spec.rb +1 -1
- data/spec/models/account_analytics_spec.rb +27 -9
- data/spec/models/account_entity_spec.rb +1 -1
- data/spec/models/account_limits_spec.rb +7 -7
- data/spec/models/account_spec.rb +1 -1
- data/spec/models/add_free_item_effect_props_spec.rb +1 -1
- data/spec/models/add_loyalty_points_effect_props_spec.rb +8 -2
- data/spec/models/additional_cost_spec.rb +1 -1
- data/spec/models/api_error_spec.rb +1 -1
- data/spec/models/application_api_health_spec.rb +1 -1
- data/spec/models/application_api_key_spec.rb +18 -8
- data/spec/models/application_customer_entity_spec.rb +1 -1
- data/spec/models/application_customer_search_spec.rb +1 -1
- data/spec/models/application_customer_spec.rb +7 -1
- data/spec/models/application_entity_spec.rb +1 -1
- data/spec/models/application_event_spec.rb +1 -1
- data/spec/models/application_session_entity_spec.rb +1 -1
- data/spec/models/application_session_spec.rb +1 -1
- data/spec/models/application_spec.rb +29 -1
- data/spec/models/attribute_spec.rb +1 -1
- data/spec/models/attributes_mandatory_spec.rb +1 -1
- data/spec/models/attributes_settings_spec.rb +1 -1
- data/spec/models/audience_membership_spec.rb +47 -0
- data/spec/models/audience_spec.rb +75 -0
- data/spec/models/base_saml_connection_spec.rb +1 -1
- data/spec/models/binding_spec.rb +1 -1
- data/spec/models/campaign_analytics_spec.rb +25 -1
- data/spec/models/campaign_copy_spec.rb +1 -1
- data/spec/models/campaign_entity_spec.rb +1 -1
- data/spec/models/{misc_update_user_latest_feature_spec.rb → campaign_group_entity_spec.rb} +8 -8
- data/spec/models/campaign_group_spec.rb +83 -0
- data/spec/models/campaign_search_spec.rb +1 -1
- data/spec/models/campaign_set_branch_node_spec.rb +1 -1
- data/spec/models/campaign_set_leaf_node_spec.rb +1 -1
- data/spec/models/campaign_set_node_spec.rb +1 -1
- data/spec/models/campaign_set_spec.rb +1 -1
- data/spec/models/campaign_spec.rb +7 -1
- data/spec/models/cart_item_adjustment_spec.rb +1 -1
- data/spec/models/cart_item_spec.rb +1 -1
- data/spec/models/change_profile_password_spec.rb +1 -1
- data/spec/models/change_spec.rb +1 -1
- data/spec/models/code_generator_settings_spec.rb +1 -1
- data/spec/models/coupon_constraints_spec.rb +1 -1
- data/spec/models/coupon_created_effect_props_spec.rb +1 -1
- data/spec/models/coupon_rejection_reason_spec.rb +2 -2
- data/spec/models/coupon_reservations_spec.rb +1 -1
- data/spec/models/coupon_search_spec.rb +1 -1
- data/spec/models/coupon_spec.rb +1 -1
- data/spec/models/coupon_value_spec.rb +1 -1
- data/spec/models/create_application_api_key_spec.rb +11 -1
- data/spec/models/customer_activity_report_spec.rb +1 -1
- data/spec/models/customer_analytics_spec.rb +1 -1
- data/spec/models/customer_inventory_spec.rb +7 -1
- data/spec/models/customer_profile_audience_request_item_spec.rb +57 -0
- data/spec/models/{customer_profile_update_spec.rb → customer_profile_audience_request_spec.rb} +8 -8
- data/spec/models/customer_profile_integration_request_v2_spec.rb +51 -0
- data/spec/models/customer_profile_search_query_spec.rb +1 -1
- data/spec/models/customer_profile_spec.rb +7 -1
- data/spec/models/customer_session_spec.rb +1 -1
- data/spec/models/customer_session_v2_spec.rb +1 -1
- data/spec/models/deduct_loyalty_points_effect_props_spec.rb +1 -1
- data/spec/models/effect_entity_spec.rb +1 -1
- data/spec/models/effect_spec.rb +1 -1
- data/spec/models/email_entity_spec.rb +1 -1
- data/spec/models/entity_spec.rb +1 -1
- data/spec/models/entity_with_talang_visible_id_spec.rb +47 -0
- data/spec/models/environment_spec.rb +1 -1
- data/spec/models/error_effect_props_spec.rb +1 -1
- data/spec/models/error_response_spec.rb +1 -1
- data/spec/models/error_source_spec.rb +1 -1
- data/spec/models/event_spec.rb +1 -1
- data/spec/models/event_type_spec.rb +1 -1
- data/spec/models/export_spec.rb +1 -1
- data/spec/models/feature_flag_spec.rb +1 -1
- data/spec/models/feature_flags_spec.rb +1 -1
- data/spec/models/features_feed_spec.rb +1 -1
- data/spec/models/feed_notification_spec.rb +75 -0
- data/spec/models/func_arg_def_spec.rb +1 -1
- data/spec/models/function_def_spec.rb +1 -1
- data/spec/models/import_coupons_spec.rb +1 -1
- data/spec/models/import_spec.rb +1 -1
- data/spec/models/inline_response20010_spec.rb +1 -1
- data/spec/models/inline_response20011_spec.rb +1 -1
- data/spec/models/inline_response20012_spec.rb +7 -1
- data/spec/models/inline_response20013_spec.rb +1 -1
- data/spec/models/inline_response20014_spec.rb +1 -1
- data/spec/models/inline_response20015_spec.rb +1 -1
- data/spec/models/inline_response20016_spec.rb +1 -1
- data/spec/models/inline_response20017_spec.rb +1 -1
- data/spec/models/inline_response20018_spec.rb +1 -1
- data/spec/models/inline_response20019_spec.rb +1 -1
- data/spec/models/inline_response2001_spec.rb +1 -1
- data/spec/models/inline_response20020_spec.rb +1 -1
- data/spec/models/inline_response20021_spec.rb +1 -1
- data/spec/models/inline_response20022_spec.rb +1 -1
- data/spec/models/inline_response20023_spec.rb +1 -1
- data/spec/models/inline_response20024_spec.rb +1 -1
- data/spec/models/inline_response20025_spec.rb +1 -1
- data/spec/models/inline_response20026_spec.rb +1 -1
- data/spec/models/inline_response20027_spec.rb +1 -1
- data/spec/models/inline_response20028_spec.rb +1 -1
- data/spec/models/inline_response20029_spec.rb +1 -1
- data/spec/models/inline_response2002_spec.rb +1 -1
- data/spec/models/inline_response20030_spec.rb +1 -1
- data/spec/models/inline_response2003_spec.rb +1 -1
- data/spec/models/inline_response2004_spec.rb +1 -1
- data/spec/models/inline_response2005_spec.rb +1 -1
- data/spec/models/inline_response2006_spec.rb +1 -1
- data/spec/models/inline_response2007_spec.rb +1 -1
- data/spec/models/inline_response2008_spec.rb +1 -1
- data/spec/models/inline_response2009_spec.rb +1 -1
- data/spec/models/inline_response200_spec.rb +1 -1
- data/spec/models/integration_entity_spec.rb +1 -1
- data/spec/models/integration_event_spec.rb +1 -1
- data/spec/models/integration_profile_entity_spec.rb +1 -1
- data/spec/models/integration_request_spec.rb +1 -1
- data/spec/models/integration_state_spec.rb +1 -1
- data/spec/models/integration_state_v2_spec.rb +1 -1
- data/spec/models/ledger_entry_spec.rb +1 -1
- data/spec/models/library_attribute_spec.rb +1 -1
- data/spec/models/limit_config_spec.rb +1 -1
- data/spec/models/login_params_spec.rb +1 -1
- data/spec/models/loyalty_ledger_entry_spec.rb +7 -1
- data/spec/models/loyalty_ledger_spec.rb +1 -1
- data/spec/models/loyalty_membership_spec.rb +1 -1
- data/spec/models/loyalty_points_spec.rb +8 -2
- data/spec/models/loyalty_program_balance_spec.rb +1 -1
- data/spec/models/loyalty_program_ledgers_spec.rb +1 -1
- data/spec/models/loyalty_program_spec.rb +7 -1
- data/spec/models/loyalty_spec.rb +1 -1
- data/spec/models/loyalty_statistics_spec.rb +59 -0
- data/spec/models/loyalty_sub_ledger_spec.rb +43 -1
- data/spec/models/manager_config_spec.rb +1 -1
- data/spec/models/meta_spec.rb +1 -1
- data/spec/models/multi_application_entity_spec.rb +1 -1
- data/spec/models/multiple_customer_profile_integration_request_item_spec.rb +47 -0
- data/spec/models/multiple_customer_profile_integration_request_spec.rb +41 -0
- data/spec/models/multiple_customer_profile_integration_response_v2_spec.rb +41 -0
- data/spec/models/mutable_entity_spec.rb +1 -1
- data/spec/models/new_account_sign_up_spec.rb +1 -1
- data/spec/models/new_account_spec.rb +1 -1
- data/spec/models/new_additional_cost_spec.rb +1 -1
- data/spec/models/new_application_api_key_spec.rb +18 -8
- data/spec/models/new_application_spec.rb +29 -1
- data/spec/models/new_attribute_spec.rb +1 -1
- data/spec/models/new_audience_spec.rb +57 -0
- data/spec/models/new_campaign_group_spec.rb +59 -0
- data/spec/models/new_campaign_set_spec.rb +1 -1
- data/spec/models/new_campaign_spec.rb +7 -1
- data/spec/models/new_coupons_spec.rb +1 -1
- data/spec/models/new_customer_profile_spec.rb +1 -1
- data/spec/models/new_customer_session_spec.rb +1 -1
- data/spec/models/new_customer_session_v2_spec.rb +1 -1
- data/spec/models/new_event_spec.rb +1 -1
- data/spec/models/new_event_type_spec.rb +1 -1
- data/spec/models/new_feature_flags_spec.rb +1 -1
- data/spec/models/new_import_spec.rb +1 -1
- data/spec/models/new_invitation_spec.rb +1 -1
- data/spec/models/new_invite_email_spec.rb +1 -1
- data/spec/models/new_loyalty_program_spec.rb +7 -1
- data/spec/models/new_password_email_spec.rb +1 -1
- data/spec/models/new_password_spec.rb +1 -1
- data/spec/models/new_referral_spec.rb +1 -1
- data/spec/models/new_role_spec.rb +1 -1
- data/spec/models/new_ruleset_spec.rb +1 -1
- data/spec/models/new_saml_connection_spec.rb +1 -1
- data/spec/models/new_template_def_spec.rb +1 -1
- data/spec/models/new_user_spec.rb +1 -1
- data/spec/models/new_webhook_spec.rb +1 -1
- data/spec/models/notification_spec.rb +1 -1
- data/spec/models/redeem_referral_effect_props_spec.rb +1 -1
- data/spec/models/referral_created_effect_props_spec.rb +1 -1
- data/spec/models/referral_rejection_reason_spec.rb +2 -2
- data/spec/models/referral_spec.rb +1 -1
- data/spec/models/reject_coupon_effect_props_spec.rb +1 -1
- data/spec/models/reject_referral_effect_props_spec.rb +1 -1
- data/spec/models/role_assign_spec.rb +1 -1
- data/spec/models/role_membership_spec.rb +1 -1
- data/spec/models/role_spec.rb +7 -1
- data/spec/models/rollback_coupon_effect_props_spec.rb +1 -1
- data/spec/models/rollback_discount_effect_props_spec.rb +1 -1
- data/spec/models/rule_spec.rb +1 -1
- data/spec/models/ruleset_spec.rb +1 -1
- data/spec/models/saml_connection_metadata_spec.rb +1 -1
- data/spec/models/saml_connection_spec.rb +1 -1
- data/spec/models/saml_login_endpoint_spec.rb +1 -1
- data/spec/models/session_spec.rb +1 -1
- data/spec/models/set_discount_effect_props_spec.rb +7 -1
- data/spec/models/set_discount_per_item_effect_props_spec.rb +7 -1
- data/spec/models/show_bundle_metadata_effect_props_spec.rb +1 -1
- data/spec/models/show_notification_effect_props_spec.rb +1 -1
- data/spec/models/slot_def_spec.rb +1 -1
- data/spec/models/template_arg_def_spec.rb +1 -1
- data/spec/models/template_def_spec.rb +1 -1
- data/spec/models/trigger_webhook_effect_props_spec.rb +1 -1
- data/spec/models/update_account_spec.rb +1 -1
- data/spec/models/update_application_spec.rb +29 -1
- data/spec/models/update_attribute_effect_props_spec.rb +1 -1
- data/spec/models/update_audience_spec.rb +41 -0
- data/spec/models/update_campaign_group_spec.rb +59 -0
- data/spec/models/update_campaign_spec.rb +7 -1
- data/spec/models/update_coupon_batch_spec.rb +1 -1
- data/spec/models/update_coupon_spec.rb +1 -1
- data/spec/models/update_loyalty_program_spec.rb +7 -1
- data/spec/models/update_role_spec.rb +1 -1
- data/spec/models/update_user_latest_feed_timestamp_spec.rb +41 -0
- data/spec/models/update_user_spec.rb +1 -13
- data/spec/models/user_entity_spec.rb +1 -1
- data/spec/models/user_feed_notifications_spec.rb +47 -0
- data/spec/models/user_spec.rb +2 -8
- data/spec/models/webhook_activation_log_entry_spec.rb +1 -1
- data/spec/models/webhook_log_entry_spec.rb +1 -1
- data/spec/models/webhook_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/talon_one.gemspec +1 -1
- metadata +78 -10
- data/docs/CustomerProfileUpdate.md +0 -17
- data/docs/MiscUpdateUserLatestFeature.md +0 -17
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,7 +21,7 @@ module TalonOne
|
|
21
21
|
# The exact moment this entity was created. The exact moment this entity was created. The exact moment this entity was created.
|
22
22
|
attr_accessor :created
|
23
23
|
|
24
|
-
# The ID
|
24
|
+
# The integration ID for this entity sent to and used in the Talon.One system. The integration ID for this entity sent to and used in the Talon.One system.
|
25
25
|
attr_accessor :integration_id
|
26
26
|
|
27
27
|
# Arbitrary properties associated with this item
|
@@ -39,6 +39,9 @@ module TalonOne
|
|
39
39
|
# A list of loyalty programs joined by the customer
|
40
40
|
attr_accessor :loyalty_memberships
|
41
41
|
|
42
|
+
# A list of audiences the customer belongs to
|
43
|
+
attr_accessor :audience_memberships
|
44
|
+
|
42
45
|
# Timestamp of the most recent event received from this customer
|
43
46
|
attr_accessor :last_activity
|
44
47
|
|
@@ -53,6 +56,7 @@ module TalonOne
|
|
53
56
|
:'closed_sessions' => :'closedSessions',
|
54
57
|
:'total_sales' => :'totalSales',
|
55
58
|
:'loyalty_memberships' => :'loyaltyMemberships',
|
59
|
+
:'audience_memberships' => :'audienceMemberships',
|
56
60
|
:'last_activity' => :'lastActivity'
|
57
61
|
}
|
58
62
|
end
|
@@ -68,6 +72,7 @@ module TalonOne
|
|
68
72
|
:'closed_sessions' => :'Integer',
|
69
73
|
:'total_sales' => :'Float',
|
70
74
|
:'loyalty_memberships' => :'Array<LoyaltyMembership>',
|
75
|
+
:'audience_memberships' => :'Array<AudienceMembership>',
|
71
76
|
:'last_activity' => :'DateTime'
|
72
77
|
}
|
73
78
|
end
|
@@ -127,6 +132,12 @@ module TalonOne
|
|
127
132
|
end
|
128
133
|
end
|
129
134
|
|
135
|
+
if attributes.key?(:'audience_memberships')
|
136
|
+
if (value = attributes[:'audience_memberships']).is_a?(Array)
|
137
|
+
self.audience_memberships = value
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
130
141
|
if attributes.key?(:'last_activity')
|
131
142
|
self.last_activity = attributes[:'last_activity']
|
132
143
|
end
|
@@ -198,6 +209,7 @@ module TalonOne
|
|
198
209
|
closed_sessions == o.closed_sessions &&
|
199
210
|
total_sales == o.total_sales &&
|
200
211
|
loyalty_memberships == o.loyalty_memberships &&
|
212
|
+
audience_memberships == o.audience_memberships &&
|
201
213
|
last_activity == o.last_activity
|
202
214
|
end
|
203
215
|
|
@@ -210,7 +222,7 @@ module TalonOne
|
|
210
222
|
# Calculates hash code according to all attributes.
|
211
223
|
# @return [Integer] Hash code
|
212
224
|
def hash
|
213
|
-
[id, created, integration_id, attributes, account_id, closed_sessions, total_sales, loyalty_memberships, last_activity].hash
|
225
|
+
[id, created, integration_id, attributes, account_id, closed_sessions, total_sales, loyalty_memberships, audience_memberships, last_activity].hash
|
214
226
|
end
|
215
227
|
|
216
228
|
# Builds the object from hash
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -27,7 +27,7 @@ module TalonOne
|
|
27
27
|
# The globally unique Talon.One ID of the customer that created this entity.
|
28
28
|
attr_accessor :profile_id
|
29
29
|
|
30
|
-
# The ID
|
30
|
+
# The integration ID for this entity sent to and used in the Talon.One system.
|
31
31
|
attr_accessor :integration_id
|
32
32
|
|
33
33
|
# Integration ID of the customer for the session.
|
@@ -0,0 +1,360 @@
|
|
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
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
#
|
17
|
+
class Audience
|
18
|
+
# The ID of the account that owns this entity.
|
19
|
+
attr_accessor :account_id
|
20
|
+
|
21
|
+
# Unique ID for this entity.
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
# The exact moment this entity was created.
|
25
|
+
attr_accessor :created
|
26
|
+
|
27
|
+
# The human-friendly display name for this Audience.
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
# Integration that this audience was created in.
|
31
|
+
attr_accessor :integration
|
32
|
+
|
33
|
+
# The ID of this Audience in the third-party integration
|
34
|
+
attr_accessor :integration_id
|
35
|
+
|
36
|
+
class EnumAttributeValidator
|
37
|
+
attr_reader :datatype
|
38
|
+
attr_reader :allowable_values
|
39
|
+
|
40
|
+
def initialize(datatype, allowable_values)
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
42
|
+
case datatype.to_s
|
43
|
+
when /Integer/i
|
44
|
+
value.to_i
|
45
|
+
when /Float/i
|
46
|
+
value.to_f
|
47
|
+
else
|
48
|
+
value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def valid?(value)
|
54
|
+
!value || allowable_values.include?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'account_id' => :'accountId',
|
62
|
+
:'id' => :'id',
|
63
|
+
:'created' => :'created',
|
64
|
+
:'name' => :'name',
|
65
|
+
:'integration' => :'integration',
|
66
|
+
:'integration_id' => :'integrationId'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.openapi_types
|
72
|
+
{
|
73
|
+
:'account_id' => :'Integer',
|
74
|
+
:'id' => :'Integer',
|
75
|
+
:'created' => :'DateTime',
|
76
|
+
:'name' => :'String',
|
77
|
+
:'integration' => :'String',
|
78
|
+
:'integration_id' => :'String'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# List of attributes with nullable: true
|
83
|
+
def self.openapi_nullable
|
84
|
+
Set.new([
|
85
|
+
])
|
86
|
+
end
|
87
|
+
|
88
|
+
# Initializes the object
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
def initialize(attributes = {})
|
91
|
+
if (!attributes.is_a?(Hash))
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::Audience` initialize method"
|
93
|
+
end
|
94
|
+
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
97
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::Audience`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
99
|
+
end
|
100
|
+
h[k.to_sym] = v
|
101
|
+
}
|
102
|
+
|
103
|
+
if attributes.key?(:'account_id')
|
104
|
+
self.account_id = attributes[:'account_id']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'id')
|
108
|
+
self.id = attributes[:'id']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'created')
|
112
|
+
self.created = attributes[:'created']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'name')
|
116
|
+
self.name = attributes[:'name']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'integration')
|
120
|
+
self.integration = attributes[:'integration']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'integration_id')
|
124
|
+
self.integration_id = attributes[:'integration_id']
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
129
|
+
# @return Array for valid properties with the reasons
|
130
|
+
def list_invalid_properties
|
131
|
+
invalid_properties = Array.new
|
132
|
+
if @account_id.nil?
|
133
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
134
|
+
end
|
135
|
+
|
136
|
+
if @id.nil?
|
137
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
138
|
+
end
|
139
|
+
|
140
|
+
if @created.nil?
|
141
|
+
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
142
|
+
end
|
143
|
+
|
144
|
+
if @name.nil?
|
145
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
146
|
+
end
|
147
|
+
|
148
|
+
if @name.to_s.length < 1
|
149
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @integration.nil?
|
153
|
+
invalid_properties.push('invalid value for "integration", integration cannot be nil.')
|
154
|
+
end
|
155
|
+
|
156
|
+
if @integration_id.nil?
|
157
|
+
invalid_properties.push('invalid value for "integration_id", integration_id cannot be nil.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @integration_id.to_s.length < 1
|
161
|
+
invalid_properties.push('invalid value for "integration_id", the character length must be great than or equal to 1.')
|
162
|
+
end
|
163
|
+
|
164
|
+
invalid_properties
|
165
|
+
end
|
166
|
+
|
167
|
+
# Check to see if the all the properties in the model are valid
|
168
|
+
# @return true if the model is valid
|
169
|
+
def valid?
|
170
|
+
return false if @account_id.nil?
|
171
|
+
return false if @id.nil?
|
172
|
+
return false if @created.nil?
|
173
|
+
return false if @name.nil?
|
174
|
+
return false if @name.to_s.length < 1
|
175
|
+
return false if @integration.nil?
|
176
|
+
integration_validator = EnumAttributeValidator.new('String', ["mparticle"])
|
177
|
+
return false unless integration_validator.valid?(@integration)
|
178
|
+
return false if @integration_id.nil?
|
179
|
+
return false if @integration_id.to_s.length < 1
|
180
|
+
true
|
181
|
+
end
|
182
|
+
|
183
|
+
# Custom attribute writer method with validation
|
184
|
+
# @param [Object] name Value to be assigned
|
185
|
+
def name=(name)
|
186
|
+
if name.nil?
|
187
|
+
fail ArgumentError, 'name cannot be nil'
|
188
|
+
end
|
189
|
+
|
190
|
+
if name.to_s.length < 1
|
191
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
192
|
+
end
|
193
|
+
|
194
|
+
@name = name
|
195
|
+
end
|
196
|
+
|
197
|
+
# Custom attribute writer method checking allowed values (enum).
|
198
|
+
# @param [Object] integration Object to be assigned
|
199
|
+
def integration=(integration)
|
200
|
+
validator = EnumAttributeValidator.new('String', ["mparticle"])
|
201
|
+
unless validator.valid?(integration)
|
202
|
+
fail ArgumentError, "invalid value for \"integration\", must be one of #{validator.allowable_values}."
|
203
|
+
end
|
204
|
+
@integration = integration
|
205
|
+
end
|
206
|
+
|
207
|
+
# Custom attribute writer method with validation
|
208
|
+
# @param [Object] integration_id Value to be assigned
|
209
|
+
def integration_id=(integration_id)
|
210
|
+
if integration_id.nil?
|
211
|
+
fail ArgumentError, 'integration_id cannot be nil'
|
212
|
+
end
|
213
|
+
|
214
|
+
if integration_id.to_s.length < 1
|
215
|
+
fail ArgumentError, 'invalid value for "integration_id", the character length must be great than or equal to 1.'
|
216
|
+
end
|
217
|
+
|
218
|
+
@integration_id = integration_id
|
219
|
+
end
|
220
|
+
|
221
|
+
# Checks equality by comparing each attribute.
|
222
|
+
# @param [Object] Object to be compared
|
223
|
+
def ==(o)
|
224
|
+
return true if self.equal?(o)
|
225
|
+
self.class == o.class &&
|
226
|
+
account_id == o.account_id &&
|
227
|
+
id == o.id &&
|
228
|
+
created == o.created &&
|
229
|
+
name == o.name &&
|
230
|
+
integration == o.integration &&
|
231
|
+
integration_id == o.integration_id
|
232
|
+
end
|
233
|
+
|
234
|
+
# @see the `==` method
|
235
|
+
# @param [Object] Object to be compared
|
236
|
+
def eql?(o)
|
237
|
+
self == o
|
238
|
+
end
|
239
|
+
|
240
|
+
# Calculates hash code according to all attributes.
|
241
|
+
# @return [Integer] Hash code
|
242
|
+
def hash
|
243
|
+
[account_id, id, created, name, integration, integration_id].hash
|
244
|
+
end
|
245
|
+
|
246
|
+
# Builds the object from hash
|
247
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
248
|
+
# @return [Object] Returns the model itself
|
249
|
+
def self.build_from_hash(attributes)
|
250
|
+
new.build_from_hash(attributes)
|
251
|
+
end
|
252
|
+
|
253
|
+
# Builds the object from hash
|
254
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
255
|
+
# @return [Object] Returns the model itself
|
256
|
+
def build_from_hash(attributes)
|
257
|
+
return nil unless attributes.is_a?(Hash)
|
258
|
+
self.class.openapi_types.each_pair do |key, type|
|
259
|
+
if type =~ /\AArray<(.*)>/i
|
260
|
+
# check to ensure the input is an array given that the attribute
|
261
|
+
# is documented as an array but the input is not
|
262
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
263
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
264
|
+
end
|
265
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
266
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
267
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
268
|
+
end
|
269
|
+
|
270
|
+
self
|
271
|
+
end
|
272
|
+
|
273
|
+
# Deserializes the data based on type
|
274
|
+
# @param string type Data type
|
275
|
+
# @param string value Value to be deserialized
|
276
|
+
# @return [Object] Deserialized data
|
277
|
+
def _deserialize(type, value)
|
278
|
+
case type.to_sym
|
279
|
+
when :DateTime
|
280
|
+
DateTime.parse(value)
|
281
|
+
when :Date
|
282
|
+
Date.parse(value)
|
283
|
+
when :String
|
284
|
+
value.to_s
|
285
|
+
when :Integer
|
286
|
+
value.to_i
|
287
|
+
when :Float
|
288
|
+
value.to_f
|
289
|
+
when :Boolean
|
290
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
291
|
+
true
|
292
|
+
else
|
293
|
+
false
|
294
|
+
end
|
295
|
+
when :Object
|
296
|
+
# generic object (usually a Hash), return directly
|
297
|
+
value
|
298
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
299
|
+
inner_type = Regexp.last_match[:inner_type]
|
300
|
+
value.map { |v| _deserialize(inner_type, v) }
|
301
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
302
|
+
k_type = Regexp.last_match[:k_type]
|
303
|
+
v_type = Regexp.last_match[:v_type]
|
304
|
+
{}.tap do |hash|
|
305
|
+
value.each do |k, v|
|
306
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
307
|
+
end
|
308
|
+
end
|
309
|
+
else # model
|
310
|
+
TalonOne.const_get(type).build_from_hash(value)
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
# Returns the string representation of the object
|
315
|
+
# @return [String] String presentation of the object
|
316
|
+
def to_s
|
317
|
+
to_hash.to_s
|
318
|
+
end
|
319
|
+
|
320
|
+
# to_body is an alias to to_hash (backward compatibility)
|
321
|
+
# @return [Hash] Returns the object in the form of hash
|
322
|
+
def to_body
|
323
|
+
to_hash
|
324
|
+
end
|
325
|
+
|
326
|
+
# Returns the object in the form of hash
|
327
|
+
# @return [Hash] Returns the object in the form of hash
|
328
|
+
def to_hash
|
329
|
+
hash = {}
|
330
|
+
self.class.attribute_map.each_pair do |attr, param|
|
331
|
+
value = self.send(attr)
|
332
|
+
if value.nil?
|
333
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
334
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
335
|
+
end
|
336
|
+
|
337
|
+
hash[param] = _to_hash(value)
|
338
|
+
end
|
339
|
+
hash
|
340
|
+
end
|
341
|
+
|
342
|
+
# Outputs non-array value in the form of hash
|
343
|
+
# For object, use to_hash. Otherwise, just return the value
|
344
|
+
# @param [Object] value Any valid value
|
345
|
+
# @return [Hash] Returns the value in the form of hash
|
346
|
+
def _to_hash(value)
|
347
|
+
if value.is_a?(Array)
|
348
|
+
value.compact.map { |v| _to_hash(v) }
|
349
|
+
elsif value.is_a?(Hash)
|
350
|
+
{}.tap do |hash|
|
351
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
352
|
+
end
|
353
|
+
elsif value.respond_to? :to_hash
|
354
|
+
value.to_hash
|
355
|
+
else
|
356
|
+
value
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
360
|
+
end
|