Class: TalonOne::ApiModelBase
- Inherits:
-
Object
- Object
- TalonOne::ApiModelBase
- Defined in:
- lib/talon_one_sdk/api_model_base.rb
Direct Known Subclasses
APIError, AcceptCouponEffectProps, AcceptReferralEffectProps, AccessLogEntry, Account, AccountAdditionalCost, AccountAnalytics, AccountDashboardStatistic, AccountDashboardStatisticCampaigns, AccountDashboardStatisticDiscount, AccountDashboardStatisticLoyaltyPoints, AccountDashboardStatisticReferrals, AccountDashboardStatisticRevenue, AccountEntity, AccountLimits, Achievement, AchievementAdditionalProperties, AchievementAdditionalPropertiesV2, AchievementBase, AchievementBaseV2, AchievementProgress, AchievementProgressWithDefinition, AchievementReference, AchievementStatusEntry, AchievementV2, ActivateLoyaltyPoints, ActivateLoyaltyPointsResponse, ActivateUserRequest, AddFreeItemEffectProps, AddItemCatalogAction, AddLoyaltyPoints, AddLoyaltyPointsEffectProps, AddPriceAdjustmentCatalogAction, AddToAudienceEffectProps, AddedDeductedPointsBalancesAction, AddedDeductedPointsBalancesNotification, AddedDeductedPointsBalancesNotificationPolicy, AddedDeductedPointsNotification, AddedDeductedPointsNotificationPolicy, AdditionalCampaignProperties, AdditionalCost, AdjustmentDetails, AnalyticsDataPoint, AnalyticsDataPointWithTrend, AnalyticsDataPointWithTrendAndInfluencedRate, AnalyticsDataPointWithTrendAndUplift, AnalyticsProduct, AnalyticsSKU, Application, ApplicationAPIKey, ApplicationAnalyticsDataPoint, ApplicationApiHealth, ApplicationCIF, ApplicationCIFExpression, ApplicationCIFReferences, ApplicationCampaignAnalytics, ApplicationCampaignStats, ApplicationCustomer, ApplicationCustomerEntity, ApplicationEntity, ApplicationEvent, ApplicationNotification, ApplicationReferee, ApplicationSession, ApplicationSessionEntity, ApplicationStoreEntity, AsyncCouponCreationResponse, AsyncCouponDeletionJobResponse, AsyncCouponsData, Attribute, AttributesMandatory, AttributesSettings, Audience, AudienceAnalytics, AudienceCustomer, AudienceIntegrationID, AudienceMembership, AudienceReference, AwardGiveawayEffectProps, BaseCampaign, BaseLoyaltyProgram, BaseNotification, BaseNotificationEntity, BaseNotificationWebhook, BaseNotifications, BaseSamlConnection, BestPriorPrice, BestPriorPriceMetadata, BestPriorPriceRequest, BestPriorTarget, Binding, Blueprint, BulkApplicationNotification, BulkOperationOnCampaigns, Campaign, CampaignActivationRequest, CampaignAnalytics, CampaignBudget, CampaignCollection, CampaignCollectionEditedNotification, CampaignCollectionEditedNotificationItem, CampaignCollectionWithoutPayload, CampaignCopy, CampaignCreatedNotification, CampaignCreatedNotificationItem, CampaignDeactivationRequest, CampaignDeletedNotification, CampaignDeletedNotificationItem, CampaignDetail, CampaignEditedNotification, CampaignEditedNotificationItem, CampaignEntity, CampaignEvaluationGroup, CampaignEvaluationPosition, CampaignEvaluationTreeChangedMessage, CampaignEvaluationTreeChangedNotification, CampaignGroup, CampaignGroupEntity, CampaignLogSummary, CampaignNotificationBase, CampaignNotificationGeneric, CampaignNotificationItemBase, CampaignNotificationPolicy, CampaignRulesetChangedNotification, CampaignRulesetChangedNotificationItem, CampaignSearch, CampaignSet, CampaignSetBranchNode, CampaignSetLeafNode, CampaignSetNode, CampaignStateChangedNotification, CampaignStateChangedNotificationItem, CampaignStoreBudget, CampaignStoreBudgetLimitConfig, CampaignTemplate, CampaignTemplateCollection, CampaignTemplateCouponReservationSettings, CampaignTemplateParams, CampaignVersions, CardAddedDeductedPointsBalancesNotification, CardAddedDeductedPointsBalancesNotificationPolicy, CardAddedDeductedPointsNotification, CardAddedDeductedPointsNotificationPolicy, CardExpiringPointsNotificationPolicy, CardExpiringPointsNotificationTrigger, CardLedgerPointsEntryIntegrationAPI, CardLedgerTransactionLogEntry, CardLedgerTransactionLogEntryIntegrationAPI, CartItem, CartItemFilterTemplate, Catalog, CatalogActionFilter, CatalogItem, CatalogRule, CatalogSyncRequest, CatalogsStrikethroughNotificationPolicy, Change, ChangeLoyaltyTierLevelEffectProps, ChangeProfilePassword, CodeGeneratorSettings, Collection, CollectionItem, CollectionWithoutPayload, Coupon, CouponConstraints, CouponCreatedEffectProps, CouponCreationJob, CouponDeletionFilters, CouponDeletionJob, CouponEntity, CouponFailureSummary, CouponLimitConfigs, CouponRejectionReason, CouponReservations, CouponSearch, CouponValue, CouponWithApplication, CouponsNotificationData, CouponsNotificationPolicy, CreateAchievement, CreateAchievementV2, CreateApplicationAPIKey, CreateCouponData, CreateCoupons200Response, CreateMCPKey, CreateManagementKey, CreateReferralsForMultipleAdvocates201Response, CreateTemplateCampaign, CreateTemplateCampaignResponse, CustomEffect, CustomEffectProps, CustomerActivityReport, CustomerAnalytics, CustomerInventory, CustomerProfile, CustomerProfileAudienceRequest, CustomerProfileAudienceRequestItem, CustomerProfileEntity, CustomerProfileIntegrationRequestV2, CustomerProfileIntegrationResponseV2, CustomerProfileSearchQuery, CustomerProfileUpdateV2Response, CustomerSession, CustomerSessionV2, DeactivateUserRequest, DeductLoyaltyPoints, DeductLoyaltyPointsEffectProps, DeleteCouponsData, DeleteLoyaltyTransactionsRequest, DeleteUserRequest, Effect, EffectEntity, EmailEntity, EmbeddedAnalyticsConfiguration, EmbeddedAnalyticsConfigurationDashboards, EmbeddedDashboardConfiguration, Endpoint, Entity, EntityWithTalangVisibleID, Environment, ErrorEffectProps, ErrorResponse, ErrorResponseWithStatus, ErrorSource, EvaluableCampaignIds, Event, EventAttributesEntity, EventType, EventV2, EventV3, Experiment, ExperimentCampaignCopy, ExperimentCopy, ExperimentCopyExperiment, ExperimentListResults, ExperimentListResultsRequest, ExperimentResult, ExperimentResults, ExperimentSegmentInsight, ExperimentSegmentInsightMetric, ExperimentSegmentInsightVariant, ExperimentSegmentInsights, ExperimentVariant, ExperimentVariantAllocation, ExperimentVariantResult, ExperimentVariantResultConfidence, ExperimentVerdict, ExperimentVerdictResponse, ExpiringCardPointsData, ExpiringCardPointsNotification, ExpiringCouponsData, ExpiringCouponsNotification, ExpiringCouponsNotificationPolicy, ExpiringCouponsNotificationTrigger, ExpiringPointsData, ExpiringPointsNotification, ExpiringPointsNotificationPolicy, ExpiringPointsNotificationTrigger, Export, ExtendLoyaltyPointsExpiryDateEffectProps, ExtendedCoupon, FeatureFlag, FeaturesFeed, FuncArgDef, FunctionDef, GenerateAuditLogSummary, GenerateCampaignDescription, GenerateCampaignSummary, GenerateCampaignTags, GenerateCouponFailureDetailedSummary, GenerateCouponFailureSummary, GenerateCouponRejections200Response, GenerateItemFilterDescription, GenerateLoyaltyCard, GenerateRuleTitle, GenerateRuleTitleRule, GenerateUserSessionSummary, GetAccessLogsWithoutTotalCount200Response, GetAdditionalCosts200Response, GetApplicationCustomerFriends200Response, GetApplicationCustomers200Response, GetApplicationCustomersByAttributes200Response, GetApplicationEventTypes200Response, GetApplicationEventsWithoutTotalCount200Response, GetApplicationSessions200Response, GetApplications200Response, GetAttributes200Response, GetAudienceMemberships200Response, GetAudiences200Response, GetAudiencesAnalytics200Response, GetCampaignAnalytics200Response, GetCampaignGroups200Response, GetCampaignTemplates200Response, GetCampaigns200Response, GetChanges200Response, GetCollectionItems200Response, GetCouponsWithoutTotalCount200Response, GetCustomerAchievementHistory200Response, GetCustomerAchievements200Response, GetCustomerActivityReportsWithoutTotalCount200Response, GetCustomerProfileAchievementProgress200Response, GetCustomerProfiles200Response, GetCustomersByAttributes200Response, GetDashboardStatistics200Response, GetEventTypes200Response, GetExports200Response, GetIntegrationCouponRequest, GetLoyaltyCardPoints200Response, GetLoyaltyCardTransactionLogs200Response, GetLoyaltyCardTransactions200Response, GetLoyaltyCards200Response, GetLoyaltyProgramProfilePoints200Response, GetLoyaltyProgramProfileTransactions200Response, GetLoyaltyProgramTransactions200Response, GetLoyaltyPrograms200Response, GetReferralsWithoutTotalCount200Response, GetReservedCustomers200Response, GetRulesets200Response, GetUsers200Response, GetWebhooks200Response, Giveaway, GiveawayPoolNotification, GiveawayPoolNotificationData, GiveawaysPool, HiddenConditionsEffects, History, IdentifiableEntity, Import, ImportEntity, IncreaseAchievementProgressEffectProps, InfluencingCampaignDetails, IntegrationCampaign, IntegrationCoupon, IntegrationCustomerProfileAudienceRequest, IntegrationCustomerProfileAudienceRequestItem, IntegrationCustomerSessionResponse, IntegrationEntity, IntegrationEvent, IntegrationEventV2Request, IntegrationEventV2Response, IntegrationEventV3Request, IntegrationEventV3Response, IntegrationGetAllCampaigns200Response, IntegrationHubConfig, IntegrationHubEventPayloadCouponBasedNotifications, IntegrationHubEventPayloadCouponBasedNotificationsLimits, IntegrationHubEventPayloadLoyaltyProfileBasedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification, IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction, IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification, IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification, IntegrationHubEventRecord, IntegrationHubFlow, IntegrationHubFlowConfig, IntegrationHubFlowConfigResponse, IntegrationHubFlowResponse, IntegrationHubFlowWithConfig, IntegrationHubPaginatedEventPayload, IntegrationProfileEntity, IntegrationProfileEntityV3, IntegrationRequest, IntegrationResponse, IntegrationState, IntegrationStateV2, IntegrationStoreEntity, InventoryCoupon, InventoryReferral, ItemAttribute, LabelTargetAudience, LabelTargetNone, LedgerEntry, LedgerInfo, LedgerPointsEntryIntegrationAPI, LedgerTransactionLogEntryIntegrationAPI, LibraryAttribute, LimitConfig, LimitCounter, ListAccountCollections200Response, ListAchievements200Response, ListAllRolesV2200Response, ListApplicationCartItemFilters200Response, ListCampaignStoreBudgetLimits200Response, ListCampaignStoreBudgets, ListCampaignStoreBudgetsStore, ListCatalogItems200Response, ListExperiments200Response, ListStores200Response, LoginParams, Loyalty, LoyaltyBalance, LoyaltyBalanceWithTier, LoyaltyBalances, LoyaltyBalancesWithTiers, LoyaltyCard, LoyaltyCardBalances, LoyaltyCardBatch, LoyaltyCardBatchResponse, LoyaltyCardProfileRegistration, LoyaltyCardRegistration, LoyaltyDashboardData, LoyaltyDashboardPointsBreakdown, LoyaltyLedger, LoyaltyLedgerEntry, LoyaltyLedgerEntryExpiryDateChange, LoyaltyLedgerEntryFlags, LoyaltyLedgerTransactions, LoyaltyMembership, LoyaltyProgram, LoyaltyProgramBalance, LoyaltyProgramEntity, LoyaltyProgramLedgers, LoyaltyProgramTransaction, LoyaltySubLedger, LoyaltyTier, MCPKey, ManagementKey, ManagerConfig, MessageLogEntries, MessageLogEntry, MessageLogRequest, MessageLogResponse, MessageTest, Meta, ModelReturn, MultiApplicationEntity, MultipleAttribute, MultipleAudiences, MultipleAudiencesItem, MultipleCustomerProfileIntegrationRequest, MultipleCustomerProfileIntegrationRequestItem, MultipleCustomerProfileIntegrationResponseV2, MultipleNewAttribute, MultipleNewAudiences, MutableEntity, NewAccount, NewAccountSignUp, NewAdditionalCost, NewAppWideCouponDeletionJob, NewApplication, NewApplicationAPIKey, NewApplicationCIF, NewApplicationCIFExpression, NewAttribute, NewAudience, NewBaseNotification, NewBlueprint, NewCampaign, NewCampaignCollection, NewCampaignEvaluationGroup, NewCampaignGroup, NewCampaignSet, NewCampaignStoreBudget, NewCampaignStoreBudgetStoreLimit, NewCampaignTemplate, NewCatalog, NewCollection, NewCouponCreationJob, NewCouponDeletionJob, NewCoupons, NewCouponsForMultipleRecipients, NewCustomEffect, NewCustomerProfile, NewCustomerSession, NewCustomerSessionV2, NewEvent, NewEventType, NewExperiment, NewExperimentVariant, NewExperimentVariantArray, NewExternalInvitation, NewGiveawaysPool, NewInternalAudience, NewInvitation, NewInviteEmail, NewLoyaltyProgram, NewLoyaltyTier, NewMCPKey, NewManagementKey, NewMessageTest, NewMultipleAudiencesItem, NewNotificationWebhook, NewOutgoingIntegrationWebhook, NewPassword, NewPasswordEmail, NewPicklist, NewPriceAdjustment, NewPriceType, NewReferral, NewReferralsForMultipleAdvocates, NewReturn, NewRevisionVersion, NewReward, NewRole, NewRoleV2, NewRuleset, NewSamlConnection, NewSecondaryDeployment, NewStore, NewTemplateDef, NewUser, NewWebhook, Notification, NotificationActivation, NotificationListItem, OktaEvent, OktaEventPayload, OktaEventPayloadData, OktaEventTarget, OneTimeCode, OutgoingIntegrationBrazePolicy, OutgoingIntegrationCleverTapPolicy, OutgoingIntegrationConfiguration, OutgoingIntegrationIterablePolicy, OutgoingIntegrationMoEngagePolicy, OutgoingIntegrationTemplate, OutgoingIntegrationTemplateWithConfigurationDetails, OutgoingIntegrationTemplates, OutgoingIntegrationType, OutgoingIntegrationTypes, PatchItemCatalogAction, PatchManyItemsCatalogAction, PendingActivePointsData, PendingActivePointsNotification, PendingPointsNotificationPolicy, Picklist, PlaceholderDetails, PriceDetail, PriceHistoryRequest, PriceHistoryResponse, PriceType, PriceTypeReferenceDetail, PriceTypeReferences, Product, ProductSearchMatch, ProductUnitAnalytics, ProductUnitAnalyticsDataPoint, ProductUnitAnalyticsTotals, ProfileAudiencesChanges, ProjectedTier, PromoteExperiment, RedeemReferralEffectProps, Referral, ReferralConstraints, ReferralCreatedEffectProps, ReferralRejectionReason, RejectCouponEffectProps, RejectReferralEffectProps, RemoveFromAudienceEffectProps, RemoveItemCatalogAction, RemoveManyItemsCatalogAction, ReopenSessionResponse, ReserveCouponEffectProps, ResponseContentObject, ReturnIntegrationRequest, ReturnedCartItem, Revision, RevisionActivation, RevisionActivationRequest, RevisionVersion, Reward, Role, RoleAssign, RoleMembership, RoleV2, RoleV2ApplicationDetails, RoleV2Base, RoleV2PermissionSet, RoleV2Permissions, RoleV2Readonly, RoleV2RolesGroup, RolesV2Thresholds, RollbackAddedLoyaltyPointsEffectProps, RollbackCouponEffectProps, RollbackDeductedLoyaltyPointsEffectProps, RollbackDiscountEffectProps, RollbackIncreasedAchievementProgressEffectProps, RollbackReferralEffectProps, Rule, RuleFailureReason, RuleMetadata, Ruleset, SSOConfig, SamlConnection, SamlConnectionInternal, SamlConnectionMetadata, SamlLoginEndpoint, ScimBaseGroup, ScimBaseUser, ScimBaseUserName, ScimGroup, ScimGroupMember, ScimGroupsListResponse, ScimNewUser, ScimPatchOperation, ScimPatchRequest, ScimResource, ScimResourceTypesListResponse, ScimSchemaResource, ScimSchemasListResponse, ScimServiceProviderConfigResponse, ScimServiceProviderConfigResponseBulk, ScimServiceProviderConfigResponseChangePassword, ScimServiceProviderConfigResponseFilter, ScimServiceProviderConfigResponsePatch, ScimServiceProviderConfigResponseSort, ScimUser, ScimUsersListResponse, SecondaryDeployment, Session, SetDiscountEffectProps, SetDiscountPerAdditionalCostEffectProps, SetDiscountPerAdditionalCostPerItemEffectProps, SetDiscountPerItemEffectProps, SetLoyaltyPointsExpiryDateEffectProps, ShowBundleMetadataEffectProps, ShowNotificationEffectProps, SkuUnitAnalytics, SkuUnitAnalyticsDataPoint, SlotDef, Store, StrikethroughChangedItem, StrikethroughCustomEffectPerItemProps, StrikethroughDebugResponse, StrikethroughEffect, StrikethroughLabelingNotification, StrikethroughSetDiscountPerItemEffectProps, StrikethroughSetDiscountPerItemMemberEffectProps, StrikethroughTrigger, SummarizeCampaignStoreBudget200Response, SummaryCampaignStoreBudget, TalangAttribute, TalangAttributeVisibility, TemplateArgDef, TemplateDef, TemplateLimitConfig, Tier, TierDowngradeData, TierDowngradeNotification, TierDowngradeNotificationPolicy, TierUpgradeData, TierUpgradeNotification, TierUpgradeNotificationPolicy, TierWillDowngradeData, TierWillDowngradeNotification, TierWillDowngradeNotificationPolicy, TierWillDowngradeNotificationTrigger, TimePoint, TransferLoyaltyCard, TriggerWebhookEffectProps, TwoFAConfig, UpdateAccount, UpdateAchievement, UpdateAchievementV2, UpdateApplication, UpdateApplicationAPIKey, UpdateApplicationCIF, UpdateAttributeEffectProps, UpdateAudience, UpdateBlueprint, UpdateCampaign, UpdateCampaignCollection, UpdateCampaignEvaluationGroup, UpdateCampaignGroup, UpdateCampaignTemplate, UpdateCatalog, UpdateCollection, UpdateCoupon, UpdateCouponBatch, UpdateCouponsData, UpdateCustomEffect, UpdateCustomerProfileV2409Response, UpdateCustomerSessionV2409Response, UpdateExperiment, UpdateExperimentVariant, UpdateExperimentVariantArray, UpdateExperimentVariantName, UpdateLoyaltyCard, UpdateLoyaltyCardRequest, UpdateLoyaltyProgram, UpdateLoyaltyProgramTier, UpdatePicklist, UpdatePriceType, UpdateReferral, UpdateReferralBatch, UpdateRole, UpdateStore, UpdateUser, User, UserEntity, ValueMap, Webhook, WebhookAuthentication, WebhookAuthenticationDataBasic, WebhookAuthenticationDataCustom, WebhookAuthenticationWebhookRef, WebhookWithOutgoingIntegrationDetails, WillAwardGiveawayEffectProps
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
Instance Method Summary collapse
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_s ⇒ String
Returns the string representation of the object.
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/talon_one_sdk/api_model_base.rb', line 19 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = TalonOne.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
Instance Method Details
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/talon_one_sdk/api_model_base.rb', line 74 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
66 67 68 |
# File 'lib/talon_one_sdk/api_model_base.rb', line 66 def to_body to_hash end |
#to_s ⇒ String
Returns the string representation of the object
60 61 62 |
# File 'lib/talon_one_sdk/api_model_base.rb', line 60 def to_s to_hash.to_s end |