talon_one 1.1.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +2 -0
- data/Gemfile +3 -1
- data/README.md +178 -26
- data/Rakefile +2 -0
- data/docs/APIError.md +11 -0
- data/docs/AcceptCouponEffectProps.md +17 -0
- data/docs/AcceptReferralEffectProps.md +17 -0
- data/docs/AccessLogEntry.md +15 -0
- data/docs/Account.md +28 -2
- data/docs/AccountAdditionalCost.md +29 -0
- data/docs/AccountAnalytics.md +24 -0
- data/docs/AccountEntity.md +9 -0
- data/docs/AccountLimits.md +21 -0
- data/docs/AddFreeItemEffectProps.md +19 -0
- data/docs/AddLoyaltyPointsEffectProps.md +27 -0
- data/docs/AdditionalCost.md +17 -0
- data/docs/Application.md +25 -2
- data/docs/ApplicationAPIKey.md +15 -0
- data/docs/ApplicationApiHealth.md +10 -0
- data/docs/ApplicationCustomer.md +18 -1
- data/docs/ApplicationCustomerEntity.md +9 -0
- data/docs/ApplicationCustomerSearch.md +12 -1
- data/docs/ApplicationEntity.md +9 -0
- data/docs/ApplicationEvent.md +17 -1
- data/docs/ApplicationSession.md +25 -2
- data/docs/ApplicationSessionEntity.md +9 -0
- data/docs/Attribute.md +23 -4
- data/docs/AttributesMandatory.md +19 -0
- data/docs/AttributesSettings.md +17 -0
- data/docs/BaseSamlConnection.md +31 -0
- data/docs/Binding.md +10 -0
- data/docs/Campaign.md +36 -1
- data/docs/CampaignAnalytics.md +38 -3
- data/docs/CampaignCopy.md +18 -0
- data/docs/CampaignEntity.md +9 -0
- data/docs/CampaignSearch.md +10 -1
- data/docs/CampaignSet.md +14 -0
- data/docs/CampaignSetBranchNode.md +12 -0
- data/docs/CampaignSetLeafNode.md +10 -0
- data/docs/CampaignSetNode.md +9 -0
- data/docs/CartItem.md +21 -1
- data/docs/CartItemAdjustment.md +11 -0
- data/docs/Change.md +16 -2
- data/docs/ChangeProfilePassword.md +19 -0
- data/docs/CodeGeneratorSettings.md +10 -0
- data/docs/Coupon.md +31 -3
- data/docs/CouponConstraints.md +13 -0
- data/docs/CouponCreatedEffectProps.md +19 -0
- data/docs/CouponRejectionReason.md +11 -0
- data/docs/CouponReservations.md +9 -0
- data/docs/CouponSearch.md +10 -1
- data/docs/CouponValue.md +9 -0
- data/docs/CreateApplicationAPIKey.md +10 -0
- data/docs/CustomerActivityReport.md +21 -0
- data/docs/CustomerAnalytics.md +15 -0
- data/docs/CustomerInventory.md +21 -0
- data/docs/CustomerProfile.md +17 -1
- data/docs/CustomerProfileSearchQuery.md +12 -1
- data/docs/CustomerProfileUpdate.md +17 -0
- data/docs/CustomerSession.md +23 -2
- data/docs/CustomerSessionV2.md +45 -0
- data/docs/DeductLoyaltyPointsEffectProps.md +23 -0
- data/docs/Effect.md +27 -0
- data/docs/EffectEntity.md +25 -0
- data/docs/EmailEntity.md +9 -0
- data/docs/Entity.md +10 -0
- data/docs/Environment.md +15 -0
- data/docs/ErrorEffectProps.md +17 -0
- data/docs/ErrorResponse.md +10 -0
- data/docs/ErrorSource.md +13 -0
- data/docs/Event.md +19 -1
- data/docs/EventType.md +21 -1
- data/docs/Export.md +15 -1
- data/docs/FeatureFlag.md +12 -0
- data/docs/FeatureFlags.md +15 -3
- data/docs/FeaturesFeed.md +10 -0
- data/docs/FuncArgDef.md +10 -0
- data/docs/FunctionDef.md +13 -0
- data/docs/Import.md +14 -0
- data/docs/ImportCoupons.md +9 -0
- data/docs/InlineResponse200.md +10 -0
- data/docs/InlineResponse2001.md +11 -1
- data/docs/InlineResponse20010.md +11 -1
- data/docs/InlineResponse20011.md +10 -0
- data/docs/InlineResponse20012.md +10 -0
- data/docs/InlineResponse20013.md +11 -1
- data/docs/InlineResponse20014.md +10 -0
- data/docs/InlineResponse20015.md +11 -1
- data/docs/InlineResponse20016.md +11 -1
- data/docs/InlineResponse20017.md +10 -0
- data/docs/InlineResponse20018.md +11 -1
- data/docs/InlineResponse20019.md +10 -0
- data/docs/InlineResponse2002.md +11 -1
- data/docs/InlineResponse20020.md +11 -1
- data/docs/InlineResponse20021.md +11 -1
- data/docs/InlineResponse20022.md +11 -1
- data/docs/InlineResponse20023.md +11 -1
- data/docs/InlineResponse20024.md +11 -1
- data/docs/InlineResponse20025.md +11 -1
- data/docs/InlineResponse20026.md +11 -1
- data/docs/InlineResponse20027.md +14 -2
- data/docs/InlineResponse20028.md +11 -1
- data/docs/InlineResponse20029.md +19 -0
- data/docs/InlineResponse2003.md +11 -1
- data/docs/InlineResponse20030.md +19 -0
- data/docs/InlineResponse2004.md +11 -1
- data/docs/InlineResponse2005.md +11 -1
- data/docs/InlineResponse2006.md +10 -0
- data/docs/InlineResponse2007.md +11 -1
- data/docs/InlineResponse2008.md +10 -0
- data/docs/InlineResponse2009.md +10 -0
- data/docs/IntegrationApi.md +198 -64
- data/docs/IntegrationEntity.md +10 -0
- data/docs/IntegrationEvent.md +12 -1
- data/docs/IntegrationProfileEntity.md +9 -0
- data/docs/IntegrationRequest.md +19 -0
- data/docs/IntegrationState.md +14 -0
- data/docs/IntegrationStateV2.md +35 -0
- data/docs/LedgerEntry.md +18 -0
- data/docs/LibraryAttribute.md +15 -0
- data/docs/LimitConfig.md +11 -0
- data/docs/LoginParams.md +10 -0
- data/docs/Loyalty.md +9 -0
- data/docs/LoyaltyLedger.md +11 -1
- data/docs/LoyaltyLedgerEntry.md +20 -0
- data/docs/LoyaltyMembership.md +10 -0
- data/docs/LoyaltyPoints.md +12 -0
- data/docs/LoyaltyProgram.md +17 -1
- data/docs/LoyaltyProgramBalance.md +9 -0
- data/docs/LoyaltyProgramLedgers.md +14 -2
- data/docs/LoyaltySubLedger.md +11 -0
- data/docs/ManagementApi.md +834 -815
- data/docs/ManagerConfig.md +9 -0
- data/docs/Meta.md +17 -3
- data/docs/MiscUpdateUserLatestFeature.md +9 -0
- data/docs/MultiApplicationEntity.md +9 -0
- data/docs/MutableEntity.md +9 -0
- data/docs/NewAccount.md +9 -0
- data/docs/NewAccountSignUp.md +11 -0
- data/docs/NewAdditionalCost.md +23 -0
- data/docs/NewApplication.md +22 -2
- data/docs/NewApplicationAPIKey.md +16 -0
- data/docs/NewAttribute.md +20 -2
- data/docs/NewCampaign.md +21 -1
- data/docs/NewCampaignSet.md +12 -0
- data/docs/NewCoupons.md +20 -1
- data/docs/NewCustomerProfile.md +10 -1
- data/docs/NewCustomerSession.md +17 -1
- data/docs/NewCustomerSessionV2.md +31 -0
- data/docs/NewEvent.md +13 -1
- data/docs/NewEventType.md +19 -1
- data/docs/NewFeatureFlags.md +14 -3
- data/docs/NewImport.md +9 -0
- data/docs/NewInvitation.md +12 -0
- data/docs/NewInviteEmail.md +10 -0
- data/docs/NewLoyaltyProgram.md +15 -1
- data/docs/NewPassword.md +10 -0
- data/docs/NewPasswordEmail.md +9 -0
- data/docs/NewReferral.md +13 -0
- data/docs/NewRole.md +12 -0
- data/docs/NewRuleset.md +13 -1
- data/docs/NewSamlConnection.md +33 -0
- data/docs/NewTemplateDef.md +16 -1
- data/docs/NewUser.md +12 -0
- data/docs/NewWebhook.md +17 -1
- data/docs/Notification.md +21 -0
- data/docs/RedeemReferralEffectProps.md +19 -0
- data/docs/Referral.md +18 -0
- data/docs/ReferralCreatedEffectProps.md +17 -0
- data/docs/ReferralRejectionReason.md +21 -0
- data/docs/RejectCouponEffectProps.md +19 -0
- data/docs/RejectReferralEffectProps.md +19 -0
- data/docs/Role.md +15 -1
- data/docs/RoleAssign.md +10 -0
- data/docs/RoleMembership.md +10 -0
- data/docs/RollbackCouponEffectProps.md +17 -0
- data/docs/RollbackDiscountEffectProps.md +19 -0
- data/docs/Rule.md +13 -0
- data/docs/Ruleset.md +18 -1
- data/docs/SamlConnection.md +37 -0
- data/docs/SamlConnectionMetadata.md +23 -0
- data/docs/SamlLoginEndpoint.md +19 -0
- data/docs/Session.md +11 -0
- data/docs/SetDiscountEffectProps.md +19 -0
- data/docs/SetDiscountPerItemEffectProps.md +21 -0
- data/docs/ShowBundleMetadataEffectProps.md +21 -0
- data/docs/ShowNotificationEffectProps.md +21 -0
- data/docs/SlotDef.md +15 -1
- data/docs/TemplateArgDef.md +13 -1
- data/docs/TemplateDef.md +20 -1
- data/docs/TriggerWebhookEffectProps.md +19 -0
- data/docs/UpdateAccount.md +16 -1
- data/docs/UpdateApplication.md +33 -0
- data/docs/UpdateAttributeEffectProps.md +19 -0
- data/docs/UpdateCampaign.md +21 -1
- data/docs/UpdateCoupon.md +16 -1
- data/docs/UpdateCouponBatch.md +16 -1
- data/docs/UpdateLoyaltyProgram.md +14 -1
- data/docs/UpdateRole.md +13 -1
- data/docs/UpdateUser.md +17 -4
- data/docs/User.md +26 -2
- data/docs/UserEntity.md +9 -0
- data/docs/Webhook.md +20 -2
- data/docs/WebhookActivationLogEntry.md +13 -0
- data/docs/WebhookLogEntry.md +18 -0
- data/lib/talon_one.rb +75 -33
- data/lib/talon_one/api/integration_api.rb +372 -130
- data/lib/talon_one/api/management_api.rb +2238 -1444
- data/lib/talon_one/api_client.rb +39 -42
- data/lib/talon_one/api_error.rb +22 -3
- data/lib/talon_one/configuration.rb +48 -9
- data/lib/talon_one/models/accept_coupon_effect_props.rb +213 -0
- data/lib/talon_one/models/accept_referral_effect_props.rb +213 -0
- data/lib/talon_one/models/access_log_entry.rb +47 -24
- data/lib/talon_one/models/account.rb +72 -49
- data/lib/talon_one/models/account_additional_cost.rb +300 -0
- data/lib/talon_one/models/account_analytics.rb +78 -40
- data/lib/talon_one/models/account_entity.rb +39 -16
- data/lib/talon_one/models/account_limits.rb +67 -34
- data/lib/talon_one/models/add_free_item_effect_props.rb +228 -0
- data/lib/talon_one/models/add_loyalty_points_effect_props.rb +288 -0
- data/lib/talon_one/models/additional_cost.rb +211 -0
- data/lib/talon_one/models/api_error.rb +40 -17
- data/lib/talon_one/models/application.rb +87 -85
- data/lib/talon_one/models/application_api_health.rb +43 -20
- data/lib/talon_one/models/application_api_key.rb +47 -24
- data/lib/talon_one/models/application_customer.rb +52 -29
- data/lib/talon_one/models/application_customer_entity.rb +39 -16
- data/lib/talon_one/models/application_customer_search.rb +42 -19
- data/lib/talon_one/models/application_entity.rb +39 -16
- data/lib/talon_one/models/application_event.rb +48 -25
- data/lib/talon_one/models/application_session.rb +82 -34
- data/lib/talon_one/models/application_session_entity.rb +39 -16
- data/lib/talon_one/models/attribute.rb +67 -66
- data/lib/talon_one/models/attributes_mandatory.rb +222 -0
- data/lib/talon_one/models/attributes_settings.rb +207 -0
- data/lib/talon_one/models/base_saml_connection.rb +359 -0
- data/lib/talon_one/models/binding.rb +39 -16
- data/lib/talon_one/models/campaign.rb +97 -54
- data/lib/talon_one/models/campaign_analytics.rb +160 -47
- data/lib/talon_one/models/campaign_copy.rb +86 -21
- data/lib/talon_one/models/campaign_entity.rb +39 -16
- data/lib/talon_one/models/campaign_search.rb +38 -15
- data/lib/talon_one/models/campaign_set.rb +77 -20
- data/lib/talon_one/models/campaign_set_branch_node.rb +47 -24
- data/lib/talon_one/models/campaign_set_leaf_node.rb +43 -20
- data/lib/talon_one/models/campaign_set_node.rb +38 -15
- data/lib/talon_one/models/cart_item.rb +49 -26
- data/lib/talon_one/models/cart_item_adjustment.rb +43 -20
- data/lib/talon_one/models/change.rb +46 -23
- data/lib/talon_one/models/change_profile_password.rb +227 -0
- data/lib/talon_one/models/code_generator_settings.rb +41 -18
- data/lib/talon_one/models/coupon.rb +117 -40
- data/lib/talon_one/models/coupon_constraints.rb +78 -21
- data/lib/talon_one/models/coupon_created_effect_props.rb +228 -0
- data/lib/talon_one/models/coupon_rejection_reason.rb +45 -22
- data/lib/talon_one/models/coupon_reservations.rb +39 -16
- data/lib/talon_one/models/coupon_search.rb +38 -15
- data/lib/talon_one/models/coupon_value.rb +38 -15
- data/lib/talon_one/models/create_application_api_key.rb +39 -16
- data/lib/talon_one/models/customer_activity_report.rb +61 -38
- data/lib/talon_one/models/customer_analytics.rb +51 -28
- data/lib/talon_one/models/customer_inventory.rb +228 -0
- data/lib/talon_one/models/customer_profile.rb +51 -28
- data/lib/talon_one/models/customer_profile_search_query.rb +42 -19
- data/lib/talon_one/models/customer_profile_update.rb +211 -0
- data/lib/talon_one/models/customer_session.rb +59 -36
- data/lib/talon_one/models/customer_session_v2.rb +447 -0
- data/lib/talon_one/models/deduct_loyalty_points_effect_props.rb +258 -0
- data/lib/talon_one/models/effect.rb +287 -0
- data/lib/talon_one/models/effect_entity.rb +273 -0
- data/lib/talon_one/models/email_entity.rb +38 -15
- data/lib/talon_one/models/entity.rb +39 -16
- data/lib/talon_one/models/environment.rb +45 -22
- data/lib/talon_one/models/error_effect_props.rb +213 -0
- data/lib/talon_one/models/error_response.rb +39 -16
- data/lib/talon_one/models/error_source.rb +54 -21
- data/lib/talon_one/models/event.rb +51 -28
- data/lib/talon_one/models/event_type.rb +59 -36
- data/lib/talon_one/models/export.rb +48 -25
- data/lib/talon_one/models/feature_flag.rb +41 -18
- data/lib/talon_one/models/feature_flags.rb +46 -23
- data/lib/talon_one/models/features_feed.rb +40 -17
- data/lib/talon_one/models/func_arg_def.rb +42 -19
- data/lib/talon_one/models/function_def.rb +42 -19
- data/lib/talon_one/models/import.rb +48 -25
- data/lib/talon_one/models/import_coupons.rb +38 -15
- data/lib/talon_one/models/{inline_response_200.rb → inline_response200.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_2.rb → inline_response2001.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_10.rb → inline_response20010.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_11.rb → inline_response20011.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_12.rb → inline_response20012.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_13.rb → inline_response20013.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_14.rb → inline_response20014.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_15.rb → inline_response20015.rb} +41 -18
- data/lib/talon_one/models/inline_response20016.rb +222 -0
- data/lib/talon_one/models/{inline_response_200_17.rb → inline_response20017.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_18.rb → inline_response20018.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_19.rb → inline_response20019.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_3.rb → inline_response2002.rb} +41 -18
- data/lib/talon_one/models/inline_response20020.rb +227 -0
- data/lib/talon_one/models/inline_response20021.rb +227 -0
- data/lib/talon_one/models/{inline_response_200_20.rb → inline_response20022.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_21.rb → inline_response20023.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_22.rb → inline_response20024.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_23.rb → inline_response20025.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_24.rb → inline_response20026.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_25.rb → inline_response20027.rb} +51 -24
- data/lib/talon_one/models/{inline_response_200_26.rb → inline_response20028.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_27.rb → inline_response20029.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_4.rb → inline_response2003.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_28.rb → inline_response20030.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_1.rb → inline_response2004.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_5.rb → inline_response2005.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_6.rb → inline_response2006.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_7.rb → inline_response2007.rb} +41 -18
- data/lib/talon_one/models/{inline_response_200_8.rb → inline_response2008.rb} +40 -17
- data/lib/talon_one/models/{inline_response_200_9.rb → inline_response2009.rb} +40 -17
- data/lib/talon_one/models/integration_entity.rb +40 -17
- data/lib/talon_one/models/integration_event.rb +41 -18
- data/lib/talon_one/models/integration_profile_entity.rb +39 -16
- data/lib/talon_one/models/integration_request.rb +246 -0
- data/lib/talon_one/models/integration_state.rb +54 -22
- data/lib/talon_one/models/integration_state_v2.rb +313 -0
- data/lib/talon_one/models/ledger_entry.rb +53 -30
- data/lib/talon_one/models/library_attribute.rb +50 -27
- data/lib/talon_one/models/limit_config.rb +43 -20
- data/lib/talon_one/models/login_params.rb +39 -16
- data/lib/talon_one/models/loyalty.rb +38 -15
- data/lib/talon_one/models/loyalty_ledger.rb +40 -18
- data/lib/talon_one/models/loyalty_ledger_entry.rb +70 -37
- data/lib/talon_one/models/loyalty_membership.rb +40 -17
- data/lib/talon_one/models/loyalty_points.rb +43 -20
- data/lib/talon_one/models/loyalty_program.rb +50 -27
- data/lib/talon_one/models/loyalty_program_balance.rb +39 -16
- data/lib/talon_one/models/loyalty_program_ledgers.rb +43 -21
- data/lib/talon_one/models/loyalty_sub_ledger.rb +41 -18
- data/lib/talon_one/models/manager_config.rb +39 -16
- data/lib/talon_one/models/meta.rb +52 -20
- data/lib/talon_one/models/misc_update_user_latest_feature.rb +39 -16
- data/lib/talon_one/models/multi_application_entity.rb +39 -16
- data/lib/talon_one/models/mutable_entity.rb +38 -15
- data/lib/talon_one/models/new_account.rb +39 -16
- data/lib/talon_one/models/new_account_sign_up.rb +41 -18
- data/lib/talon_one/models/new_additional_cost.rb +255 -0
- data/lib/talon_one/models/new_application.rb +111 -81
- data/lib/talon_one/models/new_application_api_key.rb +48 -25
- data/lib/talon_one/models/new_attribute.rb +69 -34
- data/lib/talon_one/models/new_campaign.rb +57 -34
- data/lib/talon_one/models/new_campaign_set.rb +75 -18
- data/lib/talon_one/models/new_coupons.rb +89 -32
- data/lib/talon_one/models/new_customer_profile.rb +38 -15
- data/lib/talon_one/models/new_customer_session.rb +50 -27
- data/lib/talon_one/models/new_customer_session_v2.rb +322 -0
- data/lib/talon_one/models/new_event.rb +43 -20
- data/lib/talon_one/models/new_event_type.rb +57 -34
- data/lib/talon_one/models/new_feature_flags.rb +44 -21
- data/lib/talon_one/models/new_import.rb +41 -18
- data/lib/talon_one/models/new_invitation.rb +41 -18
- data/lib/talon_one/models/new_invite_email.rb +39 -16
- data/lib/talon_one/models/new_loyalty_program.rb +47 -24
- data/lib/talon_one/models/new_password.rb +40 -17
- data/lib/talon_one/models/new_password_email.rb +38 -15
- data/lib/talon_one/models/new_referral.rb +47 -24
- data/lib/talon_one/models/new_role.rb +41 -18
- data/lib/talon_one/models/new_ruleset.rb +43 -20
- data/lib/talon_one/models/new_saml_connection.rb +394 -0
- data/lib/talon_one/models/new_template_def.rb +45 -22
- data/lib/talon_one/models/new_user.rb +42 -19
- data/lib/talon_one/models/new_webhook.rb +50 -27
- data/lib/talon_one/models/notification.rb +242 -0
- data/lib/talon_one/models/redeem_referral_effect_props.rb +228 -0
- data/lib/talon_one/models/referral.rb +54 -31
- data/lib/talon_one/models/referral_created_effect_props.rb +213 -0
- data/lib/talon_one/models/referral_rejection_reason.rb +274 -0
- data/lib/talon_one/models/reject_coupon_effect_props.rb +228 -0
- data/lib/talon_one/models/reject_referral_effect_props.rb +228 -0
- data/lib/talon_one/models/role.rb +45 -22
- data/lib/talon_one/models/role_assign.rb +39 -16
- data/lib/talon_one/models/role_membership.rb +41 -18
- data/lib/talon_one/models/rollback_coupon_effect_props.rb +213 -0
- data/lib/talon_one/models/rollback_discount_effect_props.rb +228 -0
- data/lib/talon_one/models/rule.rb +42 -19
- data/lib/talon_one/models/ruleset.rb +51 -28
- data/lib/talon_one/models/saml_connection.rb +410 -0
- data/lib/talon_one/models/saml_connection_metadata.rb +294 -0
- data/lib/talon_one/models/saml_login_endpoint.rb +265 -0
- data/lib/talon_one/models/session.rb +41 -18
- data/lib/talon_one/models/set_discount_effect_props.rb +228 -0
- data/lib/talon_one/models/set_discount_per_item_effect_props.rb +243 -0
- data/lib/talon_one/models/show_bundle_metadata_effect_props.rb +247 -0
- data/lib/talon_one/models/show_notification_effect_props.rb +243 -0
- data/lib/talon_one/models/slot_def.rb +44 -21
- data/lib/talon_one/models/template_arg_def.rb +44 -21
- data/lib/talon_one/models/template_def.rb +50 -27
- data/lib/talon_one/models/trigger_webhook_effect_props.rb +228 -0
- data/lib/talon_one/models/update_account.rb +100 -23
- data/lib/talon_one/models/update_application.rb +406 -0
- data/lib/talon_one/models/update_attribute_effect_props.rb +228 -0
- data/lib/talon_one/models/update_campaign.rb +57 -34
- data/lib/talon_one/models/update_coupon.rb +81 -24
- data/lib/talon_one/models/update_coupon_batch.rb +81 -24
- data/lib/talon_one/models/update_loyalty_program.rb +46 -23
- data/lib/talon_one/models/update_role.rb +42 -19
- data/lib/talon_one/models/update_user.rb +62 -66
- data/lib/talon_one/models/user.rb +81 -39
- data/lib/talon_one/models/user_entity.rb +39 -16
- data/lib/talon_one/models/webhook.rb +56 -50
- data/lib/talon_one/models/webhook_activation_log_entry.rb +46 -23
- data/lib/talon_one/models/webhook_log_entry.rb +52 -29
- data/lib/talon_one/version.rb +4 -4
- data/spec/api/integration_api_spec.rb +44 -11
- data/spec/api/management_api_spec.rb +141 -140
- data/spec/api_client_spec.rb +4 -4
- data/spec/configuration_spec.rb +6 -6
- data/spec/models/accept_coupon_effect_props_spec.rb +41 -0
- data/spec/models/accept_referral_effect_props_spec.rb +41 -0
- data/spec/models/access_log_entry_spec.rb +4 -4
- data/spec/models/account_additional_cost_spec.rb +77 -0
- data/spec/models/account_analytics_spec.rb +10 -4
- data/spec/models/account_entity_spec.rb +4 -4
- data/spec/models/account_limits_spec.rb +10 -4
- data/spec/models/account_spec.rb +5 -5
- data/spec/models/add_free_item_effect_props_spec.rb +47 -0
- data/spec/models/add_loyalty_points_effect_props_spec.rb +71 -0
- data/spec/models/additional_cost_spec.rb +41 -0
- data/spec/models/api_error_spec.rb +4 -4
- data/spec/models/application_api_health_spec.rb +4 -4
- data/spec/models/application_api_key_spec.rb +4 -4
- data/spec/models/application_customer_entity_spec.rb +4 -4
- data/spec/models/application_customer_search_spec.rb +4 -4
- data/spec/models/application_customer_spec.rb +4 -4
- data/spec/models/application_entity_spec.rb +4 -4
- data/spec/models/application_event_spec.rb +4 -4
- data/spec/models/application_session_entity_spec.rb +4 -4
- data/spec/models/application_session_spec.rb +16 -4
- data/spec/models/application_spec.rb +20 -10
- data/spec/models/attribute_spec.rb +5 -11
- data/spec/models/attributes_mandatory_spec.rb +47 -0
- data/spec/models/attributes_settings_spec.rb +41 -0
- data/spec/models/base_saml_connection_spec.rb +83 -0
- data/spec/models/binding_spec.rb +4 -4
- data/spec/models/campaign_analytics_spec.rb +40 -4
- data/spec/models/campaign_copy_spec.rb +28 -4
- data/spec/models/campaign_entity_spec.rb +4 -4
- data/spec/models/campaign_search_spec.rb +4 -4
- data/spec/models/campaign_set_branch_node_spec.rb +4 -4
- data/spec/models/campaign_set_leaf_node_spec.rb +4 -4
- data/spec/models/campaign_set_node_spec.rb +4 -4
- data/spec/models/campaign_set_spec.rb +10 -4
- data/spec/models/campaign_spec.rb +16 -4
- data/spec/models/cart_item_adjustment_spec.rb +4 -4
- data/spec/models/cart_item_spec.rb +4 -4
- data/spec/models/change_profile_password_spec.rb +47 -0
- data/spec/models/change_spec.rb +4 -4
- data/spec/models/code_generator_settings_spec.rb +4 -4
- data/spec/models/coupon_constraints_spec.rb +10 -4
- data/spec/models/coupon_created_effect_props_spec.rb +47 -0
- data/spec/models/coupon_rejection_reason_spec.rb +5 -5
- data/spec/models/coupon_reservations_spec.rb +4 -4
- data/spec/models/coupon_search_spec.rb +4 -4
- data/spec/models/coupon_spec.rb +22 -4
- data/spec/models/coupon_value_spec.rb +4 -4
- data/spec/models/create_application_api_key_spec.rb +4 -4
- data/spec/models/customer_activity_report_spec.rb +4 -4
- data/spec/models/customer_analytics_spec.rb +4 -4
- data/spec/models/customer_inventory_spec.rb +53 -0
- data/spec/models/customer_profile_search_query_spec.rb +4 -4
- data/spec/models/customer_profile_spec.rb +4 -4
- data/spec/models/customer_profile_update_spec.rb +41 -0
- data/spec/models/customer_session_spec.rb +4 -4
- data/spec/models/customer_session_v2_spec.rb +129 -0
- data/spec/models/deduct_loyalty_points_effect_props_spec.rb +59 -0
- data/spec/models/effect_entity_spec.rb +65 -0
- data/spec/models/effect_spec.rb +71 -0
- data/spec/models/email_entity_spec.rb +4 -4
- data/spec/models/entity_spec.rb +4 -4
- data/spec/models/environment_spec.rb +4 -4
- data/spec/models/error_effect_props_spec.rb +41 -0
- data/spec/models/error_response_spec.rb +4 -4
- data/spec/models/error_source_spec.rb +10 -4
- data/spec/models/event_spec.rb +4 -4
- data/spec/models/event_type_spec.rb +4 -4
- data/spec/models/export_spec.rb +4 -4
- data/spec/models/feature_flag_spec.rb +4 -4
- data/spec/models/feature_flags_spec.rb +4 -4
- data/spec/models/features_feed_spec.rb +4 -4
- data/spec/models/func_arg_def_spec.rb +4 -4
- data/spec/models/function_def_spec.rb +4 -4
- data/spec/models/import_coupons_spec.rb +4 -4
- data/spec/models/import_spec.rb +4 -4
- data/spec/models/{inline_response_200_10_spec.rb → inline_response20010_spec.rb} +4 -4
- data/spec/models/{inline_response_200_11_spec.rb → inline_response20011_spec.rb} +4 -4
- data/spec/models/{inline_response_200_12_spec.rb → inline_response20012_spec.rb} +4 -4
- data/spec/models/{inline_response_200_13_spec.rb → inline_response20013_spec.rb} +4 -4
- data/spec/models/{inline_response_200_14_spec.rb → inline_response20014_spec.rb} +4 -4
- data/spec/models/{inline_response_200_15_spec.rb → inline_response20015_spec.rb} +4 -4
- data/spec/models/{inline_response_200_16_spec.rb → inline_response20016_spec.rb} +5 -5
- data/spec/models/{inline_response_200_17_spec.rb → inline_response20017_spec.rb} +4 -4
- data/spec/models/{inline_response_200_18_spec.rb → inline_response20018_spec.rb} +4 -4
- data/spec/models/{inline_response_200_19_spec.rb → inline_response20019_spec.rb} +4 -4
- data/spec/models/{inline_response_200_1_spec.rb → inline_response2001_spec.rb} +4 -4
- data/spec/models/{inline_response_200_20_spec.rb → inline_response20020_spec.rb} +4 -4
- data/spec/models/{inline_response_200_21_spec.rb → inline_response20021_spec.rb} +4 -4
- data/spec/models/{inline_response_200_22_spec.rb → inline_response20022_spec.rb} +4 -4
- data/spec/models/{inline_response_200_23_spec.rb → inline_response20023_spec.rb} +4 -4
- data/spec/models/{inline_response_200_24_spec.rb → inline_response20024_spec.rb} +4 -4
- data/spec/models/{inline_response_200_25_spec.rb → inline_response20025_spec.rb} +4 -4
- data/spec/models/{inline_response_200_26_spec.rb → inline_response20026_spec.rb} +4 -4
- data/spec/models/{inline_response_200_27_spec.rb → inline_response20027_spec.rb} +10 -4
- data/spec/models/{inline_response_200_28_spec.rb → inline_response20028_spec.rb} +4 -4
- data/spec/models/inline_response20029_spec.rb +47 -0
- data/spec/models/{inline_response_200_2_spec.rb → inline_response2002_spec.rb} +4 -4
- data/spec/models/inline_response20030_spec.rb +47 -0
- data/spec/models/{inline_response_200_3_spec.rb → inline_response2003_spec.rb} +4 -4
- data/spec/models/{inline_response_200_4_spec.rb → inline_response2004_spec.rb} +4 -4
- data/spec/models/{inline_response_200_5_spec.rb → inline_response2005_spec.rb} +4 -4
- data/spec/models/{inline_response_200_6_spec.rb → inline_response2006_spec.rb} +4 -4
- data/spec/models/{inline_response_200_7_spec.rb → inline_response2007_spec.rb} +4 -4
- data/spec/models/{inline_response_200_8_spec.rb → inline_response2008_spec.rb} +4 -4
- data/spec/models/{inline_response_200_9_spec.rb → inline_response2009_spec.rb} +4 -4
- data/spec/models/{inline_response_200_spec.rb → inline_response200_spec.rb} +4 -4
- data/spec/models/integration_entity_spec.rb +4 -4
- data/spec/models/integration_event_spec.rb +4 -4
- data/spec/models/integration_profile_entity_spec.rb +4 -4
- data/spec/models/integration_request_spec.rb +51 -0
- data/spec/models/integration_state_spec.rb +10 -4
- data/spec/models/integration_state_v2_spec.rb +95 -0
- data/spec/models/ledger_entry_spec.rb +4 -4
- data/spec/models/library_attribute_spec.rb +4 -4
- data/spec/models/limit_config_spec.rb +5 -5
- data/spec/models/login_params_spec.rb +4 -4
- data/spec/models/loyalty_ledger_entry_spec.rb +11 -5
- data/spec/models/loyalty_ledger_spec.rb +4 -4
- data/spec/models/loyalty_membership_spec.rb +4 -4
- data/spec/models/loyalty_points_spec.rb +4 -4
- data/spec/models/loyalty_program_balance_spec.rb +4 -4
- data/spec/models/loyalty_program_ledgers_spec.rb +4 -4
- data/spec/models/loyalty_program_spec.rb +4 -4
- data/spec/models/loyalty_spec.rb +4 -4
- data/spec/models/loyalty_sub_ledger_spec.rb +4 -4
- data/spec/models/manager_config_spec.rb +4 -4
- data/spec/models/meta_spec.rb +10 -4
- data/spec/models/misc_update_user_latest_feature_spec.rb +4 -4
- data/spec/models/multi_application_entity_spec.rb +4 -4
- data/spec/models/mutable_entity_spec.rb +4 -4
- data/spec/models/new_account_sign_up_spec.rb +4 -4
- data/spec/models/new_account_spec.rb +4 -4
- data/spec/models/new_additional_cost_spec.rb +59 -0
- data/spec/models/new_application_api_key_spec.rb +4 -4
- data/spec/models/new_application_spec.rb +26 -10
- data/spec/models/new_attribute_spec.rb +10 -4
- data/spec/models/new_campaign_set_spec.rb +10 -4
- data/spec/models/new_campaign_spec.rb +4 -4
- data/spec/models/new_coupons_spec.rb +10 -4
- data/spec/models/new_customer_profile_spec.rb +4 -4
- data/spec/models/new_customer_session_spec.rb +4 -4
- data/spec/models/new_customer_session_v2_spec.rb +87 -0
- data/spec/models/new_event_spec.rb +4 -4
- data/spec/models/new_event_type_spec.rb +4 -4
- data/spec/models/new_feature_flags_spec.rb +4 -4
- data/spec/models/new_import_spec.rb +4 -4
- data/spec/models/new_invitation_spec.rb +4 -4
- data/spec/models/new_invite_email_spec.rb +4 -4
- data/spec/models/new_loyalty_program_spec.rb +4 -4
- data/spec/models/new_password_email_spec.rb +4 -4
- data/spec/models/new_password_spec.rb +4 -4
- data/spec/models/new_referral_spec.rb +4 -4
- data/spec/models/new_role_spec.rb +4 -4
- data/spec/models/new_ruleset_spec.rb +4 -4
- data/spec/models/new_saml_connection_spec.rb +89 -0
- data/spec/models/new_template_def_spec.rb +4 -4
- data/spec/models/new_user_spec.rb +4 -4
- data/spec/models/new_webhook_spec.rb +4 -4
- data/spec/models/notification_spec.rb +53 -0
- data/spec/models/redeem_referral_effect_props_spec.rb +47 -0
- data/spec/models/referral_created_effect_props_spec.rb +41 -0
- data/spec/models/referral_rejection_reason_spec.rb +57 -0
- data/spec/models/referral_spec.rb +4 -4
- data/spec/models/reject_coupon_effect_props_spec.rb +47 -0
- data/spec/models/reject_referral_effect_props_spec.rb +47 -0
- data/spec/models/role_assign_spec.rb +4 -4
- data/spec/models/role_membership_spec.rb +4 -4
- data/spec/models/role_spec.rb +4 -4
- data/spec/models/rollback_coupon_effect_props_spec.rb +41 -0
- data/spec/models/rollback_discount_effect_props_spec.rb +47 -0
- data/spec/models/rule_spec.rb +4 -4
- data/spec/models/ruleset_spec.rb +4 -4
- data/spec/models/saml_connection_metadata_spec.rb +59 -0
- data/spec/models/saml_connection_spec.rb +101 -0
- data/spec/models/saml_login_endpoint_spec.rb +47 -0
- data/spec/models/session_spec.rb +4 -4
- data/spec/models/set_discount_effect_props_spec.rb +47 -0
- data/spec/models/set_discount_per_item_effect_props_spec.rb +53 -0
- data/spec/models/show_bundle_metadata_effect_props_spec.rb +53 -0
- data/spec/models/show_notification_effect_props_spec.rb +53 -0
- data/spec/models/slot_def_spec.rb +4 -4
- data/spec/models/template_arg_def_spec.rb +4 -4
- data/spec/models/template_def_spec.rb +4 -4
- data/spec/models/trigger_webhook_effect_props_spec.rb +47 -0
- data/spec/models/update_account_spec.rb +20 -4
- data/spec/models/update_application_spec.rb +97 -0
- data/spec/models/update_attribute_effect_props_spec.rb +47 -0
- data/spec/models/update_campaign_spec.rb +4 -4
- data/spec/models/update_coupon_batch_spec.rb +10 -4
- data/spec/models/update_coupon_spec.rb +10 -4
- data/spec/models/update_loyalty_program_spec.rb +4 -4
- data/spec/models/update_role_spec.rb +4 -4
- data/spec/models/update_user_spec.rb +10 -22
- data/spec/models/user_entity_spec.rb +4 -4
- data/spec/models/user_spec.rb +16 -4
- data/spec/models/webhook_activation_log_entry_spec.rb +4 -4
- data/spec/models/webhook_log_entry_spec.rb +4 -4
- data/spec/models/webhook_spec.rb +4 -10
- data/spec/spec_helper.rb +3 -3
- data/talon_one.gemspec +6 -11
- metadata +271 -228
- data/CHANGELOG.md +0 -63
- data/docs/AttributeQuery.md +0 -7
- data/git_push.sh +0 -55
- data/lib/talon_one/models/attribute_query.rb +0 -174
- data/lib/talon_one/models/inline_response_200_16.rb +0 -204
- data/spec/models/attribute_query_spec.rb +0 -35
- data/talon_one-1.0.0.gem +0 -0
- data/talon_one-1.1.0.gem +0 -0
- data/talon_one-1.1.1.gem +0 -0
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -76,7 +76,7 @@ module TalonOne
|
|
76
76
|
end
|
77
77
|
|
78
78
|
# Attribute type mapping.
|
79
|
-
def self.
|
79
|
+
def self.openapi_types
|
80
80
|
{
|
81
81
|
:'profile_id' => :'String',
|
82
82
|
:'coupon' => :'String',
|
@@ -89,49 +89,62 @@ module TalonOne
|
|
89
89
|
}
|
90
90
|
end
|
91
91
|
|
92
|
+
# List of attributes with nullable: true
|
93
|
+
def self.openapi_nullable
|
94
|
+
Set.new([
|
95
|
+
])
|
96
|
+
end
|
97
|
+
|
92
98
|
# Initializes the object
|
93
99
|
# @param [Hash] attributes Model attributes in the form of hash
|
94
100
|
def initialize(attributes = {})
|
95
|
-
|
101
|
+
if (!attributes.is_a?(Hash))
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::NewCustomerSession` initialize method"
|
103
|
+
end
|
96
104
|
|
97
|
-
# convert string to symbol for hash key
|
98
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
106
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
107
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
108
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::NewCustomerSession`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
109
|
+
end
|
110
|
+
h[k.to_sym] = v
|
111
|
+
}
|
99
112
|
|
100
|
-
if attributes.
|
101
|
-
self.profile_id = attributes[:'
|
113
|
+
if attributes.key?(:'profile_id')
|
114
|
+
self.profile_id = attributes[:'profile_id']
|
102
115
|
end
|
103
116
|
|
104
|
-
if attributes.
|
117
|
+
if attributes.key?(:'coupon')
|
105
118
|
self.coupon = attributes[:'coupon']
|
106
119
|
end
|
107
120
|
|
108
|
-
if attributes.
|
121
|
+
if attributes.key?(:'referral')
|
109
122
|
self.referral = attributes[:'referral']
|
110
123
|
end
|
111
124
|
|
112
|
-
if attributes.
|
125
|
+
if attributes.key?(:'state')
|
113
126
|
self.state = attributes[:'state']
|
114
127
|
else
|
115
128
|
self.state = 'open'
|
116
129
|
end
|
117
130
|
|
118
|
-
if attributes.
|
119
|
-
if (value = attributes[:'
|
131
|
+
if attributes.key?(:'cart_items')
|
132
|
+
if (value = attributes[:'cart_items']).is_a?(Array)
|
120
133
|
self.cart_items = value
|
121
134
|
end
|
122
135
|
end
|
123
136
|
|
124
|
-
if attributes.
|
137
|
+
if attributes.key?(:'identifiers')
|
125
138
|
if (value = attributes[:'identifiers']).is_a?(Array)
|
126
139
|
self.identifiers = value
|
127
140
|
end
|
128
141
|
end
|
129
142
|
|
130
|
-
if attributes.
|
143
|
+
if attributes.key?(:'total')
|
131
144
|
self.total = attributes[:'total']
|
132
145
|
end
|
133
146
|
|
134
|
-
if attributes.
|
147
|
+
if attributes.key?(:'attributes')
|
135
148
|
self.attributes = attributes[:'attributes']
|
136
149
|
end
|
137
150
|
end
|
@@ -146,7 +159,7 @@ module TalonOne
|
|
146
159
|
# Check to see if the all the properties in the model are valid
|
147
160
|
# @return true if the model is valid
|
148
161
|
def valid?
|
149
|
-
state_validator = EnumAttributeValidator.new('String', [
|
162
|
+
state_validator = EnumAttributeValidator.new('String', ["open", "closed", "cancelled"])
|
150
163
|
return false unless state_validator.valid?(@state)
|
151
164
|
true
|
152
165
|
end
|
@@ -154,9 +167,9 @@ module TalonOne
|
|
154
167
|
# Custom attribute writer method checking allowed values (enum).
|
155
168
|
# @param [Object] state Object to be assigned
|
156
169
|
def state=(state)
|
157
|
-
validator = EnumAttributeValidator.new('String', [
|
170
|
+
validator = EnumAttributeValidator.new('String', ["open", "closed", "cancelled"])
|
158
171
|
unless validator.valid?(state)
|
159
|
-
fail ArgumentError,
|
172
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
160
173
|
end
|
161
174
|
@state = state
|
162
175
|
end
|
@@ -183,19 +196,26 @@ module TalonOne
|
|
183
196
|
end
|
184
197
|
|
185
198
|
# Calculates hash code according to all attributes.
|
186
|
-
# @return [
|
199
|
+
# @return [Integer] Hash code
|
187
200
|
def hash
|
188
201
|
[profile_id, coupon, referral, state, cart_items, identifiers, total, attributes].hash
|
189
202
|
end
|
190
203
|
|
204
|
+
# Builds the object from hash
|
205
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
206
|
+
# @return [Object] Returns the model itself
|
207
|
+
def self.build_from_hash(attributes)
|
208
|
+
new.build_from_hash(attributes)
|
209
|
+
end
|
210
|
+
|
191
211
|
# Builds the object from hash
|
192
212
|
# @param [Hash] attributes Model attributes in the form of hash
|
193
213
|
# @return [Object] Returns the model itself
|
194
214
|
def build_from_hash(attributes)
|
195
215
|
return nil unless attributes.is_a?(Hash)
|
196
|
-
self.class.
|
216
|
+
self.class.openapi_types.each_pair do |key, type|
|
197
217
|
if type =~ /\AArray<(.*)>/i
|
198
|
-
# check to ensure the input is an array given that the
|
218
|
+
# check to ensure the input is an array given that the attribute
|
199
219
|
# is documented as an array but the input is not
|
200
220
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
201
221
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -224,7 +244,7 @@ module TalonOne
|
|
224
244
|
value.to_i
|
225
245
|
when :Float
|
226
246
|
value.to_f
|
227
|
-
when :
|
247
|
+
when :Boolean
|
228
248
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
229
249
|
true
|
230
250
|
else
|
@@ -245,8 +265,7 @@ module TalonOne
|
|
245
265
|
end
|
246
266
|
end
|
247
267
|
else # model
|
248
|
-
|
249
|
-
temp_model.build_from_hash(value)
|
268
|
+
TalonOne.const_get(type).build_from_hash(value)
|
250
269
|
end
|
251
270
|
end
|
252
271
|
|
@@ -268,7 +287,11 @@ module TalonOne
|
|
268
287
|
hash = {}
|
269
288
|
self.class.attribute_map.each_pair do |attr, param|
|
270
289
|
value = self.send(attr)
|
271
|
-
|
290
|
+
if value.nil?
|
291
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
292
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
293
|
+
end
|
294
|
+
|
272
295
|
hash[param] = _to_hash(value)
|
273
296
|
end
|
274
297
|
hash
|
@@ -0,0 +1,322 @@
|
|
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.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
#
|
17
|
+
class NewCustomerSessionV2
|
18
|
+
# ID of the customers profile as used within this Talon.One account. May be omitted or set to the empty string if the customer does not yet have a known profile ID.
|
19
|
+
attr_accessor :profile_id
|
20
|
+
|
21
|
+
# Any coupon codes entered.
|
22
|
+
attr_accessor :coupon_codes
|
23
|
+
|
24
|
+
# Any referral code entered.
|
25
|
+
attr_accessor :referral_code
|
26
|
+
|
27
|
+
# Indicates the current state of the session. All sessions must start in the \"open\" state, after which valid transitions are... 1. open -> closed 2. open -> cancelled 3. closed -> cancelled
|
28
|
+
attr_accessor :state
|
29
|
+
|
30
|
+
# All items the customer will be purchasing in this session
|
31
|
+
attr_accessor :cart_items
|
32
|
+
|
33
|
+
# Any costs associated with the session that can not be explicitly attributed to cart items. Examples include shipping costs and service fees.
|
34
|
+
attr_accessor :additional_costs
|
35
|
+
|
36
|
+
# Identifiers for the customer, this can be used for limits on values such as device ID.
|
37
|
+
attr_accessor :identifiers
|
38
|
+
|
39
|
+
# A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings.
|
40
|
+
attr_accessor :attributes
|
41
|
+
|
42
|
+
class EnumAttributeValidator
|
43
|
+
attr_reader :datatype
|
44
|
+
attr_reader :allowable_values
|
45
|
+
|
46
|
+
def initialize(datatype, allowable_values)
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
48
|
+
case datatype.to_s
|
49
|
+
when /Integer/i
|
50
|
+
value.to_i
|
51
|
+
when /Float/i
|
52
|
+
value.to_f
|
53
|
+
else
|
54
|
+
value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def valid?(value)
|
60
|
+
!value || allowable_values.include?(value)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
65
|
+
def self.attribute_map
|
66
|
+
{
|
67
|
+
:'profile_id' => :'profileId',
|
68
|
+
:'coupon_codes' => :'couponCodes',
|
69
|
+
:'referral_code' => :'referralCode',
|
70
|
+
:'state' => :'state',
|
71
|
+
:'cart_items' => :'cartItems',
|
72
|
+
:'additional_costs' => :'additionalCosts',
|
73
|
+
:'identifiers' => :'identifiers',
|
74
|
+
:'attributes' => :'attributes'
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
# Attribute type mapping.
|
79
|
+
def self.openapi_types
|
80
|
+
{
|
81
|
+
:'profile_id' => :'String',
|
82
|
+
:'coupon_codes' => :'Array<String>',
|
83
|
+
:'referral_code' => :'String',
|
84
|
+
:'state' => :'String',
|
85
|
+
:'cart_items' => :'Array<CartItem>',
|
86
|
+
:'additional_costs' => :'Hash<String, AdditionalCost>',
|
87
|
+
:'identifiers' => :'Array<String>',
|
88
|
+
:'attributes' => :'Object'
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
# List of attributes with nullable: true
|
93
|
+
def self.openapi_nullable
|
94
|
+
Set.new([
|
95
|
+
])
|
96
|
+
end
|
97
|
+
|
98
|
+
# Initializes the object
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
def initialize(attributes = {})
|
101
|
+
if (!attributes.is_a?(Hash))
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::NewCustomerSessionV2` initialize method"
|
103
|
+
end
|
104
|
+
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
106
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
107
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
108
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::NewCustomerSessionV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
109
|
+
end
|
110
|
+
h[k.to_sym] = v
|
111
|
+
}
|
112
|
+
|
113
|
+
if attributes.key?(:'profile_id')
|
114
|
+
self.profile_id = attributes[:'profile_id']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'coupon_codes')
|
118
|
+
if (value = attributes[:'coupon_codes']).is_a?(Array)
|
119
|
+
self.coupon_codes = value
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'referral_code')
|
124
|
+
self.referral_code = attributes[:'referral_code']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'state')
|
128
|
+
self.state = attributes[:'state']
|
129
|
+
else
|
130
|
+
self.state = 'open'
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'cart_items')
|
134
|
+
if (value = attributes[:'cart_items']).is_a?(Array)
|
135
|
+
self.cart_items = value
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'additional_costs')
|
140
|
+
if (value = attributes[:'additional_costs']).is_a?(Hash)
|
141
|
+
self.additional_costs = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'identifiers')
|
146
|
+
if (value = attributes[:'identifiers']).is_a?(Array)
|
147
|
+
self.identifiers = value
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'attributes')
|
152
|
+
self.attributes = attributes[:'attributes']
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
157
|
+
# @return Array for valid properties with the reasons
|
158
|
+
def list_invalid_properties
|
159
|
+
invalid_properties = Array.new
|
160
|
+
invalid_properties
|
161
|
+
end
|
162
|
+
|
163
|
+
# Check to see if the all the properties in the model are valid
|
164
|
+
# @return true if the model is valid
|
165
|
+
def valid?
|
166
|
+
state_validator = EnumAttributeValidator.new('String', ["open", "closed", "cancelled"])
|
167
|
+
return false unless state_validator.valid?(@state)
|
168
|
+
true
|
169
|
+
end
|
170
|
+
|
171
|
+
# Custom attribute writer method checking allowed values (enum).
|
172
|
+
# @param [Object] state Object to be assigned
|
173
|
+
def state=(state)
|
174
|
+
validator = EnumAttributeValidator.new('String', ["open", "closed", "cancelled"])
|
175
|
+
unless validator.valid?(state)
|
176
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
177
|
+
end
|
178
|
+
@state = state
|
179
|
+
end
|
180
|
+
|
181
|
+
# Checks equality by comparing each attribute.
|
182
|
+
# @param [Object] Object to be compared
|
183
|
+
def ==(o)
|
184
|
+
return true if self.equal?(o)
|
185
|
+
self.class == o.class &&
|
186
|
+
profile_id == o.profile_id &&
|
187
|
+
coupon_codes == o.coupon_codes &&
|
188
|
+
referral_code == o.referral_code &&
|
189
|
+
state == o.state &&
|
190
|
+
cart_items == o.cart_items &&
|
191
|
+
additional_costs == o.additional_costs &&
|
192
|
+
identifiers == o.identifiers &&
|
193
|
+
attributes == o.attributes
|
194
|
+
end
|
195
|
+
|
196
|
+
# @see the `==` method
|
197
|
+
# @param [Object] Object to be compared
|
198
|
+
def eql?(o)
|
199
|
+
self == o
|
200
|
+
end
|
201
|
+
|
202
|
+
# Calculates hash code according to all attributes.
|
203
|
+
# @return [Integer] Hash code
|
204
|
+
def hash
|
205
|
+
[profile_id, coupon_codes, referral_code, state, cart_items, additional_costs, identifiers, attributes].hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Builds the object from hash
|
209
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
210
|
+
# @return [Object] Returns the model itself
|
211
|
+
def self.build_from_hash(attributes)
|
212
|
+
new.build_from_hash(attributes)
|
213
|
+
end
|
214
|
+
|
215
|
+
# Builds the object from hash
|
216
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
217
|
+
# @return [Object] Returns the model itself
|
218
|
+
def build_from_hash(attributes)
|
219
|
+
return nil unless attributes.is_a?(Hash)
|
220
|
+
self.class.openapi_types.each_pair do |key, type|
|
221
|
+
if type =~ /\AArray<(.*)>/i
|
222
|
+
# check to ensure the input is an array given that the attribute
|
223
|
+
# is documented as an array but the input is not
|
224
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
225
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
226
|
+
end
|
227
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
228
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
229
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
230
|
+
end
|
231
|
+
|
232
|
+
self
|
233
|
+
end
|
234
|
+
|
235
|
+
# Deserializes the data based on type
|
236
|
+
# @param string type Data type
|
237
|
+
# @param string value Value to be deserialized
|
238
|
+
# @return [Object] Deserialized data
|
239
|
+
def _deserialize(type, value)
|
240
|
+
case type.to_sym
|
241
|
+
when :DateTime
|
242
|
+
DateTime.parse(value)
|
243
|
+
when :Date
|
244
|
+
Date.parse(value)
|
245
|
+
when :String
|
246
|
+
value.to_s
|
247
|
+
when :Integer
|
248
|
+
value.to_i
|
249
|
+
when :Float
|
250
|
+
value.to_f
|
251
|
+
when :Boolean
|
252
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
253
|
+
true
|
254
|
+
else
|
255
|
+
false
|
256
|
+
end
|
257
|
+
when :Object
|
258
|
+
# generic object (usually a Hash), return directly
|
259
|
+
value
|
260
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
261
|
+
inner_type = Regexp.last_match[:inner_type]
|
262
|
+
value.map { |v| _deserialize(inner_type, v) }
|
263
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
264
|
+
k_type = Regexp.last_match[:k_type]
|
265
|
+
v_type = Regexp.last_match[:v_type]
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each do |k, v|
|
268
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
else # model
|
272
|
+
TalonOne.const_get(type).build_from_hash(value)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# Returns the string representation of the object
|
277
|
+
# @return [String] String presentation of the object
|
278
|
+
def to_s
|
279
|
+
to_hash.to_s
|
280
|
+
end
|
281
|
+
|
282
|
+
# to_body is an alias to to_hash (backward compatibility)
|
283
|
+
# @return [Hash] Returns the object in the form of hash
|
284
|
+
def to_body
|
285
|
+
to_hash
|
286
|
+
end
|
287
|
+
|
288
|
+
# Returns the object in the form of hash
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
290
|
+
def to_hash
|
291
|
+
hash = {}
|
292
|
+
self.class.attribute_map.each_pair do |attr, param|
|
293
|
+
value = self.send(attr)
|
294
|
+
if value.nil?
|
295
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
296
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
297
|
+
end
|
298
|
+
|
299
|
+
hash[param] = _to_hash(value)
|
300
|
+
end
|
301
|
+
hash
|
302
|
+
end
|
303
|
+
|
304
|
+
# Outputs non-array value in the form of hash
|
305
|
+
# For object, use to_hash. Otherwise, just return the value
|
306
|
+
# @param [Object] value Any valid value
|
307
|
+
# @return [Hash] Returns the value in the form of hash
|
308
|
+
def _to_hash(value)
|
309
|
+
if value.is_a?(Array)
|
310
|
+
value.compact.map { |v| _to_hash(v) }
|
311
|
+
elsif value.is_a?(Hash)
|
312
|
+
{}.tap do |hash|
|
313
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
314
|
+
end
|
315
|
+
elsif value.respond_to? :to_hash
|
316
|
+
value.to_hash
|
317
|
+
else
|
318
|
+
value
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|