diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 618ff789..6005749c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -166,6 +166,7 @@ docs/CardLedgerTransactionLogEntryIntegrationAPI.md docs/CartItem.md docs/CartItemFilterTemplate.md docs/Catalog.md +docs/CatalogAction.md docs/CatalogActionFilter.md docs/CatalogItem.md docs/CatalogRule.md @@ -245,6 +246,9 @@ docs/EventAttributesEntity.md docs/EventType.md docs/EventV2.md docs/EventV3.md +docs/EventV3Connections.md +docs/EventV3Entity.md +docs/EventV3RequestEntity.md docs/Experiment.md docs/ExperimentCampaignCopy.md docs/ExperimentCopy.md @@ -277,6 +281,7 @@ docs/Export.md docs/ExtendLoyaltyPointsExpiryDateEffectProps.md docs/ExtendedCoupon.md docs/FeatureFlag.md +docs/FeatureFlagUpdate.md docs/FeaturesFeed.md docs/FuncArgDef.md docs/FunctionDef.md @@ -347,6 +352,7 @@ docs/IncreaseAchievementProgressEffectProps.md docs/InfluencingCampaignDetails.md docs/IntegrationApi.md docs/IntegrationCampaign.md +docs/IntegrationCampaignBase.md docs/IntegrationCoupon.md docs/IntegrationCustomerProfileAudienceRequest.md docs/IntegrationCustomerProfileAudienceRequestItem.md @@ -367,6 +373,7 @@ docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationActio docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md docs/IntegrationHubEventRecord.md +docs/IntegrationHubEventStatusUpdate.md docs/IntegrationHubFlow.md docs/IntegrationHubFlowConfig.md docs/IntegrationHubFlowConfigResponse.md @@ -483,6 +490,7 @@ docs/NewCustomerSession.md docs/NewCustomerSessionV2.md docs/NewEvent.md docs/NewEventType.md +docs/NewEventV3Entity.md docs/NewExperiment.md docs/NewExperimentVariant.md docs/NewExperimentVariantArray.md @@ -509,6 +517,7 @@ docs/NewReferralsForMultipleAdvocates.md docs/NewReturn.md docs/NewRevisionVersion.md docs/NewReward.md +docs/NewRiskNotification.md docs/NewRole.md docs/NewRoleV2.md docs/NewRuleset.md @@ -577,6 +586,8 @@ docs/RevisionActivation.md docs/RevisionActivationRequest.md docs/RevisionVersion.md docs/Reward.md +docs/RewardPointsRequired.md +docs/RiskNotification.md docs/Role.md docs/RoleAssign.md docs/RoleMembership.md @@ -599,6 +610,7 @@ docs/RuleEligibility.md docs/RuleEligibilityFailureDetails.md docs/RuleFailureReason.md docs/RuleMetadata.md +docs/RuleMetadataEligibility.md docs/Ruleset.md docs/SSOConfig.md docs/SamlConnection.md @@ -649,6 +661,8 @@ docs/StrikethroughSetDiscountPerItemMemberEffectProps.md docs/StrikethroughTrigger.md docs/SummarizeCampaignStoreBudget200Response.md docs/SummaryCampaignStoreBudget.md +docs/SupportRequest.md +docs/SupportRequestInput.md docs/TalangAttribute.md docs/TalangAttributeVisibility.md docs/TemplateArgDef.md @@ -706,6 +720,7 @@ docs/UpdateReferralBatch.md docs/UpdateReward.md docs/UpdateRole.md docs/UpdateStore.md +docs/UpdateSupportRequest.md docs/UpdateUser.md docs/User.md docs/UserEntity.md @@ -900,6 +915,7 @@ src/main/java/one/talon/model/CardLedgerTransactionLogEntryIntegrationAPI.java src/main/java/one/talon/model/CartItem.java src/main/java/one/talon/model/CartItemFilterTemplate.java src/main/java/one/talon/model/Catalog.java +src/main/java/one/talon/model/CatalogAction.java src/main/java/one/talon/model/CatalogActionFilter.java src/main/java/one/talon/model/CatalogItem.java src/main/java/one/talon/model/CatalogRule.java @@ -979,6 +995,9 @@ src/main/java/one/talon/model/EventAttributesEntity.java src/main/java/one/talon/model/EventType.java src/main/java/one/talon/model/EventV2.java src/main/java/one/talon/model/EventV3.java +src/main/java/one/talon/model/EventV3Connections.java +src/main/java/one/talon/model/EventV3Entity.java +src/main/java/one/talon/model/EventV3RequestEntity.java src/main/java/one/talon/model/Experiment.java src/main/java/one/talon/model/ExperimentCampaignCopy.java src/main/java/one/talon/model/ExperimentCopy.java @@ -1011,6 +1030,7 @@ src/main/java/one/talon/model/Export.java src/main/java/one/talon/model/ExtendLoyaltyPointsExpiryDateEffectProps.java src/main/java/one/talon/model/ExtendedCoupon.java src/main/java/one/talon/model/FeatureFlag.java +src/main/java/one/talon/model/FeatureFlagUpdate.java src/main/java/one/talon/model/FeaturesFeed.java src/main/java/one/talon/model/FuncArgDef.java src/main/java/one/talon/model/FunctionDef.java @@ -1080,6 +1100,7 @@ src/main/java/one/talon/model/ImportEntity.java src/main/java/one/talon/model/IncreaseAchievementProgressEffectProps.java src/main/java/one/talon/model/InfluencingCampaignDetails.java src/main/java/one/talon/model/IntegrationCampaign.java +src/main/java/one/talon/model/IntegrationCampaignBase.java src/main/java/one/talon/model/IntegrationCoupon.java src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequest.java src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequestItem.java @@ -1100,6 +1121,7 @@ src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPoint src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.java src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.java src/main/java/one/talon/model/IntegrationHubEventRecord.java +src/main/java/one/talon/model/IntegrationHubEventStatusUpdate.java src/main/java/one/talon/model/IntegrationHubFlow.java src/main/java/one/talon/model/IntegrationHubFlowConfig.java src/main/java/one/talon/model/IntegrationHubFlowConfigResponse.java @@ -1215,6 +1237,7 @@ src/main/java/one/talon/model/NewCustomerSession.java src/main/java/one/talon/model/NewCustomerSessionV2.java src/main/java/one/talon/model/NewEvent.java src/main/java/one/talon/model/NewEventType.java +src/main/java/one/talon/model/NewEventV3Entity.java src/main/java/one/talon/model/NewExperiment.java src/main/java/one/talon/model/NewExperimentVariant.java src/main/java/one/talon/model/NewExperimentVariantArray.java @@ -1241,6 +1264,7 @@ src/main/java/one/talon/model/NewReferralsForMultipleAdvocates.java src/main/java/one/talon/model/NewReturn.java src/main/java/one/talon/model/NewRevisionVersion.java src/main/java/one/talon/model/NewReward.java +src/main/java/one/talon/model/NewRiskNotification.java src/main/java/one/talon/model/NewRole.java src/main/java/one/talon/model/NewRoleV2.java src/main/java/one/talon/model/NewRuleset.java @@ -1309,6 +1333,8 @@ src/main/java/one/talon/model/RevisionActivation.java src/main/java/one/talon/model/RevisionActivationRequest.java src/main/java/one/talon/model/RevisionVersion.java src/main/java/one/talon/model/Reward.java +src/main/java/one/talon/model/RewardPointsRequired.java +src/main/java/one/talon/model/RiskNotification.java src/main/java/one/talon/model/Role.java src/main/java/one/talon/model/RoleAssign.java src/main/java/one/talon/model/RoleMembership.java @@ -1331,6 +1357,7 @@ src/main/java/one/talon/model/RuleEligibility.java src/main/java/one/talon/model/RuleEligibilityFailureDetails.java src/main/java/one/talon/model/RuleFailureReason.java src/main/java/one/talon/model/RuleMetadata.java +src/main/java/one/talon/model/RuleMetadataEligibility.java src/main/java/one/talon/model/Ruleset.java src/main/java/one/talon/model/SSOConfig.java src/main/java/one/talon/model/SamlConnection.java @@ -1381,6 +1408,8 @@ src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.j src/main/java/one/talon/model/StrikethroughTrigger.java src/main/java/one/talon/model/SummarizeCampaignStoreBudget200Response.java src/main/java/one/talon/model/SummaryCampaignStoreBudget.java +src/main/java/one/talon/model/SupportRequest.java +src/main/java/one/talon/model/SupportRequestInput.java src/main/java/one/talon/model/TalangAttribute.java src/main/java/one/talon/model/TalangAttributeVisibility.java src/main/java/one/talon/model/TemplateArgDef.java @@ -1438,6 +1467,7 @@ src/main/java/one/talon/model/UpdateReferralBatch.java src/main/java/one/talon/model/UpdateReward.java src/main/java/one/talon/model/UpdateRole.java src/main/java/one/talon/model/UpdateStore.java +src/main/java/one/talon/model/UpdateSupportRequest.java src/main/java/one/talon/model/UpdateUser.java src/main/java/one/talon/model/User.java src/main/java/one/talon/model/UserEntity.java @@ -1605,6 +1635,7 @@ src/test/java/one/talon/model/CardLedgerTransactionLogEntryTest.java src/test/java/one/talon/model/CartItemFilterTemplateTest.java src/test/java/one/talon/model/CartItemTest.java src/test/java/one/talon/model/CatalogActionFilterTest.java +src/test/java/one/talon/model/CatalogActionTest.java src/test/java/one/talon/model/CatalogItemTest.java src/test/java/one/talon/model/CatalogRuleTest.java src/test/java/one/talon/model/CatalogSyncRequestTest.java @@ -1683,6 +1714,9 @@ src/test/java/one/talon/model/EventAttributesEntityTest.java src/test/java/one/talon/model/EventTest.java src/test/java/one/talon/model/EventTypeTest.java src/test/java/one/talon/model/EventV2Test.java +src/test/java/one/talon/model/EventV3ConnectionsTest.java +src/test/java/one/talon/model/EventV3EntityTest.java +src/test/java/one/talon/model/EventV3RequestEntityTest.java src/test/java/one/talon/model/EventV3Test.java src/test/java/one/talon/model/ExperimentCampaignCopyTest.java src/test/java/one/talon/model/ExperimentCopyExperimentTest.java @@ -1716,6 +1750,7 @@ src/test/java/one/talon/model/ExportTest.java src/test/java/one/talon/model/ExtendLoyaltyPointsExpiryDateEffectPropsTest.java src/test/java/one/talon/model/ExtendedCouponTest.java src/test/java/one/talon/model/FeatureFlagTest.java +src/test/java/one/talon/model/FeatureFlagUpdateTest.java src/test/java/one/talon/model/FeaturesFeedTest.java src/test/java/one/talon/model/FuncArgDefTest.java src/test/java/one/talon/model/FunctionDefTest.java @@ -1784,6 +1819,7 @@ src/test/java/one/talon/model/IdentifiableEntityTest.java src/test/java/one/talon/model/ImportEntityTest.java src/test/java/one/talon/model/IncreaseAchievementProgressEffectPropsTest.java src/test/java/one/talon/model/InfluencingCampaignDetailsTest.java +src/test/java/one/talon/model/IntegrationCampaignBaseTest.java src/test/java/one/talon/model/IntegrationCampaignTest.java src/test/java/one/talon/model/IntegrationCouponTest.java src/test/java/one/talon/model/IntegrationCustomerProfileAudienceRequestItemTest.java @@ -1805,6 +1841,7 @@ src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPoint src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotificationTest.java src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificationTest.java src/test/java/one/talon/model/IntegrationHubEventRecordTest.java +src/test/java/one/talon/model/IntegrationHubEventStatusUpdateTest.java src/test/java/one/talon/model/IntegrationHubFlowConfigResponseTest.java src/test/java/one/talon/model/IntegrationHubFlowConfigTest.java src/test/java/one/talon/model/IntegrationHubFlowResponseTest.java @@ -1920,6 +1957,7 @@ src/test/java/one/talon/model/NewCustomerSessionTest.java src/test/java/one/talon/model/NewCustomerSessionV2Test.java src/test/java/one/talon/model/NewEventTest.java src/test/java/one/talon/model/NewEventTypeTest.java +src/test/java/one/talon/model/NewEventV3EntityTest.java src/test/java/one/talon/model/NewExperimentTest.java src/test/java/one/talon/model/NewExperimentVariantArrayTest.java src/test/java/one/talon/model/NewExperimentVariantTest.java @@ -1946,6 +1984,7 @@ src/test/java/one/talon/model/NewReferralsForMultipleAdvocatesTest.java src/test/java/one/talon/model/NewReturnTest.java src/test/java/one/talon/model/NewRevisionVersionTest.java src/test/java/one/talon/model/NewRewardTest.java +src/test/java/one/talon/model/NewRiskNotificationTest.java src/test/java/one/talon/model/NewRoleTest.java src/test/java/one/talon/model/NewRoleV2Test.java src/test/java/one/talon/model/NewRulesetTest.java @@ -2013,7 +2052,9 @@ src/test/java/one/talon/model/RevisionActivationRequestTest.java src/test/java/one/talon/model/RevisionActivationTest.java src/test/java/one/talon/model/RevisionTest.java src/test/java/one/talon/model/RevisionVersionTest.java +src/test/java/one/talon/model/RewardPointsRequiredTest.java src/test/java/one/talon/model/RewardTest.java +src/test/java/one/talon/model/RiskNotificationTest.java src/test/java/one/talon/model/RoleAssignTest.java src/test/java/one/talon/model/RoleMembershipTest.java src/test/java/one/talon/model/RoleTest.java @@ -2034,6 +2075,7 @@ src/test/java/one/talon/model/RollbackReferralEffectPropsTest.java src/test/java/one/talon/model/RuleEligibilityFailureDetailsTest.java src/test/java/one/talon/model/RuleEligibilityTest.java src/test/java/one/talon/model/RuleFailureReasonTest.java +src/test/java/one/talon/model/RuleMetadataEligibilityTest.java src/test/java/one/talon/model/RuleMetadataTest.java src/test/java/one/talon/model/RuleTest.java src/test/java/one/talon/model/RulesetTest.java @@ -2086,6 +2128,8 @@ src/test/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectPropsTe src/test/java/one/talon/model/StrikethroughTriggerTest.java src/test/java/one/talon/model/SummarizeCampaignStoreBudget200ResponseTest.java src/test/java/one/talon/model/SummaryCampaignStoreBudgetTest.java +src/test/java/one/talon/model/SupportRequestInputTest.java +src/test/java/one/talon/model/SupportRequestTest.java src/test/java/one/talon/model/TalangAttributeTest.java src/test/java/one/talon/model/TalangAttributeVisibilityTest.java src/test/java/one/talon/model/TemplateArgDefTest.java @@ -2143,6 +2187,7 @@ src/test/java/one/talon/model/UpdateReferralTest.java src/test/java/one/talon/model/UpdateRewardTest.java src/test/java/one/talon/model/UpdateRoleTest.java src/test/java/one/talon/model/UpdateStoreTest.java +src/test/java/one/talon/model/UpdateSupportRequestTest.java src/test/java/one/talon/model/UpdateUserTest.java src/test/java/one/talon/model/UserEntityTest.java src/test/java/one/talon/model/UserTest.java diff --git a/README.md b/README.md index 3347f606..98b7a563 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Add this dependency to your project's POM: one.talon talon-one-client - 26.09.0 + 26.11.0 compile ``` @@ -52,7 +52,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "one.talon:talon-one-client:26.09.0" +compile "one.talon:talon-one-client:26.11.0" ``` ### Others @@ -349,12 +349,12 @@ Class | Method | HTTP request | Description *ManagementApi* | [**getExperiment**](docs/ManagementApi.md#getExperiment) | **GET** /v1/applications/{applicationId}/experiments/{experimentId} | Get experiment in Application *ManagementApi* | [**getExports**](docs/ManagementApi.md#getExports) | **GET** /v1/exports | Get exports *ManagementApi* | [**getLoyaltyCard**](docs/ManagementApi.md#getLoyaltyCard) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Get loyalty card -*ManagementApi* | [**getLoyaltyCardTransactionLogs**](docs/ManagementApi.md#getLoyaltyCardTransactionLogs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions +*ManagementApi* | [**getLoyaltyCardTransactionLogs**](docs/ManagementApi.md#getLoyaltyCardTransactionLogs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions (Management API) *ManagementApi* | [**getLoyaltyCards**](docs/ManagementApi.md#getLoyaltyCards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards | List loyalty cards -*ManagementApi* | [**getLoyaltyLedgerBalances**](docs/ManagementApi.md#getLoyaltyLedgerBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances +*ManagementApi* | [**getLoyaltyLedgerBalances**](docs/ManagementApi.md#getLoyaltyLedgerBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances (Management API) *ManagementApi* | [**getLoyaltyPoints**](docs/ManagementApi.md#getLoyaltyPoints) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} | Get customer's full loyalty ledger *ManagementApi* | [**getLoyaltyProgram**](docs/ManagementApi.md#getLoyaltyProgram) | **GET** /v1/loyalty_programs/{loyaltyProgramId} | Get loyalty program -*ManagementApi* | [**getLoyaltyProgramProfileLedgerTransactions**](docs/ManagementApi.md#getLoyaltyProgramProfileLedgerTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions +*ManagementApi* | [**getLoyaltyProgramProfileLedgerTransactions**](docs/ManagementApi.md#getLoyaltyProgramProfileLedgerTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions (Management API) *ManagementApi* | [**getLoyaltyProgramTransactions**](docs/ManagementApi.md#getLoyaltyProgramTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/transactions | List loyalty program transactions *ManagementApi* | [**getLoyaltyPrograms**](docs/ManagementApi.md#getLoyaltyPrograms) | **GET** /v1/loyalty_programs | List loyalty programs *ManagementApi* | [**getLoyaltyStatistics**](docs/ManagementApi.md#getLoyaltyStatistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics @@ -584,6 +584,7 @@ Class | Method | HTTP request | Description - [CartItem](docs/CartItem.md) - [CartItemFilterTemplate](docs/CartItemFilterTemplate.md) - [Catalog](docs/Catalog.md) +- [CatalogAction](docs/CatalogAction.md) - [CatalogActionFilter](docs/CatalogActionFilter.md) - [CatalogItem](docs/CatalogItem.md) - [CatalogRule](docs/CatalogRule.md) @@ -663,6 +664,9 @@ Class | Method | HTTP request | Description - [EventType](docs/EventType.md) - [EventV2](docs/EventV2.md) - [EventV3](docs/EventV3.md) +- [EventV3Connections](docs/EventV3Connections.md) +- [EventV3Entity](docs/EventV3Entity.md) +- [EventV3RequestEntity](docs/EventV3RequestEntity.md) - [Experiment](docs/Experiment.md) - [ExperimentCampaignCopy](docs/ExperimentCampaignCopy.md) - [ExperimentCopy](docs/ExperimentCopy.md) @@ -695,6 +699,7 @@ Class | Method | HTTP request | Description - [ExtendLoyaltyPointsExpiryDateEffectProps](docs/ExtendLoyaltyPointsExpiryDateEffectProps.md) - [ExtendedCoupon](docs/ExtendedCoupon.md) - [FeatureFlag](docs/FeatureFlag.md) +- [FeatureFlagUpdate](docs/FeatureFlagUpdate.md) - [FeaturesFeed](docs/FeaturesFeed.md) - [FuncArgDef](docs/FuncArgDef.md) - [FunctionDef](docs/FunctionDef.md) @@ -764,6 +769,7 @@ Class | Method | HTTP request | Description - [IncreaseAchievementProgressEffectProps](docs/IncreaseAchievementProgressEffectProps.md) - [InfluencingCampaignDetails](docs/InfluencingCampaignDetails.md) - [IntegrationCampaign](docs/IntegrationCampaign.md) +- [IntegrationCampaignBase](docs/IntegrationCampaignBase.md) - [IntegrationCoupon](docs/IntegrationCoupon.md) - [IntegrationCustomerProfileAudienceRequest](docs/IntegrationCustomerProfileAudienceRequest.md) - [IntegrationCustomerProfileAudienceRequestItem](docs/IntegrationCustomerProfileAudienceRequestItem.md) @@ -784,6 +790,7 @@ Class | Method | HTTP request | Description - [IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md) - [IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification](docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md) - [IntegrationHubEventRecord](docs/IntegrationHubEventRecord.md) +- [IntegrationHubEventStatusUpdate](docs/IntegrationHubEventStatusUpdate.md) - [IntegrationHubFlow](docs/IntegrationHubFlow.md) - [IntegrationHubFlowConfig](docs/IntegrationHubFlowConfig.md) - [IntegrationHubFlowConfigResponse](docs/IntegrationHubFlowConfigResponse.md) @@ -899,6 +906,7 @@ Class | Method | HTTP request | Description - [NewCustomerSessionV2](docs/NewCustomerSessionV2.md) - [NewEvent](docs/NewEvent.md) - [NewEventType](docs/NewEventType.md) +- [NewEventV3Entity](docs/NewEventV3Entity.md) - [NewExperiment](docs/NewExperiment.md) - [NewExperimentVariant](docs/NewExperimentVariant.md) - [NewExperimentVariantArray](docs/NewExperimentVariantArray.md) @@ -925,6 +933,7 @@ Class | Method | HTTP request | Description - [NewReturn](docs/NewReturn.md) - [NewRevisionVersion](docs/NewRevisionVersion.md) - [NewReward](docs/NewReward.md) +- [NewRiskNotification](docs/NewRiskNotification.md) - [NewRole](docs/NewRole.md) - [NewRoleV2](docs/NewRoleV2.md) - [NewRuleset](docs/NewRuleset.md) @@ -993,6 +1002,8 @@ Class | Method | HTTP request | Description - [RevisionActivationRequest](docs/RevisionActivationRequest.md) - [RevisionVersion](docs/RevisionVersion.md) - [Reward](docs/Reward.md) +- [RewardPointsRequired](docs/RewardPointsRequired.md) +- [RiskNotification](docs/RiskNotification.md) - [Role](docs/Role.md) - [RoleAssign](docs/RoleAssign.md) - [RoleMembership](docs/RoleMembership.md) @@ -1015,6 +1026,7 @@ Class | Method | HTTP request | Description - [RuleEligibilityFailureDetails](docs/RuleEligibilityFailureDetails.md) - [RuleFailureReason](docs/RuleFailureReason.md) - [RuleMetadata](docs/RuleMetadata.md) +- [RuleMetadataEligibility](docs/RuleMetadataEligibility.md) - [Ruleset](docs/Ruleset.md) - [SSOConfig](docs/SSOConfig.md) - [SamlConnection](docs/SamlConnection.md) @@ -1065,6 +1077,8 @@ Class | Method | HTTP request | Description - [StrikethroughTrigger](docs/StrikethroughTrigger.md) - [SummarizeCampaignStoreBudget200Response](docs/SummarizeCampaignStoreBudget200Response.md) - [SummaryCampaignStoreBudget](docs/SummaryCampaignStoreBudget.md) +- [SupportRequest](docs/SupportRequest.md) +- [SupportRequestInput](docs/SupportRequestInput.md) - [TalangAttribute](docs/TalangAttribute.md) - [TalangAttributeVisibility](docs/TalangAttributeVisibility.md) - [TemplateArgDef](docs/TemplateArgDef.md) @@ -1122,6 +1136,7 @@ Class | Method | HTTP request | Description - [UpdateReward](docs/UpdateReward.md) - [UpdateRole](docs/UpdateRole.md) - [UpdateStore](docs/UpdateStore.md) +- [UpdateSupportRequest](docs/UpdateSupportRequest.md) - [UpdateUser](docs/UpdateUser.md) - [User](docs/User.md) - [UserEntity](docs/UserEntity.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 53b8abfb..3f25b9d9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1475,21 +1475,15 @@ paths: To use this endpoint: - 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) + 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. - 1. Update or create a rule to check for this event. - 1. Trigger the event with this endpoint. After you have successfully sent an - event to Talon.One, you can list the received events in the **Events** view - in the Campaign Manager. - - Talon.One also offers a set of [built-in - events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure - you do not create a custom event when you can use a built-in event. + 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. + 1. Trigger the event with this endpoint. - For example, use this endpoint to trigger an event when a customer shares a - link to a product. + You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. - See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). + For example, you can use this endpoint to trigger an event when a customer shares a + link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. @@ -2447,8 +2441,10 @@ paths: You can filter balances by date and subledger ID, and include tier-related information in the response. - > [!note] If no filtering options are applied, you retrieve all loyalty - > balances on the current date for the given integration ID. + > [!note] **Note** + > - For most use cases, especially real-time integrations, use the Integration API endpoint: + [Get customer's loyalty balances](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances). + > - If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances @@ -2563,7 +2559,7 @@ paths: schema: $ref: "#/components/schemas/ErrorResponseWithStatus" description: Not found - summary: Get customer's loyalty balances + summary: Get customer's loyalty balances (Management API) tags: - management x-accepts: @@ -2942,9 +2938,11 @@ paths: You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. - > [!note] To retrieve all loyalty program transaction logs in a given - > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) - > endpoint. + > [!note] **Note** + > - For most use cases, especially real-time integrations, use the Integration API endpoint: + > [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + > - To retrieve all loyalty program transaction logs in a given loyalty program, use the + > [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. operationId: getLoyaltyProgramProfileLedgerTransactions parameters: - description: | @@ -3109,7 +3107,7 @@ paths: schema: $ref: "#/components/schemas/ErrorResponseWithStatus" description: Not found - summary: List customer's loyalty transactions + summary: List customer's loyalty transactions (Management API) tags: - management x-accepts: @@ -5433,7 +5431,7 @@ paths: - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - - `expirydate`: The expiration date of the tier when the tier is + - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: @@ -5441,9 +5439,11 @@ paths: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, - only the expiration date is updated. + only the expiry date is updated. - > [!note] We recommend not using this endpoint to update the tier of a customer. + > [!note] We recommend importing customers into the tier that matches their + > current balance. If a customer is imported into a lower tier, any session + > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or @@ -6321,7 +6321,7 @@ paths: identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). - > [!note] We recommend limiting your file size to 500MB. + > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example @@ -7217,8 +7217,14 @@ paths: get: description: | Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) - within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. - If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) + with filtering options applied. + + > [!note] For most use cases, especially real-time integrations, use the Integration API endpoint: + > [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions). + + If no filtering options are applied, the last 50 loyalty transactions for + the given loyalty card are returned. operationId: getLoyaltyCardTransactionLogs parameters: - description: | @@ -7344,7 +7350,7 @@ paths: schema: $ref: "#/components/schemas/ErrorResponseWithStatus" description: Not found - summary: List card's transactions + summary: List card's transactions (Management API) tags: - management x-accepts: @@ -13869,6 +13875,20 @@ components: $ref: "#/components/schemas/NewStore" description: body required: true + NewSupportRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/SupportRequestInput" + description: body + required: true + UpdateSupportRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateSupportRequest" + description: body + required: true NewReward: content: application/json: @@ -14216,7 +14236,8 @@ components: description: The strikethrough labels notification for an application. properties: version: - description: The version of the strikethrough pricing notification. + description: | + The version of the strikethrough pricing notification. Set for **scheduled** strikethrough pricing updates only. enum: - v2 type: string @@ -14835,7 +14856,7 @@ components: total: description: "The total value of cart items and additional costs in the\ \ session, before any discounts are applied." - example: 119.99 + example: 134.99 title: Session Total type: number cartItemTotal: @@ -14850,6 +14871,13 @@ components: example: 20 title: Additional Costs Total type: number + cartItemAdditionalCostTotal: + description: "The total value of additional costs applied to individual\ + \ items, before any discounts are applied." + example: 15 + readOnly: true + title: Cart Item Additional Cost Total + type: number updated: description: Timestamp of the most recent event received on this session. example: 2020-02-08T14:15:22Z @@ -14858,6 +14886,7 @@ components: type: string required: - additionalCostTotal + - cartItemAdditionalCostTotal - cartItemTotal - firstSession - total @@ -14866,6 +14895,7 @@ components: example: couponCodes: - XMAS-20-2021 + cartItemAdditionalCostTotal: 15 updateCount: 3 created: 2020-02-07T08:15:22Z identifiers: @@ -14876,7 +14906,7 @@ components: variantID: 2 - experimentID: 1 variantID: 2 - total: 119.99 + total: 134.99 loyaltyCards: - loyalty-card-1 additionalCosts: @@ -16092,6 +16122,7 @@ components: customerSession: couponCodes: - XMAS-20-2021 + cartItemAdditionalCostTotal: 15 updateCount: 3 created: 2020-02-07T08:15:22Z identifiers: @@ -16102,7 +16133,7 @@ components: variantID: 2 - experimentID: 1 variantID: 2 - total: 119.99 + total: 134.99 loyaltyCards: - loyalty-card-1 additionalCosts: @@ -17157,6 +17188,7 @@ components: - giveaways - strikethrough - achievements + - advancedEvents type: string type: array couponSettings: @@ -17628,128 +17660,15 @@ components: lastActivity: 2022-11-10T23:00:00Z endTime: 2021-09-22T22:00:00Z referralRedemptionCount: 3 - RuleEligibilityFailureDetails: - description: The details about why the customer was not eligible for the rule - in the current session. - properties: - failureCode: - description: A code identifying why the customer was not eligible for the - rule in the current session. - enum: - - CONDITION_NOT_MET - - EFFECT_FAILED - type: string - couponID: - description: | - The ID of the coupon that was being evaluated when the rule failed. - example: 4928 - format: int64 - type: integer - couponValue: - description: | - The coupon code that was being evaluated when the rule failed. - type: string - referralID: - description: | - The ID of the referral that was being evaluated when the rule failed. - format: int64 - type: integer - referralValue: - description: | - The referral code that was being evaluated when the rule failed. - type: string - conditionIndex: - description: The index of the condition that caused the rule to fail. - format: int64 - type: integer - effectIndex: - description: The index of the effect that caused the rule to fail. - format: int64 - type: integer - details: - description: Additional details about the failure. - type: string - required: - - details - - failureCode - RuleEligibility: - description: "The customer's eligibility for a rule in the current session,\ - \ based on whether all of the rule's conditions were met." - example: - details: "" - passed: true - couponCode: couponCode - properties: - passed: - description: "Indicates whether the customer was eligible for the rule in\ - \ the current session, based on whether all of the rule's conditions were\ - \ met." - example: true - type: boolean - couponCode: - description: "The coupon code used to check a customer's eligibility for\ - \ the rule in the current session, if applicable." - type: string - details: - allOf: - - $ref: "#/components/schemas/RuleEligibilityFailureDetails" - description: The details about why the customer was not eligible for the - rule in the current session. Only returned when `passed` is `false`. - required: - - passed - RuleMetadata: - example: - displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer - valid till Dec 5 only. - displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode - relatedData: https://example.com/discounts/20-off-shoes.png - title: Give discount via coupon - properties: - title: - description: A short description of the rule. - example: Give discount via coupon - type: string - displayName: - description: A customer-facing name for the rule. - example: 20% off all shoes! - type: string - displayDescription: - description: "A customer-facing description that explains the details of\ - \ the rule. \n\nFor example, this property can contain details about eligibility\ - \ requirements, reward timelines, or terms and conditions.\n" - example: Get a 20% discount on all shoes during Thanksgiving! Offer valid - till Dec 5 only. - type: string - relatedData: - description: | - Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. - example: https://example.com/discounts/20-off-shoes.png - type: string - eligibility: - items: - $ref: "#/components/schemas/RuleEligibility" - type: array - required: - - title - IntegrationCampaign: + IntegrationCampaignBase: allOf: + - $ref: "#/components/schemas/ApplicationEntity" - properties: id: description: Unique ID of Campaign. example: 4 format: int64 type: integer - required: - - id - - $ref: "#/components/schemas/ApplicationEntity" - - properties: name: description: The name of the campaign. example: Summer promotions @@ -17772,7 +17691,7 @@ components: format: date-time type: string attributes: - $ref: "#/components/schemas/IntegrationCampaign_allOf_attributes" + $ref: "#/components/schemas/IntegrationCampaignBase_allOf_attributes" state: default: enabled description: | @@ -17806,56 +17725,12 @@ components: - achievements type: string type: array - rules: - description: A list of rules containing customer-facing details of the - rewards defined in the campaign. - items: - $ref: "#/components/schemas/RuleMetadata" - type: array required: - features + - id - name - state - tags - example: - features: - - coupons - - referrals - name: Summer promotions - description: Campaign for all summer 2021 promotions - startTime: 2021-07-20T22:00:00Z - attributes: null - rules: - - displayDescription: Get a 20% discount on all shoes during Thanksgiving! - Offer valid till Dec 5 only. - displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode - relatedData: https://example.com/discounts/20-off-shoes.png - title: Give discount via coupon - - displayDescription: Get a 20% discount on all shoes during Thanksgiving! - Offer valid till Dec 5 only. - displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode - relatedData: https://example.com/discounts/20-off-shoes.png - title: Give discount via coupon - id: 4 - endTime: 2021-09-22T22:00:00Z - state: enabled - applicationId: 322 - tags: - - summer CampaignEligibilityFailureDetails: description: The details about why the customer was not eligible for the campaign in the current session. @@ -17891,9 +17766,131 @@ components: campaign in the current session. Only returned when `passed` is `false`. required: - passed + RuleMetadata: + example: + displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer + valid till Dec 5 only. + displayName: 20% off all shoes! + relatedData: https://example.com/discounts/20-off-shoes.png + title: Give discount via coupon + properties: + title: + description: A short description of the rule. + example: Give discount via coupon + type: string + displayName: + description: A customer-facing name for the rule. + example: 20% off all shoes! + type: string + displayDescription: + description: "A customer-facing description that explains the details of\ + \ the rule. \n\nFor example, this property can contain details about eligibility\ + \ requirements, reward timelines, or terms and conditions.\n" + example: Get a 20% discount on all shoes during Thanksgiving! Offer valid + till Dec 5 only. + type: string + relatedData: + description: | + Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. + example: https://example.com/discounts/20-off-shoes.png + type: string + required: + - title + RuleEligibilityFailureDetails: + description: The details about why the customer was not eligible for the rule + in the current session. + properties: + failureCode: + description: A code identifying why the customer was not eligible for the + rule in the current session. + enum: + - CONDITION_NOT_MET + - EFFECT_FAILED + type: string + couponID: + description: | + The ID of the coupon that was being evaluated when the rule failed. + example: 4928 + format: int64 + type: integer + couponValue: + description: | + The coupon code that was being evaluated when the rule failed. + type: string + referralID: + description: | + The ID of the referral that was being evaluated when the rule failed. + format: int64 + type: integer + referralValue: + description: | + The referral code that was being evaluated when the rule failed. + type: string + conditionIndex: + description: The index of the condition that caused the rule to fail. + format: int64 + type: integer + effectIndex: + description: The index of the effect that caused the rule to fail. + format: int64 + type: integer + details: + description: Additional details about the failure. + type: string + required: + - details + - failureCode + RuleEligibility: + description: "The customer's eligibility for a rule in the current session,\ + \ based on whether all of the rule's conditions were met." + example: + details: "" + passed: true + couponCode: couponCode + properties: + passed: + description: "Indicates whether the customer was eligible for the rule in\ + \ the current session, based on whether all of the rule's conditions were\ + \ met." + example: true + type: boolean + couponCode: + description: "The coupon code used to check a customer's eligibility for\ + \ the rule in the current session, if applicable." + type: string + details: + allOf: + - $ref: "#/components/schemas/RuleEligibilityFailureDetails" + description: The details about why the customer was not eligible for the + rule in the current session. Only returned when `passed` is `false`. + required: + - passed + RuleMetadataEligibility: + allOf: + - $ref: "#/components/schemas/RuleMetadata" + - properties: + eligibility: + items: + $ref: "#/components/schemas/RuleEligibility" + type: array + required: + - eligibility + example: + displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer + valid till Dec 5 only. + displayName: 20% off all shoes! + eligibility: + - details: "" + passed: true + couponCode: couponCode + - details: "" + passed: true + couponCode: couponCode + relatedData: https://example.com/discounts/20-off-shoes.png + title: Give discount via coupon CampaignEligibility: allOf: - - $ref: "#/components/schemas/IntegrationCampaign" + - $ref: "#/components/schemas/IntegrationCampaignBase" - description: "A list of campaigns and their evaluation status for the current\ \ customer session.\n\n**Note**:\n\n- This response can **only** be included\ \ if the `dry` parameter in the query is set to `true`. \n- Do not include\ @@ -17906,8 +17903,15 @@ components: items: $ref: "#/components/schemas/CampaignEligibilityDetails" type: array + rules: + description: A list of rules containing customer-facing details of the + rewards defined in the campaign. + items: + $ref: "#/components/schemas/RuleMetadataEligibility" + type: array required: - eligibility + - rules example: features: - coupons @@ -18538,8 +18542,8 @@ components: - $ref: "#/components/schemas/IntegrationStoreEntity" - properties: type: - description: A string representing the event. Must not be a reserved event - name. + description: "The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events),\ + \ not a built-in event." example: pageViewed minLength: 1 title: Event Type @@ -18549,6 +18553,14 @@ components: required: - attributes - type + EventV3Entity: + properties: + integrationId: + description: | + The unique ID of the event. Only one event with this ID can be registered. + example: 175KJPS947296 + minLength: 1 + type: string LedgerEntry: allOf: - $ref: "#/components/schemas/Entity" @@ -18710,6 +18722,7 @@ components: - $ref: "#/components/schemas/Entity" - $ref: "#/components/schemas/ApplicationEntity" - $ref: "#/components/schemas/IntegrationEvent" + - $ref: "#/components/schemas/EventV3Entity" - properties: sessionId: description: The ID of the session that this event occurred in. @@ -18773,56 +18786,38 @@ components: loyaltyProgramId: 323414846 id: 6 referenceId: 6 + integrationId: 175KJPS947296 attributes: "{myAttribute=myValue}" id: 6 sessionId: 175KJPS947296 applicationId: 322 type: pageViewed - IntegrationProfileEntityV3: + EventV3Connections: properties: - profileId: - description: | - ID of the customer profile set by your integration layer. - - **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. - example: URNGV8294NV + connectedSessionId: + description: "The ID of the session to reference. The session must be in\ + \ `closed` state. Otherwise, the API call will fail." + example: 175KJPS947296 + minLength: 1 type: string - required: - - profileId EventV3: allOf: - - $ref: "#/components/schemas/IntegrationProfileEntityV3" - - $ref: "#/components/schemas/IntegrationStoreEntity" - - $ref: "#/components/schemas/EvaluableCampaignIds" + - $ref: "#/components/schemas/EventV3Connections" + - $ref: "#/components/schemas/Entity" + - $ref: "#/components/schemas/ApplicationEntity" + - $ref: "#/components/schemas/IntegrationEvent" + - $ref: "#/components/schemas/EventV3Entity" - properties: - integrationId: - description: | - The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. - example: 175KJPS947296 - minLength: 1 - type: string - type: + effects: description: | - A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. - example: pageViewed - minLength: 1 - title: Event Type - type: string - attributes: - $ref: "#/components/schemas/EventV3_allOf_attributes" - connectedSessionID: - description: The ID of the session that happened in the past. - example: 175KJPS947296 - minLength: 1 - type: string - previousEventID: - description: The unique identifier of the event that happened in the past. - example: 175KJPS947296 - minLength: 1 - type: string + An array of effects generated by the rules of the enabled campaigns of the Application. + + You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). + items: + type: object + type: array required: - - integrationId - - type + - effects AccountEntity: properties: accountId: @@ -20423,6 +20418,7 @@ components: loyaltyProgramId: 323414846 id: 6 referenceId: 6 + integrationId: 175KJPS947296 attributes: "{myAttribute=myValue}" id: 6 sessionId: 175KJPS947296 @@ -20927,6 +20923,43 @@ components: items: $ref: "#/components/schemas/IntegrationCustomerProfileAudienceRequestItem" type: array + IntegrationCampaign: + allOf: + - $ref: "#/components/schemas/IntegrationCampaignBase" + - properties: + rules: + description: A list of rules containing customer-facing details of the + rewards defined in the campaign. + items: + $ref: "#/components/schemas/RuleMetadata" + type: array + required: + - rules + example: + features: + - coupons + - referrals + name: Summer promotions + description: Campaign for all summer 2021 promotions + startTime: 2021-07-20T22:00:00Z + attributes: null + rules: + - displayDescription: Get a 20% discount on all shoes during Thanksgiving! + Offer valid till Dec 5 only. + displayName: 20% off all shoes! + relatedData: https://example.com/discounts/20-off-shoes.png + title: Give discount via coupon + - displayDescription: Get a 20% discount on all shoes during Thanksgiving! + Offer valid till Dec 5 only. + displayName: 20% off all shoes! + relatedData: https://example.com/discounts/20-off-shoes.png + title: Give discount via coupon + id: 4 + endTime: 2021-09-22T22:00:00Z + state: enabled + applicationId: 322 + tags: + - summer NewAttribute: allOf: - properties: @@ -21206,8 +21239,8 @@ components: EventAttributesEntity: properties: type: - description: | - A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. + description: "The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events),\ + \ not a built-in event." example: pageViewed minLength: 1 title: Event Type @@ -24386,6 +24419,7 @@ components: - giveaways - strikethrough - achievements + - advancedEvents type: string type: array couponAttributes: @@ -24845,6 +24879,7 @@ components: - giveaways - strikethrough - achievements + - advancedEvents type: string type: array couponSettings: @@ -25894,11 +25929,13 @@ components: description: setDiscountPerItem effect in strikethrough pricing payload. properties: name: - description: effect name. + description: The effect name. example: 1EuroOff type: string value: {} excludedFromPriceHistory: + description: "When set to `true`, the applied discount is excluded from\ + \ the item's price history." type: boolean required: - name @@ -25927,7 +25964,7 @@ components: description: setDiscountPerItem member effect in strikethrough pricing payload. properties: name: - description: effect name. + description: The effect name. example: 10% off members only type: string value: {} @@ -27482,6 +27519,7 @@ components: - giveaways - strikethrough - achievements + - advancedEvents type: string type: array couponSettings: @@ -27786,6 +27824,7 @@ components: - giveaways - strikethrough - achievements + - advancedEvents type: string type: array couponSettings: @@ -28064,14 +28103,33 @@ components: items: $ref: "#/components/schemas/ExperimentVariant" type: array + goalType: + description: | + The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. + enum: + - other + - maximize_revenue + - optimize_discount_efficiency + - maximize_items_sold + type: string + goalDescription: + description: | + A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. + example: Offering free shipping will increase average order revenue more + than a 10% discount + type: string deletedat: description: | The date and time the experiment was deleted. format: date-time type: string required: + - goalType - state example: + goalType: other + goalDescription: Offering free shipping will increase average order revenue + more than a 10% discount deletedat: 2000-01-23T04:56:07.000+00:00 created: 2020-06-10T09:05:27.993483Z campaign: @@ -28600,8 +28658,25 @@ components: type: boolean campaign: $ref: "#/components/schemas/NewCampaign" + goalType: + default: other + description: | + The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. + enum: + - other + - maximize_revenue + - maximize_items_sold + - optimize_discount_efficiency + type: string + goalDescription: + description: | + A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. + example: Offering free shipping will increase average order revenue more + than a 10% discount + type: string required: - campaign + - goalType - isVariantAssignmentExternal ExperimentListResultsRequest: properties: @@ -28721,6 +28796,21 @@ components: type: boolean campaign: $ref: "#/components/schemas/UpdateCampaign" + goalType: + description: | + The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. + enum: + - other + - maximize_revenue + - maximize_items_sold + - optimize_discount_efficiency + type: string + goalDescription: + description: | + A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. + example: Offering free shipping will increase average order revenue more + than a 10% discount + type: string required: - campaign - isVariantAssignmentExternal @@ -31768,6 +31858,7 @@ components: - $ref: "#/components/schemas/ApplicationCustomerEntity" - $ref: "#/components/schemas/ApplicationStoreEntity" - $ref: "#/components/schemas/IntegrationStoreEntity" + - $ref: "#/components/schemas/EventV3Entity" - properties: sessionId: description: The globally unique Talon.One ID of the session that contains @@ -31775,8 +31866,8 @@ components: format: int64 type: integer type: - description: A string representing the event. Must not be a reserved event - name. + description: "The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events),\ + \ not a built-in event." type: string attributes: $ref: "#/components/schemas/ApplicationEvent_allOf_attributes" @@ -31835,6 +31926,7 @@ components: storeIntegrationId: STORE-001 created: 2020-06-10T09:05:27.993483Z profileId: 138 + integrationId: 175KJPS947296 attributes: null id: 6 sessionId: 6 @@ -32509,9 +32601,12 @@ components: discountValue: 6.027456183070403 - campaignId: 0 discountValue: 6.027456183070403 - observedAt: 2020-11-10T23:00:00Z + observedAt: 2025-11-10T23:00:00Z price: 99.99 - contextId: Summer Sale 2025 + contextIds: + - SpringSale + - SummerSale2025 + contextId: "" id: 1 sku: NVR-GN-GV-UUP target: "{}" @@ -32527,13 +32622,23 @@ components: type: string observedAt: description: The date and time when the price was observed. - example: 2020-11-10T23:00:00Z + example: 2025-11-10T23:00:00Z format: date-time type: string + contextIds: + description: | + The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. + example: + - SpringSale + - SummerSale2025 + items: + type: string + type: array contextId: + default: "" description: | - The context ID of the context active at the time of observation. - example: Summer Sale 2025 + This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. + example: "" type: string price: description: Price of the item. @@ -32544,7 +32649,7 @@ components: target: type: object required: - - contextId + - contextIds - id - metadata - observedAt @@ -32593,9 +32698,12 @@ components: discountValue: 6.027456183070403 - campaignId: 0 discountValue: 6.027456183070403 - observedAt: 2020-11-10T23:00:00Z + observedAt: 2025-11-10T23:00:00Z price: 99.99 - contextId: Summer Sale 2025 + contextIds: + - SpringSale + - SummerSale2025 + contextId: "" id: 1 target: "{}" properties: @@ -32606,13 +32714,23 @@ components: type: integer observedAt: description: The date and time when the price was observed. - example: 2020-11-10T23:00:00Z + example: 2025-11-10T23:00:00Z format: date-time type: string + contextIds: + description: | + The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. + example: + - SpringSale + - SummerSale2025 + items: + type: string + type: array contextId: + default: "" description: | - Identifier of the relevant context at the time the price was observed (e.g. summer sale). - example: Summer Sale 2025 + This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. + example: "" type: string price: description: Price of the item. @@ -32623,7 +32741,7 @@ components: target: type: object required: - - contextId + - contextIds - id - metadata - observedAt @@ -32639,9 +32757,12 @@ components: discountValue: 6.027456183070403 - campaignId: 0 discountValue: 6.027456183070403 - observedAt: 2020-11-10T23:00:00Z + observedAt: 2025-11-10T23:00:00Z price: 99.99 - contextId: Summer Sale 2025 + contextIds: + - SpringSale + - SummerSale2025 + contextId: "" id: 1 target: "{}" - metadata: @@ -32651,9 +32772,12 @@ components: discountValue: 6.027456183070403 - campaignId: 0 discountValue: 6.027456183070403 - observedAt: 2020-11-10T23:00:00Z + observedAt: 2025-11-10T23:00:00Z price: 99.99 - contextId: Summer Sale 2025 + contextIds: + - SpringSale + - SummerSale2025 + contextId: "" id: 1 target: "{}" sku: @@ -32697,6 +32821,8 @@ components: - Session - Store - Achievements + - AdvancedEvent + - AdvancedEventConnectedSession type: string name: description: | @@ -33059,18 +33185,39 @@ components: CatalogAction: description: Definition of all the properties that are needed for a single catalog sync action. + example: + payload: "{}" + type: ADD + properties: + type: + description: The type of sync action. + enum: + - ADD + - PATCH + - PATCH_MANY + - REMOVE + - REMOVE_MANY + - ADD_PRICE_ADJUSTMENT + example: ADD + type: string + payload: + type: object required: - payload - type - type: object CatalogSyncRequest: example: actions: - - null - - null - - null - - null - - null + - payload: "{}" + type: ADD + - payload: "{}" + type: ADD + - payload: "{}" + type: ADD + - payload: "{}" + type: ADD + - payload: "{}" + type: ADD version: 244 properties: actions: @@ -34098,6 +34245,68 @@ components: required: - name - value + FeatureFlagUpdate: + properties: + name: + description: The name of the feature flag. + example: canCreateCampaignFromTemplate + type: string + value: + description: The value of the feature flag. + example: "true" + type: string + required: + - name + - value + NewRiskNotification: + description: Data for creating a new risk notification. + properties: + entity: + description: The entity type to analyze within the given time frame. + enum: + - customer_profile + - customer_session + example: customer_profile + type: string + activity: + description: The activity metric to analyze within the given entity. + enum: + - loyalty_points_earned + - discounted_amount + - completed_orders + - coupon_attempts + example: loyalty_points_earned + type: string + timeFrame: + description: The rolling time window for risk evaluation. + enum: + - 1_day + - 1_week + - 1_month + example: 1_week + type: string + required: + - activity + - entity + - timeFrame + RiskNotification: + allOf: + - $ref: "#/components/schemas/Entity" + - $ref: "#/components/schemas/NewRiskNotification" + - properties: + active: + description: Indicates whether this risk notification is active. + example: true + type: boolean + modified: + description: Timestamp of the most recent update. + example: 2026-04-16T09:05:27.993483Z + format: date-time + type: string + required: + - active + - modified + description: A risk notification configuration rule. Change: allOf: - $ref: "#/components/schemas/Entity" @@ -34333,7 +34542,7 @@ components: format: int64 type: integer attributes: - $ref: "#/components/schemas/IntegrationCampaign_allOf_attributes" + $ref: "#/components/schemas/IntegrationCampaignBase_allOf_attributes" required: - applicationCount - billingEmail @@ -35936,13 +36145,6 @@ components: \ achievements." example: false type: boolean - sandbox: - description: Indicates if this achievement is a live or sandbox achievement. - Achievements of a given type can only be connected to Applications of - the same type. - example: true - title: Sandbox - type: boolean subscribedApplications: description: A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to @@ -35955,11 +36157,6 @@ components: type: integer minItems: 0 type: array - timezone: - description: A string containing an IANA timezone descriptor. - example: Europe/Berlin - minLength: 1 - type: string AchievementAdditionalPropertiesV2: properties: userId: @@ -35993,7 +36190,20 @@ components: - $ref: "#/components/schemas/Entity" - $ref: "#/components/schemas/AchievementBaseV2" - $ref: "#/components/schemas/AchievementAdditionalPropertiesV2" - - required: + - properties: + sandbox: + description: Indicates if this achievement is a live or sandbox achievement. + Achievements of a given type can only be connected to Applications of + the same type. + example: true + title: Sandbox + type: boolean + timezone: + description: A string containing an IANA timezone descriptor. + example: Europe/Berlin + minLength: 1 + type: string + required: - activationPolicy - description - name @@ -36003,21 +36213,39 @@ components: - target - timezone - title - type: object CreateAchievementV2: allOf: - $ref: "#/components/schemas/AchievementBaseV2" - - required: + - properties: + sandbox: + description: Indicates if this achievement is a live or sandbox achievement. + Achievements of a given type can only be connected to Applications of + the same type. + example: true + title: Sandbox + type: boolean + timezone: + description: A string containing an IANA timezone descriptor. + example: Europe/Berlin + minLength: 1 + type: string + required: - description - name - sandbox - target - timezone - title - type: object UpdateAchievementV2: allOf: - $ref: "#/components/schemas/AchievementBaseV2" + - required: + - description + - name + - subscribedApplications + - target + - title + type: object AchievementReference: properties: achievementId: @@ -36761,10 +36989,16 @@ components: LoyaltyProgramID: format: int64 type: integer + LoyaltyProgramName: + description: The name of the loyalty program. + type: string SubledgerID: type: string SourceOfEvent: type: string + CurrentTier: + description: The name of the customer's current tier. + type: string EmployeeName: type: string UserID: @@ -36783,7 +37017,9 @@ components: type: string required: - CurrentPoints + - CurrentTier - LoyaltyProgramID + - LoyaltyProgramName - ProfileIntegrationID - PublishedAt - SourceOfEvent @@ -36796,11 +37032,16 @@ components: LoyaltyProgramID: format: int64 type: integer + LoyaltyProgramName: + description: The name of the loyalty program. + type: string SubledgerID: type: string SourceOfEvent: type: string CurrentTier: + description: "The name of the customer's current tier, or null if the\ + \ customer was downgraded below all tiers." type: string CurrentPoints: format: float @@ -36820,6 +37061,7 @@ components: required: - CurrentPoints - LoyaltyProgramID + - LoyaltyProgramName - ProfileIntegrationID - PublishedAt - SourceOfEvent @@ -36832,11 +37074,15 @@ components: LoyaltyProgramID: format: int64 type: integer + LoyaltyProgramName: + description: The name of the loyalty program. + type: string SubledgerID: type: string SourceOfEvent: type: string CurrentTier: + description: The name of the customer's current tier. type: string CurrentPoints: format: float @@ -36860,7 +37106,9 @@ components: type: string required: - CurrentPoints + - CurrentTier - LoyaltyProgramID + - LoyaltyProgramName - ProfileIntegrationID - PublishedAt - SourceOfEvent @@ -36977,6 +37225,9 @@ components: ProcessedAt: format: date-time type: string + DeliveredAt: + format: date-time + type: string ProcessAfter: format: date-time type: string @@ -36991,6 +37242,27 @@ components: - ProcessAfter - PublishedAt - Retry + IntegrationHubEventStatusUpdate: + properties: + EventId: + description: The ID of the integration hub event. + example: 123 + format: int64 + type: integer + Status: + description: The delivery outcome for the event. + enum: + - delivered + - failed + type: string + x-generate-enum-go: true + required: + - EventId + - Status + IntegrationHubEventStatusUpdates: + items: + $ref: "#/components/schemas/IntegrationHubEventStatusUpdate" + type: array IntegrationHubConfig: description: Config used for accessing integrations in IntegrationHub properties: @@ -37021,6 +37293,182 @@ components: required: - applicationId - applicationName + SupportRequestInput: + properties: + applicationId: + description: Identifier of the Application connected to the loyalty program + or the campaign. It is displayed in your Talon.One deployment URL. + example: 322 + format: int64 + type: integer + campaignId: + description: Identifier of the campaign where the coupon or gift card is + created. + example: 100 + format: int64 + type: integer + loyaltyProgramId: + description: "Identifier of the loyalty program. You can get the ID with\ + \ the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms)\ + \ endpoint." + example: 8 + format: int64 + type: integer + subledgerId: + description: "Identifier of the subledger the points are added to or deducted\ + \ from. If there is no existing subledger with this ID, the subledger\ + \ is created automatically." + example: 123 + format: int64 + type: integer + customerProfileId: + description: Integration ID of the customer profile linked to the support + request. + example: URNGV8294NV + type: string + requestType: + description: "Type of reward requested, including gift cards, personal coupons,\ + \ and loyalty point additions or deductions." + enum: + - gift_card + - personal_coupon + - loyalty_points_added + - loyalty_points_deducted + example: personal_coupon + type: string + requestValue: + description: Requested monetary balance of the gift card or the number of + loyalty points to be added or deducted. + example: 20.5 + exclusiveMinimum: true + format: float + minimum: 0 + type: number + requestNote: + description: Notes attached to the support request. + example: Support request for coupon failure. + type: string + required: + - applicationId + - customerProfileId + - requestNote + - requestType + SupportRequest: + description: Summary of a support request created by a customer support agent. + properties: + id: + description: Identifier of the support request. + example: 1 + format: int64 + type: integer + applicationId: + description: Identifier of the Application connected to the loyalty program + or the campaign. It is displayed in your Talon.One deployment URL. + example: 322 + format: int64 + type: integer + campaignId: + description: Identifier of the campaign where the coupon or gift card is + created. + example: 100 + format: int64 + type: integer + loyaltyProgramId: + description: Identifier of the loyalty program where the points are added + or deducted. + example: 8 + format: int64 + type: integer + subledgerId: + description: "Identifier of the subledger the points are added to or deducted\ + \ from. If there is no existing subledger with this ID, the subledger\ + \ is created automatically." + example: 123 + format: int64 + type: integer + createdByUser: + description: Email address of the customer support agent who created the + support request. + example: support.agent.name@company.com + type: string + createdAt: + description: Timestamp when the request was made. + example: 2025-07-20T22:00:00Z + format: date-time + type: string + customerProfileId: + description: Integration ID of the customer profile linked to the support + request. + example: URNGV8294NV + type: string + requestType: + description: "Type of reward requested, including gift cards, personal coupons,\ + \ and loyalty point additions or deductions." + enum: + - gift_card + - personal_coupon + - loyalty_points_added + - loyalty_points_deducted + example: personal_coupon + type: string + requestValue: + description: Requested monetary balance of the gift card or the number of + loyalty points to be added or deducted. + example: 20.5 + exclusiveMinimum: true + format: float + minimum: 0 + type: number + requestNote: + description: Notes attached to the support request. + example: Support request for coupon failure. + type: string + requestStatus: + description: Current status of the support request. + enum: + - pending_approval + - approved + - rejected + example: approved + type: string + processedAt: + description: Timestamp when the request was approved or rejected. + example: 2025-07-20T22:10:00Z + format: date-time + type: string + processingNote: + description: Notes attached by the admin when rejecting or approving a request. + example: Rejected as the customer was awarded points already. + type: string + processedByUser: + description: Email address of the admin who approved or rejected the support + request. + example: admin.name@company.com + type: string + required: + - applicationId + - createdAt + - createdByUser + - customerProfileId + - id + - requestNote + - requestStatus + - requestType + UpdateSupportRequest: + properties: + requestStatus: + description: Current status of the support request. + enum: + - approved + - rejected + example: approved + type: string + processingNote: + description: Notes attached by the admin when rejecting or approving a request. + example: Rejected as the customer was awarded points already. + type: string + required: + - requestStatus NewReward: properties: name: @@ -37054,32 +37502,81 @@ components: example: true title: Sandbox type: boolean - rule: - description: Rule to apply. - items: - $ref: "#/components/schemas/Rule" - type: array - bindings: - description: A list of named variables created before the reward's rules - are evaluated. Each binding pairs a name with a talang expression. The - expression is evaluated once and its result is available by name in any - rule condition or effect. Bindings must be defined outside of individual - rules. - example: [] - items: - $ref: "#/components/schemas/Binding" - type: array required: - apiName - applicationIds - name - sandbox + RewardPointsRequired: + description: The loyalty points required to activate a reward. + properties: + id: + description: | + The ID of the `pointsRequired` entry. When updating a reward, + include this property to update an existing entry. Omit it to create a new one. + example: 1 + format: int64 + type: integer + amount: + description: The number of loyalty points required to activate the reward. + example: 500 + minimum: 0 + type: number + loyaltyProgramId: + description: The ID of the associated loyalty program. + example: 10 + format: int64 + type: integer + subledgerId: + description: | + The ID of the subledger within the loyalty program from which points are deducted when activating the reward. + + To specify the main ledger, provide an empty string (""). + example: mysubledger + type: string + required: + - amount + - loyaltyProgramId + - subledgerId Reward: allOf: - $ref: "#/components/schemas/Entity" - $ref: "#/components/schemas/AccountEntity" - $ref: "#/components/schemas/NewReward" - properties: + visibilityConditions: + allOf: + - $ref: "#/components/schemas/Rule" + description: | + An optional rule that manages who can see this reward. If not specified, the reward + is visible to all customers. + + **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, + and `bindings` are not supported. + rule: + allOf: + - $ref: "#/components/schemas/Rule" + description: | + Rule to apply. + + **Note**: The `bindings` field inside the rule must not be used in this + endpoint. All bindings should be defined at the reward level via the + top-level `bindings` field. + bindings: + description: A list of named variables created before the reward's rules + are evaluated. Each binding pairs a name with a talang expression. + The expression is evaluated once and its result is available by name + in any rule condition or effect. Bindings must be defined outside of + individual rules. + example: [] + items: + $ref: "#/components/schemas/Binding" + type: array + modified: + description: The timestamp when the reward was last updated in RFC3339 + format. + format: date-time + type: string status: description: The status of the reward. enum: @@ -37087,6 +37584,11 @@ components: - inactive example: active type: string + pointsRequired: + description: The loyalty points required to activate a reward. + items: + $ref: "#/components/schemas/RewardPointsRequired" + type: array required: - status UpdateReward: @@ -37107,16 +37609,24 @@ components: - inactive example: active type: string + visibilityConditions: + allOf: + - $ref: "#/components/schemas/Rule" + description: | + An optional rule that manages who can see this reward. If not specified, the reward + is visible to all customers. + + **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, + and `bindings` are not supported. rule: + allOf: + - $ref: "#/components/schemas/Rule" description: | Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. - items: - $ref: "#/components/schemas/Rule" - type: array bindings: description: A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The @@ -37127,12 +37637,53 @@ components: items: $ref: "#/components/schemas/Binding" type: array + pointsRequired: + description: | + The loyalty points required to activate the reward. Each object defines the specific + loyalty program and subledger from which points are deducted when activating the reward. + + **Note:** + - Objects with an `id` are updated. + - Objects without an `id` are created. + - Existing objects omitted from the payload are deleted. + items: + $ref: "#/components/schemas/RewardPointsRequired" + type: array required: - name - status + IntegrationProfileEntityV3: + properties: + profileId: + description: | + ID of the customer profile set by your integration layer. + + **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. + example: URNGV8294NV + type: string + required: + - profileId + NewEventV3Entity: + properties: + integrationId: + description: | + The unique ID of the event. Only one event with this ID can be registered. + example: 175KJPS947296 + minLength: 1 + type: string + required: + - integrationId + EventV3RequestEntity: + allOf: + - $ref: "#/components/schemas/IntegrationProfileEntityV3" + - $ref: "#/components/schemas/IntegrationStoreEntity" + - $ref: "#/components/schemas/EvaluableCampaignIds" + - $ref: "#/components/schemas/EventAttributesEntity" + - $ref: "#/components/schemas/NewEventV3Entity" + - $ref: "#/components/schemas/EventV3Connections" IntegrationEventV3Request: allOf: - - $ref: "#/components/schemas/EventV3" + - $ref: "#/components/schemas/EventV3RequestEntity" - properties: loyaltyCards: description: Identifiers of the loyalty cards used during this event. @@ -38843,25 +39394,11 @@ components: - displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only. displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode relatedData: https://example.com/discounts/20-off-shoes.png title: Give discount via coupon - displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only. displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode relatedData: https://example.com/discounts/20-off-shoes.png title: Give discount via coupon id: 4 @@ -38881,25 +39418,11 @@ components: - displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only. displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode relatedData: https://example.com/discounts/20-off-shoes.png title: Give discount via coupon - displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer valid till Dec 5 only. displayName: 20% off all shoes! - eligibility: - - details: "" - passed: true - couponCode: couponCode - - details: "" - passed: true - couponCode: couponCode relatedData: https://example.com/discounts/20-off-shoes.png title: Give discount via coupon id: 4 @@ -40913,7 +41436,10 @@ components: listExperiments_200_response: example: data: - - deletedat: 2000-01-23T04:56:07.000+00:00 + - goalType: other + goalDescription: Offering free shipping will increase average order revenue + more than a 10% discount + deletedat: 2000-01-23T04:56:07.000+00:00 created: 2020-06-10T09:05:27.993483Z campaign: type: advanced @@ -41433,7 +41959,10 @@ components: applicationId: 322 isVariantAssignmentExternal: true activated: 2000-01-23T04:56:07.000+00:00 - - deletedat: 2000-01-23T04:56:07.000+00:00 + - goalType: other + goalDescription: Offering free shipping will increase average order revenue + more than a 10% discount + deletedat: 2000-01-23T04:56:07.000+00:00 created: 2020-06-10T09:05:27.993483Z campaign: type: advanced @@ -42183,8 +42712,8 @@ components: importLoyaltyPoints_request: properties: upFile: - description: The file containing the data that is being imported. - format: csv + description: The CSV file containing the data that is being imported. + format: binary type: string getLoyaltyProgramTransactions_200_response: example: @@ -43027,6 +43556,7 @@ components: storeIntegrationId: STORE-001 created: 2020-06-10T09:05:27.993483Z profileId: 138 + integrationId: 175KJPS947296 attributes: null id: 6 sessionId: 6 @@ -43100,6 +43630,7 @@ components: storeIntegrationId: STORE-001 created: 2020-06-10T09:05:27.993483Z profileId: 138 + integrationId: 175KJPS947296 attributes: null id: 6 sessionId: 6 @@ -43980,7 +44511,7 @@ components: items: {} minItems: 1 type: array - IntegrationCampaign_allOf_attributes: + IntegrationCampaignBase_allOf_attributes: description: Arbitrary properties associated with this campaign. type: object Attributes_of_coupon: @@ -43998,12 +44529,6 @@ components: description: Arbitrary additional JSON data associated with the event. example: "{myAttribute=myValue}" type: object - EventV3_allOf_attributes: - description: "Arbitrary additional JSON properties associated with the event.\ - \ They must be created in the Campaign Manager before setting them with this\ - \ property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute)." - example: "{myAttribute=myValue}" - type: object NewCustomerSession_allOf_attributes: description: | A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. @@ -44048,6 +44573,19 @@ components: type: boolean campaign: $ref: "#/components/schemas/ExperimentCampaignCopy" + goalType: + description: | + The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the value from the source experiment is used. + enum: + - other + - maximize_revenue + - maximize_items_sold + - optimize_discount_efficiency + type: string + goalDescription: + description: | + A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the value from the source experiment is used. + type: string required: - campaign - isVariantAssignmentExternal diff --git a/build.gradle b/build.gradle index 8f33dc4b..206f2283 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'one.talon' -version = '26.09.0' +version = '26.11.0' buildscript { repositories { diff --git a/build.sbt b/build.sbt index dadf7735..812f6972 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "one.talon", name := "talon-one-client", - version := "26.09.0", + version := "26.11.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/AchievementBaseV2.md b/docs/AchievementBaseV2.md index 7b2912f0..8622cf67 100644 --- a/docs/AchievementBaseV2.md +++ b/docs/AchievementBaseV2.md @@ -17,9 +17,7 @@ |**fixedStartDate** | **OffsetDateTime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**endDate** | **OffsetDateTime** | The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**allowRollbackAfterCompletion** | **Boolean** | When `true`, customer progress can be rolled back in completed achievements. | [optional] | -|**sandbox** | **Boolean** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | [optional] | |**subscribedApplications** | **List<Long>** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | [optional] | -|**timezone** | **String** | A string containing an IANA timezone descriptor. | [optional] | diff --git a/docs/AchievementV2.md b/docs/AchievementV2.md index 881105fc..e96857a1 100644 --- a/docs/AchievementV2.md +++ b/docs/AchievementV2.md @@ -19,13 +19,13 @@ |**fixedStartDate** | **OffsetDateTime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**endDate** | **OffsetDateTime** | The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**allowRollbackAfterCompletion** | **Boolean** | When `true`, customer progress can be rolled back in completed achievements. | [optional] | -|**sandbox** | **Boolean** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | | |**subscribedApplications** | **List<Long>** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | | -|**timezone** | **String** | A string containing an IANA timezone descriptor. | | |**userId** | **Long** | The ID of the user that created this achievement. | | |**createdBy** | **String** | Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. | [optional] | |**hasProgress** | **Boolean** | Indicates if a customer has made progress in the achievement. | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | The status of the achievement. | [optional] | +|**sandbox** | **Boolean** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | | +|**timezone** | **String** | A string containing an IANA timezone descriptor. | | diff --git a/docs/ApplicationEvent.md b/docs/ApplicationEvent.md index f7e31106..19b05280 100644 --- a/docs/ApplicationEvent.md +++ b/docs/ApplicationEvent.md @@ -13,8 +13,9 @@ |**profileId** | **Long** | The globally unique Talon.One ID of the customer that created this entity. | [optional] | |**storeId** | **Long** | The ID of the store. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | [optional] | |**sessionId** | **Long** | The globally unique Talon.One ID of the session that contains this event. | [optional] | -|**type** | **String** | A string representing the event. Must not be a reserved event name. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Additional JSON serialized data associated with the event. | | |**effects** | [**List<Effect>**](Effect.md) | An array containing the effects that were applied as a result of this event. | | |**ruleFailureReasons** | [**List<RuleFailureReason>**](RuleFailureReason.md) | An array containing the rule failure reasons which happened during this event. | [optional] | diff --git a/docs/BaseCampaign.md b/docs/BaseCampaign.md index 52108aaf..c243313e 100644 --- a/docs/BaseCampaign.md +++ b/docs/BaseCampaign.md @@ -47,6 +47,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/BestPriorPrice.md b/docs/BestPriorPrice.md index 5b9b48a5..06501d19 100644 --- a/docs/BestPriorPrice.md +++ b/docs/BestPriorPrice.md @@ -10,7 +10,8 @@ |**id** | **Long** | The ID of the historical price. | | |**sku** | **String** | sku | | |**observedAt** | **OffsetDateTime** | The date and time when the price was observed. | | -|**contextId** | **String** | The context ID of the context active at the time of observation. | | +|**contextIds** | **List<String>** | The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. | | +|**contextId** | **String** | This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. | [optional] | |**price** | **BigDecimal** | Price of the item. | | |**metadata** | [**BestPriorPriceMetadata**](BestPriorPriceMetadata.md) | | | |**target** | **Object** | | | diff --git a/docs/Campaign.md b/docs/Campaign.md index f4221ddf..bfaa25a6 100644 --- a/docs/Campaign.md +++ b/docs/Campaign.md @@ -83,6 +83,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/CampaignEligibility.md b/docs/CampaignEligibility.md index 1a377ae5..d6d2e802 100644 --- a/docs/CampaignEligibility.md +++ b/docs/CampaignEligibility.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **Long** | Unique ID of Campaign. | | |**applicationId** | **Long** | The ID of the Application that owns this entity. | | +|**id** | **Long** | Unique ID of Campaign. | | |**name** | **String** | The name of the campaign. | | |**description** | **String** | A detailed description of the campaign. | [optional] | |**startTime** | **OffsetDateTime** | Timestamp when the campaign will become active. | [optional] | @@ -17,8 +17,8 @@ |**state** | [**StateEnum**](#StateEnum) | The state of the campaign. | | |**tags** | **List<String>** | A list of tags for the campaign. | | |**features** | [**List<FeaturesEnum>**](#List<FeaturesEnum>) | The features enabled in this campaign. | | -|**rules** | [**List<RuleMetadata>**](RuleMetadata.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | [optional] | |**eligibility** | [**List<CampaignEligibilityDetails>**](CampaignEligibilityDetails.md) | The customer's eligibility for each campaign in the current customer session. | | +|**rules** | [**List<RuleMetadataEligibility>**](RuleMetadataEligibility.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | | diff --git a/docs/CampaignTemplate.md b/docs/CampaignTemplate.md index 6ea92a38..ddfc843a 100644 --- a/docs/CampaignTemplate.md +++ b/docs/CampaignTemplate.md @@ -58,6 +58,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/CatalogAction.md b/docs/CatalogAction.md new file mode 100644 index 00000000..659a5508 --- /dev/null +++ b/docs/CatalogAction.md @@ -0,0 +1,28 @@ + + +# CatalogAction + +Definition of all the properties that are needed for a single catalog sync action. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The type of sync action. | | +|**payload** | **Object** | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ADD | "ADD" | +| PATCH | "PATCH" | +| PATCH_MANY | "PATCH_MANY" | +| REMOVE | "REMOVE" | +| REMOVE_MANY | "REMOVE_MANY" | +| ADD_PRICE_ADJUSTMENT | "ADD_PRICE_ADJUSTMENT" | + + + diff --git a/docs/CatalogSyncRequest.md b/docs/CatalogSyncRequest.md index 705eb4ee..2db55f9b 100644 --- a/docs/CatalogSyncRequest.md +++ b/docs/CatalogSyncRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**actions** | **List<Object>** | | | +|**actions** | [**List<CatalogAction>**](CatalogAction.md) | | | |**version** | **Long** | The version number of the catalog to apply the actions on. | [optional] | diff --git a/docs/CreateAchievementV2.md b/docs/CreateAchievementV2.md index 79c8da48..dc87709d 100644 --- a/docs/CreateAchievementV2.md +++ b/docs/CreateAchievementV2.md @@ -17,8 +17,8 @@ |**fixedStartDate** | **OffsetDateTime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**endDate** | **OffsetDateTime** | The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**allowRollbackAfterCompletion** | **Boolean** | When `true`, customer progress can be rolled back in completed achievements. | [optional] | -|**sandbox** | **Boolean** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | | |**subscribedApplications** | **List<Long>** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | [optional] | +|**sandbox** | **Boolean** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | | |**timezone** | **String** | A string containing an IANA timezone descriptor. | | diff --git a/docs/CustomerSessionV2.md b/docs/CustomerSessionV2.md index 2c09b6c8..6b158bc8 100644 --- a/docs/CustomerSessionV2.md +++ b/docs/CustomerSessionV2.md @@ -28,6 +28,7 @@ |**total** | **BigDecimal** | The total value of cart items and additional costs in the session, before any discounts are applied. | | |**cartItemTotal** | **BigDecimal** | The total value of cart items, before any discounts are applied. | | |**additionalCostTotal** | **BigDecimal** | The total value of additional costs, before any discounts are applied. | | +|**cartItemAdditionalCostTotal** | **BigDecimal** | The total value of additional costs applied to individual items, before any discounts are applied. | [readonly] | |**updated** | **OffsetDateTime** | Timestamp of the most recent event received on this session. | | diff --git a/docs/Event.md b/docs/Event.md index fc0ff234..465ecd8d 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -12,8 +12,9 @@ |**applicationId** | **Long** | The ID of the Application that owns this entity. | | |**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | -|**type** | **String** | A string representing the event. Must not be a reserved event name. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON data associated with the event. | | +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | [optional] | |**sessionId** | **String** | The ID of the session that this event occurred in. | [optional] | |**effects** | **List<Object>** | An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | | |**ledgerEntries** | [**List<LedgerEntry>**](LedgerEntry.md) | Ledger entries for the event. | [optional] | diff --git a/docs/EventAttributesEntity.md b/docs/EventAttributesEntity.md index 46ebfa63..732f4f81 100644 --- a/docs/EventAttributesEntity.md +++ b/docs/EventAttributesEntity.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**type** | **String** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] | diff --git a/docs/EventV2.md b/docs/EventV2.md index 95537c3d..3a0bf6d8 100644 --- a/docs/EventV2.md +++ b/docs/EventV2.md @@ -10,7 +10,7 @@ |**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | |**evaluableCampaignIds** | **List<Long>** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] | -|**type** | **String** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] | diff --git a/docs/EventV3.md b/docs/EventV3.md index bd37e40a..852b1c43 100644 --- a/docs/EventV3.md +++ b/docs/EventV3.md @@ -7,14 +7,16 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | | +|**connectedSessionId** | **String** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] | +|**id** | **Long** | The internal ID of this entity. | | +|**created** | **OffsetDateTime** | The time this entity was created. | | +|**applicationId** | **Long** | The ID of the Application that owns this entity. | | +|**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | -|**evaluableCampaignIds** | **List<Long>** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] | -|**integrationId** | **String** | The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. | | -|**type** | **String** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | | -|**attributes** | **Object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] | -|**connectedSessionID** | **String** | The ID of the session that happened in the past. | [optional] | -|**previousEventID** | **String** | The unique identifier of the event that happened in the past. | [optional] | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | +|**attributes** | **Object** | Arbitrary additional JSON data associated with the event. | | +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | [optional] | +|**effects** | **List<Object>** | An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | | diff --git a/docs/EventV3Connections.md b/docs/EventV3Connections.md new file mode 100644 index 00000000..5c42e8f2 --- /dev/null +++ b/docs/EventV3Connections.md @@ -0,0 +1,13 @@ + + +# EventV3Connections + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**connectedSessionId** | **String** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] | + + + diff --git a/docs/EventV3Entity.md b/docs/EventV3Entity.md new file mode 100644 index 00000000..91915c66 --- /dev/null +++ b/docs/EventV3Entity.md @@ -0,0 +1,13 @@ + + +# EventV3Entity + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | [optional] | + + + diff --git a/docs/EventV3RequestEntity.md b/docs/EventV3RequestEntity.md new file mode 100644 index 00000000..b22d0939 --- /dev/null +++ b/docs/EventV3RequestEntity.md @@ -0,0 +1,19 @@ + + +# EventV3RequestEntity + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | | +|**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | +|**evaluableCampaignIds** | **List<Long>** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | +|**attributes** | **Object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] | +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | | +|**connectedSessionId** | **String** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] | + + + diff --git a/docs/Experiment.md b/docs/Experiment.md index ab3394f0..006d7f6f 100644 --- a/docs/Experiment.md +++ b/docs/Experiment.md @@ -15,6 +15,8 @@ |**activated** | **OffsetDateTime** | The date and time the experiment was activated. | [optional] | |**state** | [**StateEnum**](#StateEnum) | A disabled experiment is not evaluated for rules or coupons. | | |**variants** | [**List<ExperimentVariant>**](ExperimentVariant.md) | | [optional] | +|**goalType** | [**GoalTypeEnum**](#GoalTypeEnum) | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. | | +|**goalDescription** | **String** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. | [optional] | |**deletedat** | **OffsetDateTime** | The date and time the experiment was deleted. | [optional] | @@ -29,3 +31,14 @@ +## Enum: GoalTypeEnum + +| Name | Value | +|---- | -----| +| OTHER | "other" | +| MAXIMIZE_REVENUE | "maximize_revenue" | +| OPTIMIZE_DISCOUNT_EFFICIENCY | "optimize_discount_efficiency" | +| MAXIMIZE_ITEMS_SOLD | "maximize_items_sold" | + + + diff --git a/docs/ExperimentCopyExperiment.md b/docs/ExperimentCopyExperiment.md index ac7e67e2..1bff9762 100644 --- a/docs/ExperimentCopyExperiment.md +++ b/docs/ExperimentCopyExperiment.md @@ -9,6 +9,19 @@ |------------ | ------------- | ------------- | -------------| |**isVariantAssignmentExternal** | **Boolean** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | | |**campaign** | [**ExperimentCampaignCopy**](ExperimentCampaignCopy.md) | | | +|**goalType** | [**GoalTypeEnum**](#GoalTypeEnum) | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the value from the source experiment is used. | [optional] | +|**goalDescription** | **String** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the value from the source experiment is used. | [optional] | + + + +## Enum: GoalTypeEnum + +| Name | Value | +|---- | -----| +| OTHER | "other" | +| MAXIMIZE_REVENUE | "maximize_revenue" | +| MAXIMIZE_ITEMS_SOLD | "maximize_items_sold" | +| OPTIMIZE_DISCOUNT_EFFICIENCY | "optimize_discount_efficiency" | diff --git a/docs/FeatureFlagUpdate.md b/docs/FeatureFlagUpdate.md new file mode 100644 index 00000000..8ccfab83 --- /dev/null +++ b/docs/FeatureFlagUpdate.md @@ -0,0 +1,14 @@ + + +# FeatureFlagUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the feature flag. | | +|**value** | **String** | The value of the feature flag. | | + + + diff --git a/docs/History.md b/docs/History.md index 36019f7c..52a4d41f 100644 --- a/docs/History.md +++ b/docs/History.md @@ -9,7 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**id** | **Long** | The ID of the historical price. | | |**observedAt** | **OffsetDateTime** | The date and time when the price was observed. | | -|**contextId** | **String** | Identifier of the relevant context at the time the price was observed (e.g. summer sale). | | +|**contextIds** | **List<String>** | The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. | | +|**contextId** | **String** | This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. | [optional] | |**price** | **BigDecimal** | Price of the item. | | |**metadata** | [**BestPriorPriceMetadata**](BestPriorPriceMetadata.md) | | | |**target** | **Object** | | | diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index 62cc8106..8622db6b 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -2210,7 +2210,7 @@ public class Example { Track event -Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. +Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. ### Example ```java diff --git a/docs/IntegrationCampaign.md b/docs/IntegrationCampaign.md index 6a97a226..b14fcd68 100644 --- a/docs/IntegrationCampaign.md +++ b/docs/IntegrationCampaign.md @@ -17,7 +17,7 @@ |**state** | [**StateEnum**](#StateEnum) | The state of the campaign. | | |**tags** | **List<String>** | A list of tags for the campaign. | | |**features** | [**List<FeaturesEnum>**](#List<FeaturesEnum>) | The features enabled in this campaign. | | -|**rules** | [**List<RuleMetadata>**](RuleMetadata.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | [optional] | +|**rules** | [**List<RuleMetadata>**](RuleMetadata.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | | diff --git a/docs/IntegrationCampaignBase.md b/docs/IntegrationCampaignBase.md new file mode 100644 index 00000000..8ae0bbaf --- /dev/null +++ b/docs/IntegrationCampaignBase.md @@ -0,0 +1,43 @@ + + +# IntegrationCampaignBase + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**applicationId** | **Long** | The ID of the Application that owns this entity. | | +|**id** | **Long** | Unique ID of Campaign. | | +|**name** | **String** | The name of the campaign. | | +|**description** | **String** | A detailed description of the campaign. | [optional] | +|**startTime** | **OffsetDateTime** | Timestamp when the campaign will become active. | [optional] | +|**endTime** | **OffsetDateTime** | Timestamp when the campaign will become inactive. | [optional] | +|**attributes** | **Object** | Arbitrary properties associated with this campaign. | [optional] | +|**state** | [**StateEnum**](#StateEnum) | The state of the campaign. | | +|**tags** | **List<String>** | A list of tags for the campaign. | | +|**features** | [**List<FeaturesEnum>**](#List<FeaturesEnum>) | The features enabled in this campaign. | | + + + +## Enum: StateEnum + +| Name | Value | +|---- | -----| +| ENABLED | "enabled" | + + + +## Enum: List<FeaturesEnum> + +| Name | Value | +|---- | -----| +| COUPONS | "coupons" | +| REFERRALS | "referrals" | +| LOYALTY | "loyalty" | +| GIVEAWAYS | "giveaways" | +| STRIKETHROUGH | "strikethrough" | +| ACHIEVEMENTS | "achievements" | + + + diff --git a/docs/IntegrationEvent.md b/docs/IntegrationEvent.md index 4972e498..60e7fc63 100644 --- a/docs/IntegrationEvent.md +++ b/docs/IntegrationEvent.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | -|**type** | **String** | A string representing the event. Must not be a reserved event name. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON data associated with the event. | | diff --git a/docs/IntegrationEventV2Request.md b/docs/IntegrationEventV2Request.md index 05cff6e9..418bd2f4 100644 --- a/docs/IntegrationEventV2Request.md +++ b/docs/IntegrationEventV2Request.md @@ -10,7 +10,7 @@ |**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | |**evaluableCampaignIds** | **List<Long>** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] | -|**type** | **String** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] | |**responseContent** | [**List<ResponseContentEnum>**](#List<ResponseContentEnum>) | Extends the response with the chosen data entities. Use this property to get as much data back as needed from one request instead of sending extra requests to other endpoints. | [optional] | |**loyaltyCards** | **List<String>** | Identifiers of the loyalty cards used during this event. | [optional] | diff --git a/docs/IntegrationEventV3Request.md b/docs/IntegrationEventV3Request.md index d8fa1f7a..2a6e2d58 100644 --- a/docs/IntegrationEventV3Request.md +++ b/docs/IntegrationEventV3Request.md @@ -10,11 +10,10 @@ |**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | |**evaluableCampaignIds** | **List<Long>** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] | -|**integrationId** | **String** | The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. | | -|**type** | **String** | A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). | [optional] | -|**connectedSessionID** | **String** | The ID of the session that happened in the past. | [optional] | -|**previousEventID** | **String** | The unique identifier of the event that happened in the past. | [optional] | +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | | +|**connectedSessionId** | **String** | The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. | [optional] | |**loyaltyCards** | **List<String>** | Identifiers of the loyalty cards used during this event. | [optional] | |**responseContent** | [**List<ResponseContentEnum>**](#List<ResponseContentEnum>) | Optional list of requested information to be present on the response related to the tracking custom event. | [optional] | diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md index fd50a139..25c2f5ea 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.md @@ -9,14 +9,15 @@ |------------ | ------------- | ------------- | -------------| |**profileIntegrationID** | **String** | | | |**loyaltyProgramID** | **Long** | | | +|**loyaltyProgramName** | **String** | The name of the loyalty program. | | |**subledgerID** | **String** | | | |**sourceOfEvent** | **String** | | | +|**currentTier** | **String** | The name of the customer's current tier. | | |**employeeName** | **String** | | [optional] | |**userID** | **Long** | | [optional] | |**currentPoints** | **Float** | | | |**actions** | [**List<IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction>**](IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.md) | | [optional] | |**publishedAt** | **OffsetDateTime** | Timestamp when the event was published. | | -|**currentTier** | **String** | | [optional] | |**oldTier** | **String** | | [optional] | |**tierExpirationDate** | **OffsetDateTime** | | [optional] | |**timestampOfTierChange** | **OffsetDateTime** | | [optional] | diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md index 4142131e..98c5b69c 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.md @@ -9,8 +9,10 @@ |------------ | ------------- | ------------- | -------------| |**profileIntegrationID** | **String** | | | |**loyaltyProgramID** | **Long** | | | +|**loyaltyProgramName** | **String** | The name of the loyalty program. | | |**subledgerID** | **String** | | | |**sourceOfEvent** | **String** | | | +|**currentTier** | **String** | The name of the customer's current tier. | | |**employeeName** | **String** | | [optional] | |**userID** | **Long** | | [optional] | |**currentPoints** | **Float** | | | diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md index 6f4230d3..3a2de1bd 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.md @@ -9,9 +9,10 @@ |------------ | ------------- | ------------- | -------------| |**profileIntegrationID** | **String** | | | |**loyaltyProgramID** | **Long** | | | +|**loyaltyProgramName** | **String** | The name of the loyalty program. | | |**subledgerID** | **String** | | | |**sourceOfEvent** | **String** | | | -|**currentTier** | **String** | | [optional] | +|**currentTier** | **String** | The name of the customer's current tier, or null if the customer was downgraded below all tiers. | [optional] | |**currentPoints** | **Float** | | | |**oldTier** | **String** | | [optional] | |**tierExpirationDate** | **OffsetDateTime** | | [optional] | diff --git a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md index 4db4d0b7..67684821 100644 --- a/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md +++ b/docs/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.md @@ -9,9 +9,10 @@ |------------ | ------------- | ------------- | -------------| |**profileIntegrationID** | **String** | | | |**loyaltyProgramID** | **Long** | | | +|**loyaltyProgramName** | **String** | The name of the loyalty program. | | |**subledgerID** | **String** | | | |**sourceOfEvent** | **String** | | | -|**currentTier** | **String** | | [optional] | +|**currentTier** | **String** | The name of the customer's current tier. | | |**currentPoints** | **Float** | | | |**oldTier** | **String** | | [optional] | |**pointsRequiredToTheNextTier** | **Float** | | [optional] | diff --git a/docs/IntegrationHubEventRecord.md b/docs/IntegrationHubEventRecord.md index e5c3984b..fdd28b2d 100644 --- a/docs/IntegrationHubEventRecord.md +++ b/docs/IntegrationHubEventRecord.md @@ -13,6 +13,7 @@ |**eventData** | **Object** | | | |**publishedAt** | **OffsetDateTime** | | | |**processedAt** | **OffsetDateTime** | | [optional] | +|**deliveredAt** | **OffsetDateTime** | | [optional] | |**processAfter** | **OffsetDateTime** | | | |**retry** | **Long** | | | diff --git a/docs/IntegrationHubEventStatusUpdate.md b/docs/IntegrationHubEventStatusUpdate.md new file mode 100644 index 00000000..32d74b51 --- /dev/null +++ b/docs/IntegrationHubEventStatusUpdate.md @@ -0,0 +1,23 @@ + + +# IntegrationHubEventStatusUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventId** | **Long** | The ID of the integration hub event. | | +|**status** | [**StatusEnum**](#StatusEnum) | The delivery outcome for the event. | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| DELIVERED | "delivered" | +| FAILED | "failed" | + + + diff --git a/docs/ManagementApi.md b/docs/ManagementApi.md index 81ad0e12..64f2ab7c 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -110,12 +110,12 @@ All URIs are relative to *https://yourbaseurl.talon.one* | [**getExperiment**](ManagementApi.md#getExperiment) | **GET** /v1/applications/{applicationId}/experiments/{experimentId} | Get experiment in Application | | [**getExports**](ManagementApi.md#getExports) | **GET** /v1/exports | Get exports | | [**getLoyaltyCard**](ManagementApi.md#getLoyaltyCard) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Get loyalty card | -| [**getLoyaltyCardTransactionLogs**](ManagementApi.md#getLoyaltyCardTransactionLogs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions | +| [**getLoyaltyCardTransactionLogs**](ManagementApi.md#getLoyaltyCardTransactionLogs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions (Management API) | | [**getLoyaltyCards**](ManagementApi.md#getLoyaltyCards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards | List loyalty cards | -| [**getLoyaltyLedgerBalances**](ManagementApi.md#getLoyaltyLedgerBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances | +| [**getLoyaltyLedgerBalances**](ManagementApi.md#getLoyaltyLedgerBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances (Management API) | | [**getLoyaltyPoints**](ManagementApi.md#getLoyaltyPoints) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} | Get customer's full loyalty ledger | | [**getLoyaltyProgram**](ManagementApi.md#getLoyaltyProgram) | **GET** /v1/loyalty_programs/{loyaltyProgramId} | Get loyalty program | -| [**getLoyaltyProgramProfileLedgerTransactions**](ManagementApi.md#getLoyaltyProgramProfileLedgerTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions | +| [**getLoyaltyProgramProfileLedgerTransactions**](ManagementApi.md#getLoyaltyProgramProfileLedgerTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions (Management API) | | [**getLoyaltyProgramTransactions**](ManagementApi.md#getLoyaltyProgramTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/transactions | List loyalty program transactions | | [**getLoyaltyPrograms**](ManagementApi.md#getLoyaltyPrograms) | **GET** /v1/loyalty_programs | List loyalty programs | | [**getLoyaltyStatistics**](ManagementApi.md#getLoyaltyStatistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics | @@ -8177,9 +8177,9 @@ public class Example { # **getLoyaltyCardTransactionLogs** > GetLoyaltyCardTransactionLogs200Response getLoyaltyCardTransactionLogs(loyaltyProgramId, loyaltyCardId, startDate, endDate, pageSize, skip, subledgerId, customerSessionIDs, transactionUUIDs) -List card's transactions +List card's transactions (Management API) -Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. +Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. > [!note] For most use cases, especially real-time integrations, use the Integration API endpoint: > [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions). If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. ### Example ```java @@ -8347,9 +8347,9 @@ public class Example { # **getLoyaltyLedgerBalances** > LoyaltyBalancesWithTiers getLoyaltyLedgerBalances(loyaltyProgramId, integrationId, endDate, subledgerId, includeTiers, includeProjectedTier) -Get customer's loyalty balances +Get customer's loyalty balances (Management API) -Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) +Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: [Get customer's loyalty balances](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances). > - If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) ### Example ```java @@ -8569,9 +8569,9 @@ public class Example { # **getLoyaltyProgramProfileLedgerTransactions** > GetLoyaltyProgramProfileTransactions200Response getLoyaltyProgramProfileLedgerTransactions(loyaltyProgramId, integrationId, customerSessionIDs, transactionUUIDs, subledgerId, loyaltyTransactionType, startDate, endDate, pageSize, skip, awaitsActivation) -List customer's loyalty transactions +List customer's loyalty transactions (Management API) -Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint. +Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: > [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). > - To retrieve all loyalty program transaction logs in a given loyalty program, use the > [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. ### Example ```java @@ -9681,7 +9681,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long collectionId = 56L; // Long | The ID of the collection. You can get it with the [List collections in account](#tag/Collections/operation/listAccountCollections) endpoint. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importAccountCollection(collectionId, upFile); System.out.println(result); @@ -9701,7 +9701,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **collectionId** | **Long**| The ID of the collection. You can get it with the [List collections in account](#tag/Collections/operation/listAccountCollections) endpoint. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -9754,7 +9754,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long attributeId = 56L; // Long | The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importAllowedList(attributeId, upFile); System.out.println(result); @@ -9774,7 +9774,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **attributeId** | **Long**| The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -9828,7 +9828,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long audienceId = 56L; // Long | The ID of the audience. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importAudiencesMemberships(audienceId, upFile); System.out.println(result); @@ -9848,7 +9848,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **audienceId** | **Long**| The ID of the audience. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -9905,7 +9905,7 @@ public class Example { Long campaignId = 56L; // Long | The ID of the campaign. It is displayed in your Talon.One deployment URL. String action = "setDiscount"; // String | The action that this budget is limiting. String period = "overall"; // String | The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importCampaignStoreBudget(applicationId, campaignId, action, period, upFile); System.out.println(result); @@ -9928,7 +9928,7 @@ public class Example { | **campaignId** | **Long**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | | | **action** | **String**| The action that this budget is limiting. | [optional] [enum: setDiscount] | | **period** | **String**| The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. | [optional] [enum: overall, daily, weekly, monthly, yearly] | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -9981,7 +9981,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long applicationId = 56L; // Long | The ID of the Application. It is displayed in your Talon.One deployment URL. Long campaignId = 56L; // Long | The ID of the campaign. It is displayed in your Talon.One deployment URL. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importCampaignStores(applicationId, campaignId, upFile); System.out.println(result); @@ -10002,7 +10002,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **applicationId** | **Long**| The ID of the Application. It is displayed in your Talon.One deployment URL. | | | **campaignId** | **Long**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10058,7 +10058,7 @@ public class Example { Long applicationId = 56L; // Long | The ID of the Application. It is displayed in your Talon.One deployment URL. Long campaignId = 56L; // Long | The ID of the campaign. It is displayed in your Talon.One deployment URL. Long collectionId = 56L; // Long | The ID of the collection. You can get it with the [List collections in Application](#tag/Collections/operation/listCollectionsInApplication) endpoint. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importCollection(applicationId, campaignId, collectionId, upFile); System.out.println(result); @@ -10080,7 +10080,7 @@ public class Example { | **applicationId** | **Long**| The ID of the Application. It is displayed in your Talon.One deployment URL. | | | **campaignId** | **Long**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | | | **collectionId** | **Long**| The ID of the collection. You can get it with the [List collections in Application](#tag/Collections/operation/listCollectionsInApplication) endpoint. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10134,7 +10134,7 @@ public class Example { Long applicationId = 56L; // Long | The ID of the Application. It is displayed in your Talon.One deployment URL. Long campaignId = 56L; // Long | The ID of the campaign. It is displayed in your Talon.One deployment URL. Boolean skipDuplicates = true; // Boolean | An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importCoupons(applicationId, campaignId, skipDuplicates, upFile); System.out.println(result); @@ -10156,7 +10156,7 @@ public class Example { | **applicationId** | **Long**| The ID of the Application. It is displayed in your Talon.One deployment URL. | | | **campaignId** | **Long**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | | | **skipDuplicates** | **Boolean**| An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. | [optional] | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10182,7 +10182,7 @@ public class Example { Import loyalty cards -Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` +Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` ### Example ```java @@ -10207,7 +10207,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long loyaltyProgramId = 56L; // Long | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importLoyaltyCards(loyaltyProgramId, upFile); System.out.println(result); @@ -10227,7 +10227,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **loyaltyProgramId** | **Long**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10255,7 +10255,7 @@ public class Example { Import customers into loyalty tiers -Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` +Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` ### Example ```java @@ -10280,7 +10280,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long loyaltyProgramId = 56L; // Long | Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importLoyaltyCustomersTiers(loyaltyProgramId, upFile); System.out.println(result); @@ -10300,7 +10300,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **loyaltyProgramId** | **Long**| Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10355,7 +10355,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long loyaltyProgramId = 56L; // Long | Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. Boolean notificationsEnabled = true; // Boolean | Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importLoyaltyPoints(loyaltyProgramId, notificationsEnabled, upFile); System.out.println(result); @@ -10376,7 +10376,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **loyaltyProgramId** | **Long**| Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | | | **notificationsEnabled** | **Boolean**| Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. | [optional] | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10427,7 +10427,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long poolId = 56L; // Long | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importPoolGiveaways(poolId, upFile); System.out.println(result); @@ -10447,7 +10447,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **poolId** | **Long**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type @@ -10499,7 +10499,7 @@ public class Example { ManagementApi apiInstance = new ManagementApi(defaultClient); Long applicationId = 56L; // Long | The ID of the Application. It is displayed in your Talon.One deployment URL. Long campaignId = 56L; // Long | The ID of the campaign. It is displayed in your Talon.One deployment URL. - String upFile = "upFile_example"; // String | The file containing the data that is being imported. + File upFile = new File("/path/to/file"); // File | The CSV file containing the data that is being imported. try { ModelImport result = apiInstance.importReferrals(applicationId, campaignId, upFile); System.out.println(result); @@ -10520,7 +10520,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **applicationId** | **Long**| The ID of the Application. It is displayed in your Talon.One deployment URL. | | | **campaignId** | **Long**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | | -| **upFile** | **String**| The file containing the data that is being imported. | [optional] | +| **upFile** | **File**| The CSV file containing the data that is being imported. | [optional] | ### Return type diff --git a/docs/NewCampaign.md b/docs/NewCampaign.md index 436930fb..4ca50d44 100644 --- a/docs/NewCampaign.md +++ b/docs/NewCampaign.md @@ -48,6 +48,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/NewCampaignTemplate.md b/docs/NewCampaignTemplate.md index ce037530..41f5d3e8 100644 --- a/docs/NewCampaignTemplate.md +++ b/docs/NewCampaignTemplate.md @@ -47,6 +47,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/NewEvent.md b/docs/NewEvent.md index 26fcd421..97338c18 100644 --- a/docs/NewEvent.md +++ b/docs/NewEvent.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**profileId** | **String** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] | |**storeIntegrationId** | **String** | The integration ID of the store. You choose this ID when you create a store. | [optional] | -|**type** | **String** | A string representing the event. Must not be a reserved event name. | | +|**type** | **String** | The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. | | |**attributes** | **Object** | Arbitrary additional JSON data associated with the event. | | |**sessionId** | **String** | The ID of the session that this event occurred in. | | diff --git a/docs/NewEventV3Entity.md b/docs/NewEventV3Entity.md new file mode 100644 index 00000000..f67324db --- /dev/null +++ b/docs/NewEventV3Entity.md @@ -0,0 +1,13 @@ + + +# NewEventV3Entity + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integrationId** | **String** | The unique ID of the event. Only one event with this ID can be registered. | | + + + diff --git a/docs/NewExperiment.md b/docs/NewExperiment.md index fbd12b7b..67bfe777 100644 --- a/docs/NewExperiment.md +++ b/docs/NewExperiment.md @@ -9,6 +9,19 @@ |------------ | ------------- | ------------- | -------------| |**isVariantAssignmentExternal** | **Boolean** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | | |**campaign** | [**NewCampaign**](NewCampaign.md) | | | +|**goalType** | [**GoalTypeEnum**](#GoalTypeEnum) | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. | | +|**goalDescription** | **String** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. | [optional] | + + + +## Enum: GoalTypeEnum + +| Name | Value | +|---- | -----| +| OTHER | "other" | +| MAXIMIZE_REVENUE | "maximize_revenue" | +| MAXIMIZE_ITEMS_SOLD | "maximize_items_sold" | +| OPTIMIZE_DISCOUNT_EFFICIENCY | "optimize_discount_efficiency" | diff --git a/docs/NewRevisionVersion.md b/docs/NewRevisionVersion.md index 90ed2923..1d607399 100644 --- a/docs/NewRevisionVersion.md +++ b/docs/NewRevisionVersion.md @@ -33,6 +33,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/NewReward.md b/docs/NewReward.md index 5b6aa303..a2e8d10d 100644 --- a/docs/NewReward.md +++ b/docs/NewReward.md @@ -12,8 +12,6 @@ |**description** | **String** | A description of the reward. | [optional] | |**applicationIds** | **List<Long>** | The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. | | |**sandbox** | **Boolean** | Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type. | | -|**rule** | [**List<Rule>**](Rule.md) | Rule to apply. | [optional] | -|**bindings** | [**List<Binding>**](Binding.md) | A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. | [optional] | diff --git a/docs/NewRiskNotification.md b/docs/NewRiskNotification.md new file mode 100644 index 00000000..a31220e0 --- /dev/null +++ b/docs/NewRiskNotification.md @@ -0,0 +1,46 @@ + + +# NewRiskNotification + +Data for creating a new risk notification. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**entity** | [**EntityEnum**](#EntityEnum) | The entity type to analyze within the given time frame. | | +|**activity** | [**ActivityEnum**](#ActivityEnum) | The activity metric to analyze within the given entity. | | +|**timeFrame** | [**TimeFrameEnum**](#TimeFrameEnum) | The rolling time window for risk evaluation. | | + + + +## Enum: EntityEnum + +| Name | Value | +|---- | -----| +| CUSTOMER_PROFILE | "customer_profile" | +| CUSTOMER_SESSION | "customer_session" | + + + +## Enum: ActivityEnum + +| Name | Value | +|---- | -----| +| LOYALTY_POINTS_EARNED | "loyalty_points_earned" | +| DISCOUNTED_AMOUNT | "discounted_amount" | +| COMPLETED_ORDERS | "completed_orders" | +| COUPON_ATTEMPTS | "coupon_attempts" | + + + +## Enum: TimeFrameEnum + +| Name | Value | +|---- | -----| +| _1_DAY | "1_day" | +| _1_WEEK | "1_week" | +| _1_MONTH | "1_month" | + + + diff --git a/docs/RevisionVersion.md b/docs/RevisionVersion.md index a6ff72f0..52555653 100644 --- a/docs/RevisionVersion.md +++ b/docs/RevisionVersion.md @@ -41,6 +41,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/Reward.md b/docs/Reward.md index 3c357c2a..8a62048a 100644 --- a/docs/Reward.md +++ b/docs/Reward.md @@ -15,9 +15,12 @@ |**description** | **String** | A description of the reward. | [optional] | |**applicationIds** | **List<Long>** | The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. | | |**sandbox** | **Boolean** | Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type. | | -|**rule** | [**List<Rule>**](Rule.md) | Rule to apply. | [optional] | +|**visibilityConditions** | [**Rule**](Rule.md) | An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. | [optional] | +|**rule** | [**Rule**](Rule.md) | Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. | [optional] | |**bindings** | [**List<Binding>**](Binding.md) | A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. | [optional] | +|**modified** | **OffsetDateTime** | The timestamp when the reward was last updated in RFC3339 format. | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | The status of the reward. | | +|**pointsRequired** | [**List<RewardPointsRequired>**](RewardPointsRequired.md) | The loyalty points required to activate a reward. | [optional] | diff --git a/docs/RewardPointsRequired.md b/docs/RewardPointsRequired.md new file mode 100644 index 00000000..6d6e6fd3 --- /dev/null +++ b/docs/RewardPointsRequired.md @@ -0,0 +1,17 @@ + + +# RewardPointsRequired + +The loyalty points required to activate a reward. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | The ID of the `pointsRequired` entry. When updating a reward, include this property to update an existing entry. Omit it to create a new one. | [optional] | +|**amount** | **BigDecimal** | The number of loyalty points required to activate the reward. | | +|**loyaltyProgramId** | **Long** | The ID of the associated loyalty program. | | +|**subledgerId** | **String** | The ID of the subledger within the loyalty program from which points are deducted when activating the reward. To specify the main ledger, provide an empty string (\"\"). | | + + + diff --git a/docs/RiskNotification.md b/docs/RiskNotification.md new file mode 100644 index 00000000..5e028d6c --- /dev/null +++ b/docs/RiskNotification.md @@ -0,0 +1,50 @@ + + +# RiskNotification + +A risk notification configuration rule. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | The internal ID of this entity. | | +|**created** | **OffsetDateTime** | The time this entity was created. | | +|**entity** | [**EntityEnum**](#EntityEnum) | The entity type to analyze within the given time frame. | | +|**activity** | [**ActivityEnum**](#ActivityEnum) | The activity metric to analyze within the given entity. | | +|**timeFrame** | [**TimeFrameEnum**](#TimeFrameEnum) | The rolling time window for risk evaluation. | | +|**active** | **Boolean** | Indicates whether this risk notification is active. | | +|**modified** | **OffsetDateTime** | Timestamp of the most recent update. | | + + + +## Enum: EntityEnum + +| Name | Value | +|---- | -----| +| CUSTOMER_PROFILE | "customer_profile" | +| CUSTOMER_SESSION | "customer_session" | + + + +## Enum: ActivityEnum + +| Name | Value | +|---- | -----| +| LOYALTY_POINTS_EARNED | "loyalty_points_earned" | +| DISCOUNTED_AMOUNT | "discounted_amount" | +| COMPLETED_ORDERS | "completed_orders" | +| COUPON_ATTEMPTS | "coupon_attempts" | + + + +## Enum: TimeFrameEnum + +| Name | Value | +|---- | -----| +| _1_DAY | "1_day" | +| _1_WEEK | "1_week" | +| _1_MONTH | "1_month" | + + + diff --git a/docs/RuleMetadata.md b/docs/RuleMetadata.md index 2fd2297c..69096ca6 100644 --- a/docs/RuleMetadata.md +++ b/docs/RuleMetadata.md @@ -11,7 +11,6 @@ |**displayName** | **String** | A customer-facing name for the rule. | [optional] | |**displayDescription** | **String** | A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. | [optional] | |**relatedData** | **String** | Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. | [optional] | -|**eligibility** | [**List<RuleEligibility>**](RuleEligibility.md) | | [optional] | diff --git a/docs/RuleMetadataEligibility.md b/docs/RuleMetadataEligibility.md new file mode 100644 index 00000000..c20baa2f --- /dev/null +++ b/docs/RuleMetadataEligibility.md @@ -0,0 +1,17 @@ + + +# RuleMetadataEligibility + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**title** | **String** | A short description of the rule. | | +|**displayName** | **String** | A customer-facing name for the rule. | [optional] | +|**displayDescription** | **String** | A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. | [optional] | +|**relatedData** | **String** | Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. | [optional] | +|**eligibility** | [**List<RuleEligibility>**](RuleEligibility.md) | | | + + + diff --git a/docs/StrikethroughLabelingNotification.md b/docs/StrikethroughLabelingNotification.md index cf5c4a73..53e5717c 100644 --- a/docs/StrikethroughLabelingNotification.md +++ b/docs/StrikethroughLabelingNotification.md @@ -8,7 +8,7 @@ The strikethrough labels notification for an application. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**version** | [**VersionEnum**](#VersionEnum) | The version of the strikethrough pricing notification. | [optional] | +|**version** | [**VersionEnum**](#VersionEnum) | The version of the strikethrough pricing notification. Set for **scheduled** strikethrough pricing updates only. | [optional] | |**validFrom** | **OffsetDateTime** | Timestamp at which the strikethrough pricing update becomes valid. Set for **scheduled** strikethrough pricing updates (version: v2) only. | [optional] | |**applicationId** | **Long** | The ID of the Application to which the catalog items labels belongs. | | |**currentBatch** | **Long** | The batch number of the notification. Notifications might be sent in different batches. | | diff --git a/docs/StrikethroughSetDiscountPerItemEffectProps.md b/docs/StrikethroughSetDiscountPerItemEffectProps.md index 94e5d7ee..fcfb5258 100644 --- a/docs/StrikethroughSetDiscountPerItemEffectProps.md +++ b/docs/StrikethroughSetDiscountPerItemEffectProps.md @@ -8,9 +8,9 @@ setDiscountPerItem effect in strikethrough pricing payload. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | effect name. | | +|**name** | **String** | The effect name. | | |**value** | **Object** | | | -|**excludedFromPriceHistory** | **Boolean** | | [optional] | +|**excludedFromPriceHistory** | **Boolean** | When set to `true`, the applied discount is excluded from the item's price history. | [optional] | diff --git a/docs/StrikethroughSetDiscountPerItemMemberEffectProps.md b/docs/StrikethroughSetDiscountPerItemMemberEffectProps.md index c6be3910..c7384e1d 100644 --- a/docs/StrikethroughSetDiscountPerItemMemberEffectProps.md +++ b/docs/StrikethroughSetDiscountPerItemMemberEffectProps.md @@ -8,7 +8,7 @@ setDiscountPerItem member effect in strikethrough pricing payload. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | effect name. | | +|**name** | **String** | The effect name. | | |**value** | **Object** | | | diff --git a/docs/SupportRequest.md b/docs/SupportRequest.md new file mode 100644 index 00000000..53e872fe --- /dev/null +++ b/docs/SupportRequest.md @@ -0,0 +1,49 @@ + + +# SupportRequest + +Summary of a support request created by a customer support agent. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | Identifier of the support request. | | +|**applicationId** | **Long** | Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL. | | +|**campaignId** | **Long** | Identifier of the campaign where the coupon or gift card is created. | [optional] | +|**loyaltyProgramId** | **Long** | Identifier of the loyalty program where the points are added or deducted. | [optional] | +|**subledgerId** | **Long** | Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically. | [optional] | +|**createdByUser** | **String** | Email address of the customer support agent who created the support request. | | +|**createdAt** | **OffsetDateTime** | Timestamp when the request was made. | | +|**customerProfileId** | **String** | Integration ID of the customer profile linked to the support request. | | +|**requestType** | [**RequestTypeEnum**](#RequestTypeEnum) | Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. | | +|**requestValue** | **Float** | Requested monetary balance of the gift card or the number of loyalty points to be added or deducted. | [optional] | +|**requestNote** | **String** | Notes attached to the support request. | | +|**requestStatus** | [**RequestStatusEnum**](#RequestStatusEnum) | Current status of the support request. | | +|**processedAt** | **OffsetDateTime** | Timestamp when the request was approved or rejected. | [optional] | +|**processingNote** | **String** | Notes attached by the admin when rejecting or approving a request. | [optional] | +|**processedByUser** | **String** | Email address of the admin who approved or rejected the support request. | [optional] | + + + +## Enum: RequestTypeEnum + +| Name | Value | +|---- | -----| +| GIFT_CARD | "gift_card" | +| PERSONAL_COUPON | "personal_coupon" | +| LOYALTY_POINTS_ADDED | "loyalty_points_added" | +| LOYALTY_POINTS_DEDUCTED | "loyalty_points_deducted" | + + + +## Enum: RequestStatusEnum + +| Name | Value | +|---- | -----| +| PENDING_APPROVAL | "pending_approval" | +| APPROVED | "approved" | +| REJECTED | "rejected" | + + + diff --git a/docs/SupportRequestInput.md b/docs/SupportRequestInput.md new file mode 100644 index 00000000..f2af8180 --- /dev/null +++ b/docs/SupportRequestInput.md @@ -0,0 +1,31 @@ + + +# SupportRequestInput + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**applicationId** | **Long** | Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL. | | +|**campaignId** | **Long** | Identifier of the campaign where the coupon or gift card is created. | [optional] | +|**loyaltyProgramId** | **Long** | Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | [optional] | +|**subledgerId** | **Long** | Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically. | [optional] | +|**customerProfileId** | **String** | Integration ID of the customer profile linked to the support request. | | +|**requestType** | [**RequestTypeEnum**](#RequestTypeEnum) | Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. | | +|**requestValue** | **Float** | Requested monetary balance of the gift card or the number of loyalty points to be added or deducted. | [optional] | +|**requestNote** | **String** | Notes attached to the support request. | | + + + +## Enum: RequestTypeEnum + +| Name | Value | +|---- | -----| +| GIFT_CARD | "gift_card" | +| PERSONAL_COUPON | "personal_coupon" | +| LOYALTY_POINTS_ADDED | "loyalty_points_added" | +| LOYALTY_POINTS_DEDUCTED | "loyalty_points_deducted" | + + + diff --git a/docs/TalangAttribute.md b/docs/TalangAttribute.md index 16cd2106..53061307 100644 --- a/docs/TalangAttribute.md +++ b/docs/TalangAttribute.md @@ -43,6 +43,8 @@ | SESSION | "Session" | | STORE | "Store" | | ACHIEVEMENTS | "Achievements" | +| ADVANCED_EVENT | "AdvancedEvent" | +| ADVANCED_EVENT_CONNECTED_SESSION | "AdvancedEventConnectedSession" | diff --git a/docs/UpdateAchievementV2.md b/docs/UpdateAchievementV2.md index e5938601..f8cb42a9 100644 --- a/docs/UpdateAchievementV2.md +++ b/docs/UpdateAchievementV2.md @@ -7,19 +7,17 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. | [optional] | -|**title** | **String** | The display name for the achievement in the Campaign Manager. | [optional] | -|**description** | **String** | A description of the achievement. | [optional] | -|**target** | **BigDecimal** | The required number of actions or the transactional milestone to complete the achievement. | [optional] | +|**name** | **String** | The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. | | +|**title** | **String** | The display name for the achievement in the Campaign Manager. | | +|**description** | **String** | A description of the achievement. | | +|**target** | **BigDecimal** | The required number of actions or the transactional milestone to complete the achievement. | | |**period** | **String** | The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. | [optional] | |**recurrencePolicy** | [**RecurrencePolicyEnum**](#RecurrencePolicyEnum) | The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again. | [optional] | |**activationPolicy** | [**ActivationPolicyEnum**](#ActivationPolicyEnum) | The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule. | [optional] | |**fixedStartDate** | **OffsetDateTime** | The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**endDate** | **OffsetDateTime** | The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string. | [optional] | |**allowRollbackAfterCompletion** | **Boolean** | When `true`, customer progress can be rolled back in completed achievements. | [optional] | -|**sandbox** | **Boolean** | Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. | [optional] | -|**subscribedApplications** | **List<Long>** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | [optional] | -|**timezone** | **String** | A string containing an IANA timezone descriptor. | [optional] | +|**subscribedApplications** | **List<Long>** | A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. | | diff --git a/docs/UpdateCampaign.md b/docs/UpdateCampaign.md index 7cae9295..1d5f835d 100644 --- a/docs/UpdateCampaign.md +++ b/docs/UpdateCampaign.md @@ -48,6 +48,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/UpdateCampaignTemplate.md b/docs/UpdateCampaignTemplate.md index dd182591..cfff0698 100644 --- a/docs/UpdateCampaignTemplate.md +++ b/docs/UpdateCampaignTemplate.md @@ -49,6 +49,7 @@ | GIVEAWAYS | "giveaways" | | STRIKETHROUGH | "strikethrough" | | ACHIEVEMENTS | "achievements" | +| ADVANCED_EVENTS | "advancedEvents" | diff --git a/docs/UpdateExperiment.md b/docs/UpdateExperiment.md index 2bf215f8..f2035724 100644 --- a/docs/UpdateExperiment.md +++ b/docs/UpdateExperiment.md @@ -9,6 +9,19 @@ |------------ | ------------- | ------------- | -------------| |**isVariantAssignmentExternal** | **Boolean** | The source of the assignment. - false - The variant assignment is handled internally by Talon.One. - true - The variant assignment is handled externally. | | |**campaign** | [**UpdateCampaign**](UpdateCampaign.md) | | | +|**goalType** | [**GoalTypeEnum**](#GoalTypeEnum) | The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. | [optional] | +|**goalDescription** | **String** | A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. | [optional] | + + + +## Enum: GoalTypeEnum + +| Name | Value | +|---- | -----| +| OTHER | "other" | +| MAXIMIZE_REVENUE | "maximize_revenue" | +| MAXIMIZE_ITEMS_SOLD | "maximize_items_sold" | +| OPTIMIZE_DISCOUNT_EFFICIENCY | "optimize_discount_efficiency" | diff --git a/docs/UpdateReward.md b/docs/UpdateReward.md index a8d85bdf..07577c6c 100644 --- a/docs/UpdateReward.md +++ b/docs/UpdateReward.md @@ -10,8 +10,10 @@ |**name** | **String** | The name of the reward. | | |**description** | **String** | A description of the reward. | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | The status of the reward. | | -|**rule** | [**List<Rule>**](Rule.md) | Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. | [optional] | +|**visibilityConditions** | [**Rule**](Rule.md) | An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. | [optional] | +|**rule** | [**Rule**](Rule.md) | Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. | [optional] | |**bindings** | [**List<Binding>**](Binding.md) | A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. | [optional] | +|**pointsRequired** | [**List<RewardPointsRequired>**](RewardPointsRequired.md) | The loyalty points required to activate the reward. Each object defines the specific loyalty program and subledger from which points are deducted when activating the reward. **Note:** - Objects with an `id` are updated. - Objects without an `id` are created. - Existing objects omitted from the payload are deleted. | [optional] | diff --git a/docs/UpdateSupportRequest.md b/docs/UpdateSupportRequest.md new file mode 100644 index 00000000..d238b9d5 --- /dev/null +++ b/docs/UpdateSupportRequest.md @@ -0,0 +1,23 @@ + + +# UpdateSupportRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**requestStatus** | [**RequestStatusEnum**](#RequestStatusEnum) | Current status of the support request. | | +|**processingNote** | **String** | Notes attached by the admin when rejecting or approving a request. | [optional] | + + + +## Enum: RequestStatusEnum + +| Name | Value | +|---- | -----| +| APPROVED | "approved" | +| REJECTED | "rejected" | + + + diff --git a/pom.xml b/pom.xml index 500ce8a3..1168b49d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ talon-one-client jar talon-one-client - 26.09.0 + 26.11.0 https://github.com/talon-one/talon-one-maven-artifacts Talon.One unified JAVA SDK. It allows for programmatic access to the integration and management API with their respective authentication strategies diff --git a/src/main/java/one/talon/ApiClient.java b/src/main/java/one/talon/ApiClient.java index 1b7fe3ff..939f8665 100644 --- a/src/main/java/one/talon/ApiClient.java +++ b/src/main/java/one/talon/ApiClient.java @@ -142,7 +142,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/26.09.0/java"); + setUserAgent("OpenAPI-Generator/26.11.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/one/talon/Configuration.java b/src/main/java/one/talon/Configuration.java index 77afad4a..61a977be 100644 --- a/src/main/java/one/talon/Configuration.java +++ b/src/main/java/one/talon/Configuration.java @@ -19,7 +19,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") public class Configuration { - public static final String VERSION = "26.09.0"; + public static final String VERSION = "26.11.0"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/one/talon/JSON.java b/src/main/java/one/talon/JSON.java index 471ce3b5..e3b56a10 100644 --- a/src/main/java/one/talon/JSON.java +++ b/src/main/java/one/talon/JSON.java @@ -250,6 +250,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CartItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CartItemFilterTemplate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.Catalog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CatalogAction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CatalogActionFilter.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CatalogItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CatalogRule.CustomTypeAdapterFactory()); @@ -329,6 +330,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.EventType.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.EventV2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.EventV3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.EventV3Connections.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.EventV3Entity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.EventV3RequestEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.Experiment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.ExperimentCampaignCopy.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.ExperimentCopy.CustomTypeAdapterFactory()); @@ -361,6 +365,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.ExtendLoyaltyPointsExpiryDateEffectProps.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.ExtendedCoupon.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.FeatureFlag.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.FeatureFlagUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.FeaturesFeed.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.FuncArgDef.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.FunctionDef.CustomTypeAdapterFactory()); @@ -430,6 +435,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IncreaseAchievementProgressEffectProps.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.InfluencingCampaignDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationCampaign.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationCampaignBase.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationCoupon.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationCustomerProfileAudienceRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationCustomerProfileAudienceRequestItem.CustomTypeAdapterFactory()); @@ -450,6 +456,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubEventRecord.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubEventStatusUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubFlow.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubFlowConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.IntegrationHubFlowConfigResponse.CustomTypeAdapterFactory()); @@ -565,6 +572,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewCustomerSessionV2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewEventType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewEventV3Entity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewExperiment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewExperimentVariant.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewExperimentVariantArray.CustomTypeAdapterFactory()); @@ -591,6 +599,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewReturn.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewRevisionVersion.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewReward.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewRiskNotification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewRole.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewRoleV2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.NewRuleset.CustomTypeAdapterFactory()); @@ -659,6 +668,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RevisionActivationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RevisionVersion.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.Reward.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RewardPointsRequired.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RiskNotification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.Role.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RoleAssign.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RoleMembership.CustomTypeAdapterFactory()); @@ -681,6 +692,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RuleEligibilityFailureDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RuleFailureReason.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RuleMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.RuleMetadataEligibility.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.Ruleset.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.SSOConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.SamlConnection.CustomTypeAdapterFactory()); @@ -731,6 +743,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.StrikethroughTrigger.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.SummarizeCampaignStoreBudget200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.SummaryCampaignStoreBudget.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.SupportRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.SupportRequestInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.TalangAttribute.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.TalangAttributeVisibility.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.TemplateArgDef.CustomTypeAdapterFactory()); @@ -788,6 +802,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new one.talon.model.UpdateReward.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.UpdateRole.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.UpdateStore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new one.talon.model.UpdateSupportRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.UpdateUser.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.User.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new one.talon.model.UserEntity.CustomTypeAdapterFactory()); diff --git a/src/main/java/one/talon/api/IntegrationApi.java b/src/main/java/one/talon/api/IntegrationApi.java index 35c6fe4f..066395fe 100644 --- a/src/main/java/one/talon/api/IntegrationApi.java +++ b/src/main/java/one/talon/api/IntegrationApi.java @@ -4716,7 +4716,7 @@ private okhttp3.Call trackEventV2ValidateBeforeCall(@javax.annotation.Nonnull In /** * Track event - * Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + * Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. * @param integrationEventV2Request body (required) * @param silent Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to yes) * @param dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. (optional) @@ -4741,7 +4741,7 @@ public IntegrationEventV2Response trackEventV2(@javax.annotation.Nonnull Integra /** * Track event - * Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + * Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. * @param integrationEventV2Request body (required) * @param silent Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to yes) * @param dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. (optional) @@ -4767,7 +4767,7 @@ public ApiResponse trackEventV2WithHttpInfo(@javax.a /** * Track event (asynchronously) - * Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + * Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. * @param integrationEventV2Request body (required) * @param silent Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to yes) * @param dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. (optional) diff --git a/src/main/java/one/talon/api/ManagementApi.java b/src/main/java/one/talon/api/ManagementApi.java index da36dbb3..b46483bc 100644 --- a/src/main/java/one/talon/api/ManagementApi.java +++ b/src/main/java/one/talon/api/ManagementApi.java @@ -62,6 +62,7 @@ import one.talon.model.ErrorResponse; import one.talon.model.ErrorResponseWithStatus; import one.talon.model.Experiment; +import java.io.File; import one.talon.model.GenerateCouponRejections200Response; import one.talon.model.GetAccessLogsWithoutTotalCount200Response; import one.talon.model.GetAdditionalCosts200Response; @@ -16669,8 +16670,8 @@ private okhttp3.Call getLoyaltyCardTransactionLogsValidateBeforeCall(@javax.anno } /** - * List card's transactions - * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + * List card's transactions (Management API) + * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. > [!note] For most use cases, especially real-time integrations, use the Integration API endpoint: > [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions). If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. (required) * @param startDate Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) @@ -16697,8 +16698,8 @@ public GetLoyaltyCardTransactionLogs200Response getLoyaltyCardTransactionLogs(@j } /** - * List card's transactions - * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + * List card's transactions (Management API) + * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. > [!note] For most use cases, especially real-time integrations, use the Integration API endpoint: > [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions). If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. (required) * @param startDate Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) @@ -16726,8 +16727,8 @@ public ApiResponse getLoyaltyCardTrans } /** - * List card's transactions (asynchronously) - * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + * List card's transactions (Management API) (asynchronously) + * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. > [!note] For most use cases, especially real-time integrations, use the Integration API endpoint: > [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions). If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. (required) * @param startDate Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) @@ -17039,8 +17040,8 @@ private okhttp3.Call getLoyaltyLedgerBalancesValidateBeforeCall(@javax.annotatio } /** - * Get customer's loyalty balances - * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + * Get customer's loyalty balances (Management API) + * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: [Get customer's loyalty balances](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances). > - If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) * @param loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) @@ -17065,8 +17066,8 @@ public LoyaltyBalancesWithTiers getLoyaltyLedgerBalances(@javax.annotation.Nonnu } /** - * Get customer's loyalty balances - * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + * Get customer's loyalty balances (Management API) + * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: [Get customer's loyalty balances](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances). > - If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) * @param loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) @@ -17092,8 +17093,8 @@ public ApiResponse getLoyaltyLedgerBalancesWithHttpInf } /** - * Get customer's loyalty balances (asynchronously) - * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + * Get customer's loyalty balances (Management API) (asynchronously) + * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: [Get customer's loyalty balances](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances). > - If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) * @param loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) @@ -17518,8 +17519,8 @@ private okhttp3.Call getLoyaltyProgramProfileLedgerTransactionsValidateBeforeCal } /** - * List customer's loyalty transactions - * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint. + * List customer's loyalty transactions (Management API) + * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: > [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). > - To retrieve all loyalty program transaction logs in a given loyalty program, use the > [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. * @param loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param customerSessionIDs Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. (optional) @@ -17549,8 +17550,8 @@ public GetLoyaltyProgramProfileTransactions200Response getLoyaltyProgramProfileL } /** - * List customer's loyalty transactions - * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint. + * List customer's loyalty transactions (Management API) + * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: > [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). > - To retrieve all loyalty program transaction logs in a given loyalty program, use the > [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. * @param loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param customerSessionIDs Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. (optional) @@ -17581,8 +17582,8 @@ public ApiResponse getLoyaltyPr } /** - * List customer's loyalty transactions (asynchronously) - * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint. + * List customer's loyalty transactions (Management API) (asynchronously) + * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: > [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). > - To retrieve all loyalty program transaction logs in a given loyalty program, use the > [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. * @param loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param customerSessionIDs Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. (optional) @@ -19676,7 +19677,7 @@ public okhttp3.Call getWebhooksAsync(@javax.annotation.Nullable String applicati /** * Build call for importAccountCollection * @param collectionId The ID of the collection. You can get it with the [List collections in account](#tag/Collections/operation/listAccountCollections) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -19689,7 +19690,7 @@ public okhttp3.Call getWebhooksAsync(@javax.annotation.Nullable String applicati 401 Unauthorized - */ - public okhttp3.Call importAccountCollectionCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importAccountCollectionCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -19740,7 +19741,7 @@ public okhttp3.Call importAccountCollectionCall(@javax.annotation.Nonnull Long c } @SuppressWarnings("rawtypes") - private okhttp3.Call importAccountCollectionValidateBeforeCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importAccountCollectionValidateBeforeCall(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new ApiException("Missing the required parameter 'collectionId' when calling importAccountCollection(Async)"); @@ -19754,7 +19755,7 @@ private okhttp3.Call importAccountCollectionValidateBeforeCall(@javax.annotation * Import data into existing account-level collection * Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. ## Example ``` item Adidas Nike Asics ``` > [!note] Before sending a request to this endpoint, ensure the data in the > CSV to import is different from the data currently stored in the collection. * @param collectionId The ID of the collection. You can get it with the [List collections in account](#tag/Collections/operation/listAccountCollections) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -19766,7 +19767,7 @@ private okhttp3.Call importAccountCollectionValidateBeforeCall(@javax.annotation 401 Unauthorized - */ - public ModelImport importAccountCollection(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importAccountCollection(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importAccountCollectionWithHttpInfo(collectionId, upFile); return localVarResp.getData(); } @@ -19775,7 +19776,7 @@ public ModelImport importAccountCollection(@javax.annotation.Nonnull Long collec * Import data into existing account-level collection * Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. ## Example ``` item Adidas Nike Asics ``` > [!note] Before sending a request to this endpoint, ensure the data in the > CSV to import is different from the data currently stored in the collection. * @param collectionId The ID of the collection. You can get it with the [List collections in account](#tag/Collections/operation/listAccountCollections) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -19787,7 +19788,7 @@ public ModelImport importAccountCollection(@javax.annotation.Nonnull Long collec 401 Unauthorized - */ - public ApiResponse importAccountCollectionWithHttpInfo(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importAccountCollectionWithHttpInfo(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importAccountCollectionValidateBeforeCall(collectionId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -19797,7 +19798,7 @@ public ApiResponse importAccountCollectionWithHttpInfo(@javax.annot * Import data into existing account-level collection (asynchronously) * Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. ## Example ``` item Adidas Nike Asics ``` > [!note] Before sending a request to this endpoint, ensure the data in the > CSV to import is different from the data currently stored in the collection. * @param collectionId The ID of the collection. You can get it with the [List collections in account](#tag/Collections/operation/listAccountCollections) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -19810,7 +19811,7 @@ public ApiResponse importAccountCollectionWithHttpInfo(@javax.annot 401 Unauthorized - */ - public okhttp3.Call importAccountCollectionAsync(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importAccountCollectionAsync(@javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importAccountCollectionValidateBeforeCall(collectionId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -19820,7 +19821,7 @@ public okhttp3.Call importAccountCollectionAsync(@javax.annotation.Nonnull Long /** * Build call for importAllowedList * @param attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -19834,7 +19835,7 @@ public okhttp3.Call importAccountCollectionAsync(@javax.annotation.Nonnull Long 404 Not found - */ - public okhttp3.Call importAllowedListCall(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importAllowedListCall(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -19885,7 +19886,7 @@ public okhttp3.Call importAllowedListCall(@javax.annotation.Nonnull Long attribu } @SuppressWarnings("rawtypes") - private okhttp3.Call importAllowedListValidateBeforeCall(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importAllowedListValidateBeforeCall(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'attributeId' is set if (attributeId == null) { throw new ApiException("Missing the required parameter 'attributeId' when calling importAllowedList(Async)"); @@ -19899,7 +19900,7 @@ private okhttp3.Call importAllowedListValidateBeforeCall(@javax.annotation.Nonnu * Import allowed values for attribute * Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item`: The values in your allowed list, for example a list of SKUs. An allowed list is limited to 500,000 items. ## Example ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ``` * @param attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -19912,7 +19913,7 @@ private okhttp3.Call importAllowedListValidateBeforeCall(@javax.annotation.Nonnu 404 Not found - */ - public ModelImport importAllowedList(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importAllowedList(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importAllowedListWithHttpInfo(attributeId, upFile); return localVarResp.getData(); } @@ -19921,7 +19922,7 @@ public ModelImport importAllowedList(@javax.annotation.Nonnull Long attributeId, * Import allowed values for attribute * Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item`: The values in your allowed list, for example a list of SKUs. An allowed list is limited to 500,000 items. ## Example ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ``` * @param attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -19934,7 +19935,7 @@ public ModelImport importAllowedList(@javax.annotation.Nonnull Long attributeId, 404 Not found - */ - public ApiResponse importAllowedListWithHttpInfo(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importAllowedListWithHttpInfo(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importAllowedListValidateBeforeCall(attributeId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -19944,7 +19945,7 @@ public ApiResponse importAllowedListWithHttpInfo(@javax.annotation. * Import allowed values for attribute (asynchronously) * Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item`: The values in your allowed list, for example a list of SKUs. An allowed list is limited to 500,000 items. ## Example ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ``` * @param attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -19958,7 +19959,7 @@ public ApiResponse importAllowedListWithHttpInfo(@javax.annotation. 404 Not found - */ - public okhttp3.Call importAllowedListAsync(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importAllowedListAsync(@javax.annotation.Nonnull Long attributeId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importAllowedListValidateBeforeCall(attributeId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -19968,7 +19969,7 @@ public okhttp3.Call importAllowedListAsync(@javax.annotation.Nonnull Long attrib /** * Build call for importAudiencesMemberships * @param audienceId The ID of the audience. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -19982,7 +19983,7 @@ public okhttp3.Call importAllowedListAsync(@javax.annotation.Nonnull Long attrib 404 Not found - */ - public okhttp3.Call importAudiencesMembershipsCall(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importAudiencesMembershipsCall(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20033,7 +20034,7 @@ public okhttp3.Call importAudiencesMembershipsCall(@javax.annotation.Nonnull Lon } @SuppressWarnings("rawtypes") - private okhttp3.Call importAudiencesMembershipsValidateBeforeCall(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importAudiencesMembershipsValidateBeforeCall(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'audienceId' is set if (audienceId == null) { throw new ApiException("Missing the required parameter 'audienceId' when calling importAudiencesMemberships(Async)"); @@ -20047,7 +20048,7 @@ private okhttp3.Call importAudiencesMembershipsValidateBeforeCall(@javax.annotat * Import audience members * Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. > [!note] We recommend limiting your file size to 500 MB. ## Example ```text profileintegrationid charles alexa ``` * @param audienceId The ID of the audience. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20060,7 +20061,7 @@ private okhttp3.Call importAudiencesMembershipsValidateBeforeCall(@javax.annotat 404 Not found - */ - public ModelImport importAudiencesMemberships(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importAudiencesMemberships(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importAudiencesMembershipsWithHttpInfo(audienceId, upFile); return localVarResp.getData(); } @@ -20069,7 +20070,7 @@ public ModelImport importAudiencesMemberships(@javax.annotation.Nonnull Long aud * Import audience members * Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. > [!note] We recommend limiting your file size to 500 MB. ## Example ```text profileintegrationid charles alexa ``` * @param audienceId The ID of the audience. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20082,7 +20083,7 @@ public ModelImport importAudiencesMemberships(@javax.annotation.Nonnull Long aud 404 Not found - */ - public ApiResponse importAudiencesMembershipsWithHttpInfo(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importAudiencesMembershipsWithHttpInfo(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importAudiencesMembershipsValidateBeforeCall(audienceId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -20092,7 +20093,7 @@ public ApiResponse importAudiencesMembershipsWithHttpInfo(@javax.an * Import audience members (asynchronously) * Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. > [!note] We recommend limiting your file size to 500 MB. ## Example ```text profileintegrationid charles alexa ``` * @param audienceId The ID of the audience. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -20106,7 +20107,7 @@ public ApiResponse importAudiencesMembershipsWithHttpInfo(@javax.an 404 Not found - */ - public okhttp3.Call importAudiencesMembershipsAsync(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importAudiencesMembershipsAsync(@javax.annotation.Nonnull Long audienceId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importAudiencesMembershipsValidateBeforeCall(audienceId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -20119,7 +20120,7 @@ public okhttp3.Call importAudiencesMembershipsAsync(@javax.annotation.Nonnull Lo * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param action The action that this budget is limiting. (optional) * @param period The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20131,7 +20132,7 @@ public okhttp3.Call importAudiencesMembershipsAsync(@javax.annotation.Nonnull Lo 400 Bad request - */ - public okhttp3.Call importCampaignStoreBudgetCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCampaignStoreBudgetCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20191,7 +20192,7 @@ public okhttp3.Call importCampaignStoreBudgetCall(@javax.annotation.Nonnull Long } @SuppressWarnings("rawtypes") - private okhttp3.Call importCampaignStoreBudgetValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importCampaignStoreBudgetValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'applicationId' is set if (applicationId == null) { throw new ApiException("Missing the required parameter 'applicationId' when calling importCampaignStoreBudget(Async)"); @@ -20213,7 +20214,7 @@ private okhttp3.Call importCampaignStoreBudgetValidateBeforeCall(@javax.annotati * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param action The action that this budget is limiting. (optional) * @param period The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20224,7 +20225,7 @@ private okhttp3.Call importCampaignStoreBudgetValidateBeforeCall(@javax.annotati 400 Bad request - */ - public ModelImport importCampaignStoreBudget(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importCampaignStoreBudget(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importCampaignStoreBudgetWithHttpInfo(applicationId, campaignId, action, period, upFile); return localVarResp.getData(); } @@ -20236,7 +20237,7 @@ public ModelImport importCampaignStoreBudget(@javax.annotation.Nonnull Long appl * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param action The action that this budget is limiting. (optional) * @param period The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20247,7 +20248,7 @@ public ModelImport importCampaignStoreBudget(@javax.annotation.Nonnull Long appl 400 Bad request - */ - public ApiResponse importCampaignStoreBudgetWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importCampaignStoreBudgetWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importCampaignStoreBudgetValidateBeforeCall(applicationId, campaignId, action, period, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -20260,7 +20261,7 @@ public ApiResponse importCampaignStoreBudgetWithHttpInfo(@javax.ann * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param action The action that this budget is limiting. (optional) * @param period The period to which the limit applies. **Note**: For budgets with no period, set this to `overall`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -20272,7 +20273,7 @@ public ApiResponse importCampaignStoreBudgetWithHttpInfo(@javax.ann 400 Bad request - */ - public okhttp3.Call importCampaignStoreBudgetAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCampaignStoreBudgetAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String action, @javax.annotation.Nullable String period, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importCampaignStoreBudgetValidateBeforeCall(applicationId, campaignId, action, period, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -20283,7 +20284,7 @@ public okhttp3.Call importCampaignStoreBudgetAsync(@javax.annotation.Nonnull Lon * Build call for importCampaignStores * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20297,7 +20298,7 @@ public okhttp3.Call importCampaignStoreBudgetAsync(@javax.annotation.Nonnull Lon 404 Not found - */ - public okhttp3.Call importCampaignStoresCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCampaignStoresCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20349,7 +20350,7 @@ public okhttp3.Call importCampaignStoresCall(@javax.annotation.Nonnull Long appl } @SuppressWarnings("rawtypes") - private okhttp3.Call importCampaignStoresValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importCampaignStoresValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'applicationId' is set if (applicationId == null) { throw new ApiException("Missing the required parameter 'applicationId' when calling importCampaignStores(Async)"); @@ -20369,7 +20370,7 @@ private okhttp3.Call importCampaignStoresValidateBeforeCall(@javax.annotation.No * Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20382,7 +20383,7 @@ private okhttp3.Call importCampaignStoresValidateBeforeCall(@javax.annotation.No 404 Not found - */ - public ModelImport importCampaignStores(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importCampaignStores(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importCampaignStoresWithHttpInfo(applicationId, campaignId, upFile); return localVarResp.getData(); } @@ -20392,7 +20393,7 @@ public ModelImport importCampaignStores(@javax.annotation.Nonnull Long applicati * Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20405,7 +20406,7 @@ public ModelImport importCampaignStores(@javax.annotation.Nonnull Long applicati 404 Not found - */ - public ApiResponse importCampaignStoresWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importCampaignStoresWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importCampaignStoresValidateBeforeCall(applicationId, campaignId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -20416,7 +20417,7 @@ public ApiResponse importCampaignStoresWithHttpInfo(@javax.annotati * Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -20430,7 +20431,7 @@ public ApiResponse importCampaignStoresWithHttpInfo(@javax.annotati 404 Not found - */ - public okhttp3.Call importCampaignStoresAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCampaignStoresAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importCampaignStoresValidateBeforeCall(applicationId, campaignId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -20442,7 +20443,7 @@ public okhttp3.Call importCampaignStoresAsync(@javax.annotation.Nonnull Long app * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param collectionId The ID of the collection. You can get it with the [List collections in Application](#tag/Collections/operation/listCollectionsInApplication) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20454,7 +20455,7 @@ public okhttp3.Call importCampaignStoresAsync(@javax.annotation.Nonnull Long app 401 Unauthorized - */ - public okhttp3.Call importCollectionCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCollectionCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20507,7 +20508,7 @@ public okhttp3.Call importCollectionCall(@javax.annotation.Nonnull Long applicat } @SuppressWarnings("rawtypes") - private okhttp3.Call importCollectionValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importCollectionValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'applicationId' is set if (applicationId == null) { throw new ApiException("Missing the required parameter 'applicationId' when calling importCollection(Async)"); @@ -20533,7 +20534,7 @@ private okhttp3.Call importCollectionValidateBeforeCall(@javax.annotation.Nonnul * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param collectionId The ID of the collection. You can get it with the [List collections in Application](#tag/Collections/operation/listCollectionsInApplication) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20544,7 +20545,7 @@ private okhttp3.Call importCollectionValidateBeforeCall(@javax.annotation.Nonnul 401 Unauthorized - */ - public ModelImport importCollection(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importCollection(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importCollectionWithHttpInfo(applicationId, campaignId, collectionId, upFile); return localVarResp.getData(); } @@ -20555,7 +20556,7 @@ public ModelImport importCollection(@javax.annotation.Nonnull Long applicationId * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param collectionId The ID of the collection. You can get it with the [List collections in Application](#tag/Collections/operation/listCollectionsInApplication) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20566,7 +20567,7 @@ public ModelImport importCollection(@javax.annotation.Nonnull Long applicationId 401 Unauthorized - */ - public ApiResponse importCollectionWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importCollectionWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importCollectionValidateBeforeCall(applicationId, campaignId, collectionId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -20578,7 +20579,7 @@ public ApiResponse importCollectionWithHttpInfo(@javax.annotation.N * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param collectionId The ID of the collection. You can get it with the [List collections in Application](#tag/Collections/operation/listCollectionsInApplication) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -20590,7 +20591,7 @@ public ApiResponse importCollectionWithHttpInfo(@javax.annotation.N 401 Unauthorized - */ - public okhttp3.Call importCollectionAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCollectionAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nonnull Long collectionId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importCollectionValidateBeforeCall(applicationId, campaignId, collectionId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -20602,7 +20603,7 @@ public okhttp3.Call importCollectionAsync(@javax.annotation.Nonnull Long applica * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20613,7 +20614,7 @@ public okhttp3.Call importCollectionAsync(@javax.annotation.Nonnull Long applica 200 OK - */ - public okhttp3.Call importCouponsCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCouponsCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20669,7 +20670,7 @@ public okhttp3.Call importCouponsCall(@javax.annotation.Nonnull Long application } @SuppressWarnings("rawtypes") - private okhttp3.Call importCouponsValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importCouponsValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'applicationId' is set if (applicationId == null) { throw new ApiException("Missing the required parameter 'applicationId' when calling importCoupons(Async)"); @@ -20690,7 +20691,7 @@ private okhttp3.Call importCouponsValidateBeforeCall(@javax.annotation.Nonnull L * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20700,7 +20701,7 @@ private okhttp3.Call importCouponsValidateBeforeCall(@javax.annotation.Nonnull L 200 OK - */ - public ModelImport importCoupons(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importCoupons(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importCouponsWithHttpInfo(applicationId, campaignId, skipDuplicates, upFile); return localVarResp.getData(); } @@ -20711,7 +20712,7 @@ public ModelImport importCoupons(@javax.annotation.Nonnull Long applicationId, @ * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20721,7 +20722,7 @@ public ModelImport importCoupons(@javax.annotation.Nonnull Long applicationId, @ 200 OK - */ - public ApiResponse importCouponsWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importCouponsWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importCouponsValidateBeforeCall(applicationId, campaignId, skipDuplicates, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -20733,7 +20734,7 @@ public ApiResponse importCouponsWithHttpInfo(@javax.annotation.Nonn * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -20744,7 +20745,7 @@ public ApiResponse importCouponsWithHttpInfo(@javax.annotation.Nonn 200 OK - */ - public okhttp3.Call importCouponsAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importCouponsAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable Boolean skipDuplicates, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importCouponsValidateBeforeCall(applicationId, campaignId, skipDuplicates, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -20754,7 +20755,7 @@ public okhttp3.Call importCouponsAsync(@javax.annotation.Nonnull Long applicatio /** * Build call for importLoyaltyCards * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20767,7 +20768,7 @@ public okhttp3.Call importCouponsAsync(@javax.annotation.Nonnull Long applicatio 404 Not found - */ - public okhttp3.Call importLoyaltyCardsCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importLoyaltyCardsCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20818,7 +20819,7 @@ public okhttp3.Call importLoyaltyCardsCall(@javax.annotation.Nonnull Long loyalt } @SuppressWarnings("rawtypes") - private okhttp3.Call importLoyaltyCardsValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importLoyaltyCardsValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'loyaltyProgramId' is set if (loyaltyProgramId == null) { throw new ApiException("Missing the required parameter 'loyaltyProgramId' when calling importLoyaltyCards(Async)"); @@ -20830,9 +20831,9 @@ private okhttp3.Call importLoyaltyCardsValidateBeforeCall(@javax.annotation.Nonn /** * Import loyalty cards - * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20844,16 +20845,16 @@ private okhttp3.Call importLoyaltyCardsValidateBeforeCall(@javax.annotation.Nonn 404 Not found - */ - public ModelImport importLoyaltyCards(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importLoyaltyCards(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importLoyaltyCardsWithHttpInfo(loyaltyProgramId, upFile); return localVarResp.getData(); } /** * Import loyalty cards - * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20865,7 +20866,7 @@ public ModelImport importLoyaltyCards(@javax.annotation.Nonnull Long loyaltyProg 404 Not found - */ - public ApiResponse importLoyaltyCardsWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importLoyaltyCardsWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importLoyaltyCardsValidateBeforeCall(loyaltyProgramId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -20873,9 +20874,9 @@ public ApiResponse importLoyaltyCardsWithHttpInfo(@javax.annotation /** * Import loyalty cards (asynchronously) - * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` * @param loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -20888,7 +20889,7 @@ public ApiResponse importLoyaltyCardsWithHttpInfo(@javax.annotation 404 Not found - */ - public okhttp3.Call importLoyaltyCardsAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importLoyaltyCardsAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importLoyaltyCardsValidateBeforeCall(loyaltyProgramId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -20898,7 +20899,7 @@ public okhttp3.Call importLoyaltyCardsAsync(@javax.annotation.Nonnull Long loyal /** * Build call for importLoyaltyCustomersTiers * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20912,7 +20913,7 @@ public okhttp3.Call importLoyaltyCardsAsync(@javax.annotation.Nonnull Long loyal 404 Not found - */ - public okhttp3.Call importLoyaltyCustomersTiersCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importLoyaltyCustomersTiersCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -20963,7 +20964,7 @@ public okhttp3.Call importLoyaltyCustomersTiersCall(@javax.annotation.Nonnull Lo } @SuppressWarnings("rawtypes") - private okhttp3.Call importLoyaltyCustomersTiersValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importLoyaltyCustomersTiersValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'loyaltyProgramId' is set if (loyaltyProgramId == null) { throw new ApiException("Missing the required parameter 'loyaltyProgramId' when calling importLoyaltyCustomersTiers(Async)"); @@ -20975,9 +20976,9 @@ private okhttp3.Call importLoyaltyCustomersTiersValidateBeforeCall(@javax.annota /** * Import customers into loyalty tiers - * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -20990,16 +20991,16 @@ private okhttp3.Call importLoyaltyCustomersTiersValidateBeforeCall(@javax.annota 404 Not found - */ - public ModelImport importLoyaltyCustomersTiers(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importLoyaltyCustomersTiers(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importLoyaltyCustomersTiersWithHttpInfo(loyaltyProgramId, upFile); return localVarResp.getData(); } /** * Import customers into loyalty tiers - * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21012,7 +21013,7 @@ public ModelImport importLoyaltyCustomersTiers(@javax.annotation.Nonnull Long lo 404 Not found - */ - public ApiResponse importLoyaltyCustomersTiersWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importLoyaltyCustomersTiersWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importLoyaltyCustomersTiersValidateBeforeCall(loyaltyProgramId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -21020,9 +21021,9 @@ public ApiResponse importLoyaltyCustomersTiersWithHttpInfo(@javax.a /** * Import customers into loyalty tiers (asynchronously) - * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -21036,7 +21037,7 @@ public ApiResponse importLoyaltyCustomersTiersWithHttpInfo(@javax.a 404 Not found - */ - public okhttp3.Call importLoyaltyCustomersTiersAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importLoyaltyCustomersTiersAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importLoyaltyCustomersTiersValidateBeforeCall(loyaltyProgramId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -21047,7 +21048,7 @@ public okhttp3.Call importLoyaltyCustomersTiersAsync(@javax.annotation.Nonnull L * Build call for importLoyaltyPoints * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param notificationsEnabled Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21058,7 +21059,7 @@ public okhttp3.Call importLoyaltyCustomersTiersAsync(@javax.annotation.Nonnull L 200 OK - */ - public okhttp3.Call importLoyaltyPointsCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importLoyaltyPointsCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -21113,7 +21114,7 @@ public okhttp3.Call importLoyaltyPointsCall(@javax.annotation.Nonnull Long loyal } @SuppressWarnings("rawtypes") - private okhttp3.Call importLoyaltyPointsValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importLoyaltyPointsValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'loyaltyProgramId' is set if (loyaltyProgramId == null) { throw new ApiException("Missing the required parameter 'loyaltyProgramId' when calling importLoyaltyPoints(Async)"); @@ -21128,7 +21129,7 @@ private okhttp3.Call importLoyaltyPointsValidateBeforeCall(@javax.annotation.Non * Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. This parameter accepts one of the following values: - A timestamp string in RFC3339 format. - `immediate` - `on_action` **Note**: Empty or missing values default to `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. If passed, `validityDuration` should be omitted. - `validityDuration` (optional): The duration for which the points remain active, relative to the activation date. The time format is an **integer** followed by one letter indicating the time unit.<br /> Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. If passed, `expirydate` should be omitted. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] For existing customer profiles and loyalty cards, the imported > points are added to any previous active or pending points, depending on the > value provided for `startdate`. If `startdate` matches the current date, the > imported points are _active_. If it is later, the points are _pending_ until > the date provided for `startdate` is reached. > [!note] We recommend limiting your file size to 500 MB. ## Example for profile-based programs ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` ## Example for card-based programs ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param notificationsEnabled Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21138,7 +21139,7 @@ private okhttp3.Call importLoyaltyPointsValidateBeforeCall(@javax.annotation.Non 200 OK - */ - public ModelImport importLoyaltyPoints(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importLoyaltyPoints(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importLoyaltyPointsWithHttpInfo(loyaltyProgramId, notificationsEnabled, upFile); return localVarResp.getData(); } @@ -21148,7 +21149,7 @@ public ModelImport importLoyaltyPoints(@javax.annotation.Nonnull Long loyaltyPro * Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. This parameter accepts one of the following values: - A timestamp string in RFC3339 format. - `immediate` - `on_action` **Note**: Empty or missing values default to `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. If passed, `validityDuration` should be omitted. - `validityDuration` (optional): The duration for which the points remain active, relative to the activation date. The time format is an **integer** followed by one letter indicating the time unit.<br /> Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. If passed, `expirydate` should be omitted. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] For existing customer profiles and loyalty cards, the imported > points are added to any previous active or pending points, depending on the > value provided for `startdate`. If `startdate` matches the current date, the > imported points are _active_. If it is later, the points are _pending_ until > the date provided for `startdate` is reached. > [!note] We recommend limiting your file size to 500 MB. ## Example for profile-based programs ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` ## Example for card-based programs ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param notificationsEnabled Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21158,7 +21159,7 @@ public ModelImport importLoyaltyPoints(@javax.annotation.Nonnull Long loyaltyPro 200 OK - */ - public ApiResponse importLoyaltyPointsWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importLoyaltyPointsWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importLoyaltyPointsValidateBeforeCall(loyaltyProgramId, notificationsEnabled, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -21169,7 +21170,7 @@ public ApiResponse importLoyaltyPointsWithHttpInfo(@javax.annotatio * Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application until a session or profile update is received for that profile. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. This parameter accepts one of the following values: - A timestamp string in RFC3339 format. - `immediate` - `on_action` **Note**: Empty or missing values default to `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. If passed, `validityDuration` should be omitted. - `validityDuration` (optional): The duration for which the points remain active, relative to the activation date. The time format is an **integer** followed by one letter indicating the time unit.<br /> Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. If passed, `expirydate` should be omitted. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] For existing customer profiles and loyalty cards, the imported > points are added to any previous active or pending points, depending on the > value provided for `startdate`. If `startdate` matches the current date, the > imported points are _active_. If it is later, the points are _pending_ until > the date provided for `startdate` is reached. > [!note] We recommend limiting your file size to 500 MB. ## Example for profile-based programs ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` ## Example for card-based programs ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` * @param loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param notificationsEnabled Indicates whether the points import triggers notifications about its effects. For example, a notification is sent if the import upgrades a customer's tier or offsets their negative points balance. This parameter is optional and defaults to `true`. (optional) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -21180,7 +21181,7 @@ public ApiResponse importLoyaltyPointsWithHttpInfo(@javax.annotatio 200 OK - */ - public okhttp3.Call importLoyaltyPointsAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importLoyaltyPointsAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable Boolean notificationsEnabled, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importLoyaltyPointsValidateBeforeCall(loyaltyProgramId, notificationsEnabled, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -21190,7 +21191,7 @@ public okhttp3.Call importLoyaltyPointsAsync(@javax.annotation.Nonnull Long loya /** * Build call for importPoolGiveaways * @param poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21201,7 +21202,7 @@ public okhttp3.Call importLoyaltyPointsAsync(@javax.annotation.Nonnull Long loya 200 OK - */ - public okhttp3.Call importPoolGiveawaysCall(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importPoolGiveawaysCall(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -21252,7 +21253,7 @@ public okhttp3.Call importPoolGiveawaysCall(@javax.annotation.Nonnull Long poolI } @SuppressWarnings("rawtypes") - private okhttp3.Call importPoolGiveawaysValidateBeforeCall(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importPoolGiveawaysValidateBeforeCall(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'poolId' is set if (poolId == null) { throw new ApiException("Missing the required parameter 'poolId' when calling importPoolGiveaways(Async)"); @@ -21266,7 +21267,7 @@ private okhttp3.Call importPoolGiveawaysValidateBeforeCall(@javax.annotation.Non * Import giveaway codes into a giveaway pool * Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. > [!note] **Note** > - We recommend limiting your file size to 500MB. > - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. ## Example ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` * @param poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21276,7 +21277,7 @@ private okhttp3.Call importPoolGiveawaysValidateBeforeCall(@javax.annotation.Non 200 OK - */ - public ModelImport importPoolGiveaways(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importPoolGiveaways(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importPoolGiveawaysWithHttpInfo(poolId, upFile); return localVarResp.getData(); } @@ -21285,7 +21286,7 @@ public ModelImport importPoolGiveaways(@javax.annotation.Nonnull Long poolId, @j * Import giveaway codes into a giveaway pool * Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. > [!note] **Note** > - We recommend limiting your file size to 500MB. > - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. ## Example ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` * @param poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21295,7 +21296,7 @@ public ModelImport importPoolGiveaways(@javax.annotation.Nonnull Long poolId, @j 200 OK - */ - public ApiResponse importPoolGiveawaysWithHttpInfo(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importPoolGiveawaysWithHttpInfo(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importPoolGiveawaysValidateBeforeCall(poolId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -21305,7 +21306,7 @@ public ApiResponse importPoolGiveawaysWithHttpInfo(@javax.annotatio * Import giveaway codes into a giveaway pool (asynchronously) * Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. > [!note] **Note** > - We recommend limiting your file size to 500MB. > - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. ## Example ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` * @param poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -21316,7 +21317,7 @@ public ApiResponse importPoolGiveawaysWithHttpInfo(@javax.annotatio 200 OK - */ - public okhttp3.Call importPoolGiveawaysAsync(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importPoolGiveawaysAsync(@javax.annotation.Nonnull Long poolId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importPoolGiveawaysValidateBeforeCall(poolId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); @@ -21327,7 +21328,7 @@ public okhttp3.Call importPoolGiveawaysAsync(@javax.annotation.Nonnull Long pool * Build call for importReferrals * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21338,7 +21339,7 @@ public okhttp3.Call importPoolGiveawaysAsync(@javax.annotation.Nonnull Long pool 200 OK - */ - public okhttp3.Call importReferralsCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importReferralsCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -21390,7 +21391,7 @@ public okhttp3.Call importReferralsCall(@javax.annotation.Nonnull Long applicati } @SuppressWarnings("rawtypes") - private okhttp3.Call importReferralsValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importReferralsValidateBeforeCall(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { // verify the required parameter 'applicationId' is set if (applicationId == null) { throw new ApiException("Missing the required parameter 'applicationId' when calling importReferrals(Async)"); @@ -21410,7 +21411,7 @@ private okhttp3.Call importReferralsValidateBeforeCall(@javax.annotation.Nonnull * Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!important] When you import a CSV file with referrals, > a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) > is **not** automatically created for each `advocateprofileintegrationid` > column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) > endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) > endpoint to create the customer profiles. > [!note] We recommend limiting your file size to 500 MB. ## Example ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ModelImport * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21420,7 +21421,7 @@ private okhttp3.Call importReferralsValidateBeforeCall(@javax.annotation.Nonnull 200 OK - */ - public ModelImport importReferrals(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile) throws ApiException { + public ModelImport importReferrals(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile) throws ApiException { ApiResponse localVarResp = importReferralsWithHttpInfo(applicationId, campaignId, upFile); return localVarResp.getData(); } @@ -21430,7 +21431,7 @@ public ModelImport importReferrals(@javax.annotation.Nonnull Long applicationId, * Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!important] When you import a CSV file with referrals, > a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) > is **not** automatically created for each `advocateprofileintegrationid` > column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) > endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) > endpoint to create the customer profiles. > [!note] We recommend limiting your file size to 500 MB. ## Example ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @return ApiResponse<ModelImport> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -21440,7 +21441,7 @@ public ModelImport importReferrals(@javax.annotation.Nonnull Long applicationId, 200 OK - */ - public ApiResponse importReferralsWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile) throws ApiException { + public ApiResponse importReferralsWithHttpInfo(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile) throws ApiException { okhttp3.Call localVarCall = importReferralsValidateBeforeCall(applicationId, campaignId, upFile, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -21451,7 +21452,7 @@ public ApiResponse importReferralsWithHttpInfo(@javax.annotation.No * Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!important] When you import a CSV file with referrals, > a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) > is **not** automatically created for each `advocateprofileintegrationid` > column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) > endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) > endpoint to create the customer profiles. > [!note] We recommend limiting your file size to 500 MB. ## Example ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` * @param applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param upFile The file containing the data that is being imported. (optional) + * @param upFile The CSV file containing the data that is being imported. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -21462,7 +21463,7 @@ public ApiResponse importReferralsWithHttpInfo(@javax.annotation.No 200 OK - */ - public okhttp3.Call importReferralsAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable String upFile, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importReferralsAsync(@javax.annotation.Nonnull Long applicationId, @javax.annotation.Nonnull Long campaignId, @javax.annotation.Nullable File upFile, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importReferralsValidateBeforeCall(applicationId, campaignId, upFile, _callback); Type localVarReturnType = new TypeToken(){}.getType(); diff --git a/src/main/java/one/talon/model/APIError.java b/src/main/java/one/talon/model/APIError.java index d36af017..5a673f72 100644 --- a/src/main/java/one/talon/model/APIError.java +++ b/src/main/java/one/talon/model/APIError.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ErrorSource; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AcceptCouponEffectProps.java b/src/main/java/one/talon/model/AcceptCouponEffectProps.java index f84bd563..d4f666d9 100644 --- a/src/main/java/one/talon/model/AcceptCouponEffectProps.java +++ b/src/main/java/one/talon/model/AcceptCouponEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AcceptReferralEffectProps.java b/src/main/java/one/talon/model/AcceptReferralEffectProps.java index 74a280be..c20b0f12 100644 --- a/src/main/java/one/talon/model/AcceptReferralEffectProps.java +++ b/src/main/java/one/talon/model/AcceptReferralEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccessLogEntry.java b/src/main/java/one/talon/model/AccessLogEntry.java index fa56b97a..43cf1544 100644 --- a/src/main/java/one/talon/model/AccessLogEntry.java +++ b/src/main/java/one/talon/model/AccessLogEntry.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Account.java b/src/main/java/one/talon/model/Account.java index 5c015c2f..a5d721ff 100644 --- a/src/main/java/one/talon/model/Account.java +++ b/src/main/java/one/talon/model/Account.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -651,10 +650,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountAdditionalCost.java b/src/main/java/one/talon/model/AccountAdditionalCost.java index 21c77a2f..a2913228 100644 --- a/src/main/java/one/talon/model/AccountAdditionalCost.java +++ b/src/main/java/one/talon/model/AccountAdditionalCost.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -403,10 +402,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountAnalytics.java b/src/main/java/one/talon/model/AccountAnalytics.java index 310d796a..9a8bddbd 100644 --- a/src/main/java/one/talon/model/AccountAnalytics.java +++ b/src/main/java/one/talon/model/AccountAnalytics.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -651,10 +650,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountDashboardStatistic.java b/src/main/java/one/talon/model/AccountDashboardStatistic.java index 43ebe106..2d10f63f 100644 --- a/src/main/java/one/talon/model/AccountDashboardStatistic.java +++ b/src/main/java/one/talon/model/AccountDashboardStatistic.java @@ -28,7 +28,6 @@ import one.talon.model.AccountDashboardStatisticLoyaltyPoints; import one.talon.model.AccountDashboardStatisticReferrals; import one.talon.model.AccountDashboardStatisticRevenue; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -299,10 +298,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java b/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java index 10f39865..2e7dbcf2 100644 --- a/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java +++ b/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java b/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java index 0e392259..36e04c02 100644 --- a/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java +++ b/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java b/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java index 153111d9..b2298e45 100644 --- a/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java +++ b/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -184,10 +183,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java b/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java index 4e0c652c..44cf45fb 100644 --- a/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java +++ b/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -184,10 +183,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java b/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java index b87a909f..94389398 100644 --- a/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java +++ b/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountEntity.java b/src/main/java/one/talon/model/AccountEntity.java index a00cf2c3..31765ecf 100644 --- a/src/main/java/one/talon/model/AccountEntity.java +++ b/src/main/java/one/talon/model/AccountEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AccountLimits.java b/src/main/java/one/talon/model/AccountLimits.java index ecc58ecc..18433ba3 100644 --- a/src/main/java/one/talon/model/AccountLimits.java +++ b/src/main/java/one/talon/model/AccountLimits.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -504,10 +503,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Achievement.java b/src/main/java/one/talon/model/Achievement.java index 60e21d94..74267c7a 100644 --- a/src/main/java/one/talon/model/Achievement.java +++ b/src/main/java/one/talon/model/Achievement.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.TimePoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -768,10 +767,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementAdditionalProperties.java b/src/main/java/one/talon/model/AchievementAdditionalProperties.java index 1c779e93..76032717 100644 --- a/src/main/java/one/talon/model/AchievementAdditionalProperties.java +++ b/src/main/java/one/talon/model/AchievementAdditionalProperties.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -316,10 +315,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java b/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java index 814bd019..36755d07 100644 --- a/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java +++ b/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -290,10 +289,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementBase.java b/src/main/java/one/talon/model/AchievementBase.java index ad2b8522..0415f52a 100644 --- a/src/main/java/one/talon/model/AchievementBase.java +++ b/src/main/java/one/talon/model/AchievementBase.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.TimePoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -530,10 +529,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementBaseV2.java b/src/main/java/one/talon/model/AchievementBaseV2.java index 24db3858..d3d2ba93 100644 --- a/src/main/java/one/talon/model/AchievementBaseV2.java +++ b/src/main/java/one/talon/model/AchievementBaseV2.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -211,21 +210,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private Boolean allowRollbackAfterCompletion; - public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; - @SerializedName(SERIALIZED_NAME_SANDBOX) - @javax.annotation.Nullable - private Boolean sandbox; - public static final String SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS = "subscribedApplications"; @SerializedName(SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS) @javax.annotation.Nullable private List subscribedApplications; - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - @SerializedName(SERIALIZED_NAME_TIMEZONE) - @javax.annotation.Nullable - private String timezone; - public AchievementBaseV2() { } @@ -419,25 +408,6 @@ public void setAllowRollbackAfterCompletion(@javax.annotation.Nullable Boolean a } - public AchievementBaseV2 sandbox(@javax.annotation.Nullable Boolean sandbox) { - this.sandbox = sandbox; - return this; - } - - /** - * Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. - * @return sandbox - */ - @javax.annotation.Nullable - public Boolean getSandbox() { - return sandbox; - } - - public void setSandbox(@javax.annotation.Nullable Boolean sandbox) { - this.sandbox = sandbox; - } - - public AchievementBaseV2 subscribedApplications(@javax.annotation.Nullable List subscribedApplications) { this.subscribedApplications = subscribedApplications; return this; @@ -464,25 +434,6 @@ public void setSubscribedApplications(@javax.annotation.Nullable List subs this.subscribedApplications = subscribedApplications; } - - public AchievementBaseV2 timezone(@javax.annotation.Nullable String timezone) { - this.timezone = timezone; - return this; - } - - /** - * A string containing an IANA timezone descriptor. - * @return timezone - */ - @javax.annotation.Nullable - public String getTimezone() { - return timezone; - } - - public void setTimezone(@javax.annotation.Nullable String timezone) { - this.timezone = timezone; - } - /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -548,15 +499,13 @@ public boolean equals(Object o) { Objects.equals(this.fixedStartDate, achievementBaseV2.fixedStartDate) && Objects.equals(this.endDate, achievementBaseV2.endDate) && Objects.equals(this.allowRollbackAfterCompletion, achievementBaseV2.allowRollbackAfterCompletion) && - Objects.equals(this.sandbox, achievementBaseV2.sandbox) && - Objects.equals(this.subscribedApplications, achievementBaseV2.subscribedApplications) && - Objects.equals(this.timezone, achievementBaseV2.timezone)&& + Objects.equals(this.subscribedApplications, achievementBaseV2.subscribedApplications)&& Objects.equals(this.additionalProperties, achievementBaseV2.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, sandbox, subscribedApplications, timezone, additionalProperties); + return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, subscribedApplications, additionalProperties); } @Override @@ -573,9 +522,7 @@ public String toString() { sb.append(" fixedStartDate: ").append(toIndentedString(fixedStartDate)).append("\n"); sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); sb.append(" allowRollbackAfterCompletion: ").append(toIndentedString(allowRollbackAfterCompletion)).append("\n"); - sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); sb.append(" subscribedApplications: ").append(toIndentedString(subscribedApplications)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -586,10 +533,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -598,7 +542,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone")); + openapiFields = new HashSet(Arrays.asList("name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -647,9 +591,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("subscribedApplications") != null && !jsonObj.get("subscribedApplications").isJsonNull() && !jsonObj.get("subscribedApplications").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subscribedApplications` to be an array in the JSON string but got `%s`", jsonObj.get("subscribedApplications").toString())); } - if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) && !jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/AchievementProgress.java b/src/main/java/one/talon/model/AchievementProgress.java index fa1759c2..688e20ed 100644 --- a/src/main/java/one/talon/model/AchievementProgress.java +++ b/src/main/java/one/talon/model/AchievementProgress.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -318,10 +317,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementProgressWithDefinition.java b/src/main/java/one/talon/model/AchievementProgressWithDefinition.java index 4ae445ac..34ccd2df 100644 --- a/src/main/java/one/talon/model/AchievementProgressWithDefinition.java +++ b/src/main/java/one/talon/model/AchievementProgressWithDefinition.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -710,10 +709,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementReference.java b/src/main/java/one/talon/model/AchievementReference.java index 03a764d7..0f32075e 100644 --- a/src/main/java/one/talon/model/AchievementReference.java +++ b/src/main/java/one/talon/model/AchievementReference.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementStatusEntry.java b/src/main/java/one/talon/model/AchievementStatusEntry.java index 9ab3ada5..87dcb6fe 100644 --- a/src/main/java/one/talon/model/AchievementStatusEntry.java +++ b/src/main/java/one/talon/model/AchievementStatusEntry.java @@ -25,7 +25,6 @@ import java.util.Arrays; import one.talon.model.AchievementProgress; import one.talon.model.TimePoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -713,10 +712,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AchievementV2.java b/src/main/java/one/talon/model/AchievementV2.java index 31eba188..4ba56173 100644 --- a/src/main/java/one/talon/model/AchievementV2.java +++ b/src/main/java/one/talon/model/AchievementV2.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -221,21 +220,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private Boolean allowRollbackAfterCompletion; - public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; - @SerializedName(SERIALIZED_NAME_SANDBOX) - @javax.annotation.Nonnull - private Boolean sandbox; - public static final String SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS = "subscribedApplications"; @SerializedName(SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS) @javax.annotation.Nonnull private List subscribedApplications = new ArrayList<>(); - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - @SerializedName(SERIALIZED_NAME_TIMEZONE) - @javax.annotation.Nonnull - private String timezone; - public static final String SERIALIZED_NAME_USER_ID = "userId"; @SerializedName(SERIALIZED_NAME_USER_ID) @javax.annotation.Nonnull @@ -312,6 +301,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private StatusEnum status; + public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; + @SerializedName(SERIALIZED_NAME_SANDBOX) + @javax.annotation.Nonnull + private Boolean sandbox; + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + @SerializedName(SERIALIZED_NAME_TIMEZONE) + @javax.annotation.Nonnull + private String timezone; + public AchievementV2() { } @@ -543,25 +542,6 @@ public void setAllowRollbackAfterCompletion(@javax.annotation.Nullable Boolean a } - public AchievementV2 sandbox(@javax.annotation.Nonnull Boolean sandbox) { - this.sandbox = sandbox; - return this; - } - - /** - * Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. - * @return sandbox - */ - @javax.annotation.Nonnull - public Boolean getSandbox() { - return sandbox; - } - - public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { - this.sandbox = sandbox; - } - - public AchievementV2 subscribedApplications(@javax.annotation.Nonnull List subscribedApplications) { this.subscribedApplications = subscribedApplications; return this; @@ -589,25 +569,6 @@ public void setSubscribedApplications(@javax.annotation.Nonnull List subsc } - public AchievementV2 timezone(@javax.annotation.Nonnull String timezone) { - this.timezone = timezone; - return this; - } - - /** - * A string containing an IANA timezone descriptor. - * @return timezone - */ - @javax.annotation.Nonnull - public String getTimezone() { - return timezone; - } - - public void setTimezone(@javax.annotation.Nonnull String timezone) { - this.timezone = timezone; - } - - public AchievementV2 userId(@javax.annotation.Nonnull Long userId) { this.userId = userId; return this; @@ -683,6 +644,44 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) { this.status = status; } + + public AchievementV2 sandbox(@javax.annotation.Nonnull Boolean sandbox) { + this.sandbox = sandbox; + return this; + } + + /** + * Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. + * @return sandbox + */ + @javax.annotation.Nonnull + public Boolean getSandbox() { + return sandbox; + } + + public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { + this.sandbox = sandbox; + } + + + public AchievementV2 timezone(@javax.annotation.Nonnull String timezone) { + this.timezone = timezone; + return this; + } + + /** + * A string containing an IANA timezone descriptor. + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(@javax.annotation.Nonnull String timezone) { + this.timezone = timezone; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -750,19 +749,19 @@ public boolean equals(Object o) { Objects.equals(this.fixedStartDate, achievementV2.fixedStartDate) && Objects.equals(this.endDate, achievementV2.endDate) && Objects.equals(this.allowRollbackAfterCompletion, achievementV2.allowRollbackAfterCompletion) && - Objects.equals(this.sandbox, achievementV2.sandbox) && Objects.equals(this.subscribedApplications, achievementV2.subscribedApplications) && - Objects.equals(this.timezone, achievementV2.timezone) && Objects.equals(this.userId, achievementV2.userId) && Objects.equals(this.createdBy, achievementV2.createdBy) && Objects.equals(this.hasProgress, achievementV2.hasProgress) && - Objects.equals(this.status, achievementV2.status)&& + Objects.equals(this.status, achievementV2.status) && + Objects.equals(this.sandbox, achievementV2.sandbox) && + Objects.equals(this.timezone, achievementV2.timezone)&& Objects.equals(this.additionalProperties, achievementV2.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, created, name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, sandbox, subscribedApplications, timezone, userId, createdBy, hasProgress, status, additionalProperties); + return Objects.hash(id, created, name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, subscribedApplications, userId, createdBy, hasProgress, status, sandbox, timezone, additionalProperties); } @Override @@ -781,13 +780,13 @@ public String toString() { sb.append(" fixedStartDate: ").append(toIndentedString(fixedStartDate)).append("\n"); sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); sb.append(" allowRollbackAfterCompletion: ").append(toIndentedString(allowRollbackAfterCompletion)).append("\n"); - sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); sb.append(" subscribedApplications: ").append(toIndentedString(subscribedApplications)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); sb.append(" hasProgress: ").append(toIndentedString(hasProgress)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -798,10 +797,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -810,10 +806,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "created", "name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone", "userId", "createdBy", "hasProgress", "status")); + openapiFields = new HashSet(Arrays.asList("id", "created", "name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "userId", "createdBy", "hasProgress", "status", "sandbox", "timezone")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "name", "title", "description", "target", "recurrencePolicy", "activationPolicy", "sandbox", "subscribedApplications", "timezone", "userId")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "name", "title", "description", "target", "recurrencePolicy", "activationPolicy", "subscribedApplications", "userId", "sandbox", "timezone")); } /** @@ -864,9 +860,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else if (!jsonObj.get("subscribedApplications").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subscribedApplications` to be an array in the JSON string but got `%s`", jsonObj.get("subscribedApplications").toString())); } - if (!jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); - } if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) && !jsonObj.get("createdBy").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); } @@ -877,6 +870,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { StatusEnum.validateJsonElement(jsonObj.get("status")); } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/ActivateLoyaltyPoints.java b/src/main/java/one/talon/model/ActivateLoyaltyPoints.java index 138e2b5d..b31d43de 100644 --- a/src/main/java/one/talon/model/ActivateLoyaltyPoints.java +++ b/src/main/java/one/talon/model/ActivateLoyaltyPoints.java @@ -24,7 +24,6 @@ import java.util.LinkedHashSet; import java.util.Set; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ActivateLoyaltyPointsResponse.java b/src/main/java/one/talon/model/ActivateLoyaltyPointsResponse.java index 4393e29c..31807b00 100644 --- a/src/main/java/one/talon/model/ActivateLoyaltyPointsResponse.java +++ b/src/main/java/one/talon/model/ActivateLoyaltyPointsResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyLedgerEntry; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ActivateUserRequest.java b/src/main/java/one/talon/model/ActivateUserRequest.java index 5e00951a..5118cbe0 100644 --- a/src/main/java/one/talon/model/ActivateUserRequest.java +++ b/src/main/java/one/talon/model/ActivateUserRequest.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddFreeItemEffectProps.java b/src/main/java/one/talon/model/AddFreeItemEffectProps.java index 1d95fe11..1ced9c6f 100644 --- a/src/main/java/one/talon/model/AddFreeItemEffectProps.java +++ b/src/main/java/one/talon/model/AddFreeItemEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddItemCatalogAction.java b/src/main/java/one/talon/model/AddItemCatalogAction.java index 5750a6dc..396c9afb 100644 --- a/src/main/java/one/talon/model/AddItemCatalogAction.java +++ b/src/main/java/one/talon/model/AddItemCatalogAction.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.util.Arrays; import one.talon.model.Product; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddLoyaltyPoints.java b/src/main/java/one/talon/model/AddLoyaltyPoints.java index 7aea08a0..e1b69e3a 100644 --- a/src/main/java/one/talon/model/AddLoyaltyPoints.java +++ b/src/main/java/one/talon/model/AddLoyaltyPoints.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -342,10 +341,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddLoyaltyPointsEffectProps.java b/src/main/java/one/talon/model/AddLoyaltyPointsEffectProps.java index 7cdd783f..6432208f 100644 --- a/src/main/java/one/talon/model/AddLoyaltyPointsEffectProps.java +++ b/src/main/java/one/talon/model/AddLoyaltyPointsEffectProps.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -548,10 +547,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddPriceAdjustmentCatalogAction.java b/src/main/java/one/talon/model/AddPriceAdjustmentCatalogAction.java index 45317d6f..bd88c768 100644 --- a/src/main/java/one/talon/model/AddPriceAdjustmentCatalogAction.java +++ b/src/main/java/one/talon/model/AddPriceAdjustmentCatalogAction.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewPriceAdjustment; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddToAudienceEffectProps.java b/src/main/java/one/talon/model/AddToAudienceEffectProps.java index b9334404..75b8818c 100644 --- a/src/main/java/one/talon/model/AddToAudienceEffectProps.java +++ b/src/main/java/one/talon/model/AddToAudienceEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddedDeductedPointsBalancesAction.java b/src/main/java/one/talon/model/AddedDeductedPointsBalancesAction.java index ab27c7af..306e4d70 100644 --- a/src/main/java/one/talon/model/AddedDeductedPointsBalancesAction.java +++ b/src/main/java/one/talon/model/AddedDeductedPointsBalancesAction.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -341,10 +340,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotification.java b/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotification.java index 90cf1182..5e66e5b0 100644 --- a/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotification.java +++ b/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotification.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AddedDeductedPointsBalancesAction; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -507,10 +506,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotificationPolicy.java b/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotificationPolicy.java index 01eb271d..0478e17c 100644 --- a/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotificationPolicy.java +++ b/src/main/java/one/talon/model/AddedDeductedPointsBalancesNotificationPolicy.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -248,10 +247,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddedDeductedPointsNotification.java b/src/main/java/one/talon/model/AddedDeductedPointsNotification.java index e62b2836..56e3a12a 100644 --- a/src/main/java/one/talon/model/AddedDeductedPointsNotification.java +++ b/src/main/java/one/talon/model/AddedDeductedPointsNotification.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -656,10 +655,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AddedDeductedPointsNotificationPolicy.java b/src/main/java/one/talon/model/AddedDeductedPointsNotificationPolicy.java index 4d67cbda..7f087c3f 100644 --- a/src/main/java/one/talon/model/AddedDeductedPointsNotificationPolicy.java +++ b/src/main/java/one/talon/model/AddedDeductedPointsNotificationPolicy.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -248,10 +247,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AdditionalCampaignProperties.java b/src/main/java/one/talon/model/AdditionalCampaignProperties.java index 970c993c..d940dccb 100644 --- a/src/main/java/one/talon/model/AdditionalCampaignProperties.java +++ b/src/main/java/one/talon/model/AdditionalCampaignProperties.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignBudget; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -861,10 +860,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AdditionalCost.java b/src/main/java/one/talon/model/AdditionalCost.java index 77318f8c..4eedd157 100644 --- a/src/main/java/one/talon/model/AdditionalCost.java +++ b/src/main/java/one/talon/model/AdditionalCost.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AdjustmentDetails.java b/src/main/java/one/talon/model/AdjustmentDetails.java index 09e12230..181fb934 100644 --- a/src/main/java/one/talon/model/AdjustmentDetails.java +++ b/src/main/java/one/talon/model/AdjustmentDetails.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AnalyticsDataPoint.java b/src/main/java/one/talon/model/AnalyticsDataPoint.java index e99c1520..fa188c6c 100644 --- a/src/main/java/one/talon/model/AnalyticsDataPoint.java +++ b/src/main/java/one/talon/model/AnalyticsDataPoint.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AnalyticsDataPointWithTrend.java b/src/main/java/one/talon/model/AnalyticsDataPointWithTrend.java index 46ff7521..cd944807 100644 --- a/src/main/java/one/talon/model/AnalyticsDataPointWithTrend.java +++ b/src/main/java/one/talon/model/AnalyticsDataPointWithTrend.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndInfluencedRate.java b/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndInfluencedRate.java index 3739b624..c81fe759 100644 --- a/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndInfluencedRate.java +++ b/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndInfluencedRate.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndUplift.java b/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndUplift.java index 559ed368..2de0272b 100644 --- a/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndUplift.java +++ b/src/main/java/one/talon/model/AnalyticsDataPointWithTrendAndUplift.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AnalyticsProduct.java b/src/main/java/one/talon/model/AnalyticsProduct.java index 43db839f..94f6ea88 100644 --- a/src/main/java/one/talon/model/AnalyticsProduct.java +++ b/src/main/java/one/talon/model/AnalyticsProduct.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.AnalyticsDataPointWithTrend; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AnalyticsSKU.java b/src/main/java/one/talon/model/AnalyticsSKU.java index 4cb8b1c8..a5faa17d 100644 --- a/src/main/java/one/talon/model/AnalyticsSKU.java +++ b/src/main/java/one/talon/model/AnalyticsSKU.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.AnalyticsDataPointWithTrend; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -288,10 +287,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Application.java b/src/main/java/one/talon/model/Application.java index d91c3159..d77a9f23 100644 --- a/src/main/java/one/talon/model/Application.java +++ b/src/main/java/one/talon/model/Application.java @@ -27,7 +27,6 @@ import one.talon.model.AttributesSettings; import one.talon.model.LimitConfig; import one.talon.model.LoyaltyProgram; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -886,10 +885,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationAPIKey.java b/src/main/java/one/talon/model/ApplicationAPIKey.java index fc70484d..6601fd27 100644 --- a/src/main/java/one/talon/model/ApplicationAPIKey.java +++ b/src/main/java/one/talon/model/ApplicationAPIKey.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -509,10 +508,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationAnalyticsDataPoint.java b/src/main/java/one/talon/model/ApplicationAnalyticsDataPoint.java index ff9ad076..cb3672df 100644 --- a/src/main/java/one/talon/model/ApplicationAnalyticsDataPoint.java +++ b/src/main/java/one/talon/model/ApplicationAnalyticsDataPoint.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.AnalyticsDataPoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -341,10 +340,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationApiHealth.java b/src/main/java/one/talon/model/ApplicationApiHealth.java index 152b4994..d68e264e 100644 --- a/src/main/java/one/talon/model/ApplicationApiHealth.java +++ b/src/main/java/one/talon/model/ApplicationApiHealth.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -241,10 +240,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCIF.java b/src/main/java/one/talon/model/ApplicationCIF.java index 76ba37de..a6f7c84b 100644 --- a/src/main/java/one/talon/model/ApplicationCIF.java +++ b/src/main/java/one/talon/model/ApplicationCIF.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -365,10 +364,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCIFExpression.java b/src/main/java/one/talon/model/ApplicationCIFExpression.java index 9e502ec8..96f6ec56 100644 --- a/src/main/java/one/talon/model/ApplicationCIFExpression.java +++ b/src/main/java/one/talon/model/ApplicationCIFExpression.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -297,10 +296,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCIFReferences.java b/src/main/java/one/talon/model/ApplicationCIFReferences.java index 0bf443b9..f2a0fd8f 100644 --- a/src/main/java/one/talon/model/ApplicationCIFReferences.java +++ b/src/main/java/one/talon/model/ApplicationCIFReferences.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignDetail; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCampaignAnalytics.java b/src/main/java/one/talon/model/ApplicationCampaignAnalytics.java index 22f0881e..651d387a 100644 --- a/src/main/java/one/talon/model/ApplicationCampaignAnalytics.java +++ b/src/main/java/one/talon/model/ApplicationCampaignAnalytics.java @@ -27,7 +27,6 @@ import one.talon.model.AnalyticsDataPointWithTrend; import one.talon.model.AnalyticsDataPointWithTrendAndInfluencedRate; import one.talon.model.AnalyticsDataPointWithTrendAndUplift; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -516,10 +515,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCampaignStats.java b/src/main/java/one/talon/model/ApplicationCampaignStats.java index afc4b582..5a99a8a7 100644 --- a/src/main/java/one/talon/model/ApplicationCampaignStats.java +++ b/src/main/java/one/talon/model/ApplicationCampaignStats.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -286,10 +285,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCustomer.java b/src/main/java/one/talon/model/ApplicationCustomer.java index 27a40168..bf108298 100644 --- a/src/main/java/one/talon/model/ApplicationCustomer.java +++ b/src/main/java/one/talon/model/ApplicationCustomer.java @@ -29,7 +29,6 @@ import java.util.Map; import one.talon.model.AudienceMembership; import one.talon.model.LoyaltyMembership; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -474,10 +473,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationCustomerEntity.java b/src/main/java/one/talon/model/ApplicationCustomerEntity.java index 63f13a47..330e5771 100644 --- a/src/main/java/one/talon/model/ApplicationCustomerEntity.java +++ b/src/main/java/one/talon/model/ApplicationCustomerEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationEntity.java b/src/main/java/one/talon/model/ApplicationEntity.java index 133af337..3f72f275 100644 --- a/src/main/java/one/talon/model/ApplicationEntity.java +++ b/src/main/java/one/talon/model/ApplicationEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationEvent.java b/src/main/java/one/talon/model/ApplicationEvent.java index bf34b0cc..63b50b64 100644 --- a/src/main/java/one/talon/model/ApplicationEvent.java +++ b/src/main/java/one/talon/model/ApplicationEvent.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.Effect; import one.talon.model.RuleFailureReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -86,6 +85,11 @@ public class ApplicationEvent { @javax.annotation.Nullable private String storeIntegrationId; + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + @javax.annotation.Nullable + private String integrationId; + public static final String SERIALIZED_NAME_SESSION_ID = "sessionId"; @SerializedName(SERIALIZED_NAME_SESSION_ID) @javax.annotation.Nullable @@ -228,6 +232,25 @@ public void setStoreIntegrationId(@javax.annotation.Nullable String storeIntegra } + public ApplicationEvent integrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId + */ + @javax.annotation.Nullable + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; + } + + public ApplicationEvent sessionId(@javax.annotation.Nullable Long sessionId) { this.sessionId = sessionId; return this; @@ -253,7 +276,7 @@ public ApplicationEvent type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event. Must not be a reserved event name. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -399,6 +422,7 @@ public boolean equals(Object o) { Objects.equals(this.profileId, applicationEvent.profileId) && Objects.equals(this.storeId, applicationEvent.storeId) && Objects.equals(this.storeIntegrationId, applicationEvent.storeIntegrationId) && + Objects.equals(this.integrationId, applicationEvent.integrationId) && Objects.equals(this.sessionId, applicationEvent.sessionId) && Objects.equals(this.type, applicationEvent.type) && Objects.equals(this.attributes, applicationEvent.attributes) && @@ -409,7 +433,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, created, applicationId, profileId, storeId, storeIntegrationId, sessionId, type, attributes, effects, ruleFailureReasons, additionalProperties); + return Objects.hash(id, created, applicationId, profileId, storeId, storeIntegrationId, integrationId, sessionId, type, attributes, effects, ruleFailureReasons, additionalProperties); } @Override @@ -422,6 +446,7 @@ public String toString() { sb.append(" profileId: ").append(toIndentedString(profileId)).append("\n"); sb.append(" storeId: ").append(toIndentedString(storeId)).append("\n"); sb.append(" storeIntegrationId: ").append(toIndentedString(storeIntegrationId)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); @@ -437,10 +462,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -449,7 +471,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "created", "applicationId", "profileId", "storeId", "storeIntegrationId", "sessionId", "type", "attributes", "effects", "ruleFailureReasons")); + openapiFields = new HashSet(Arrays.asList("id", "created", "applicationId", "profileId", "storeId", "storeIntegrationId", "integrationId", "sessionId", "type", "attributes", "effects", "ruleFailureReasons")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "applicationId", "type", "attributes", "effects")); @@ -478,6 +500,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("storeIntegrationId") != null && !jsonObj.get("storeIntegrationId").isJsonNull()) && !jsonObj.get("storeIntegrationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `storeIntegrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeIntegrationId").toString())); } + if ((jsonObj.get("integrationId") != null && !jsonObj.get("integrationId").isJsonNull()) && !jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); + } if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } diff --git a/src/main/java/one/talon/model/ApplicationNotification.java b/src/main/java/one/talon/model/ApplicationNotification.java index 418913a0..61d478ab 100644 --- a/src/main/java/one/talon/model/ApplicationNotification.java +++ b/src/main/java/one/talon/model/ApplicationNotification.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationReferee.java b/src/main/java/one/talon/model/ApplicationReferee.java index 091f273d..aab27eab 100644 --- a/src/main/java/one/talon/model/ApplicationReferee.java +++ b/src/main/java/one/talon/model/ApplicationReferee.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -287,10 +286,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationSession.java b/src/main/java/one/talon/model/ApplicationSession.java index 9214147c..b84b0b8d 100644 --- a/src/main/java/one/talon/model/ApplicationSession.java +++ b/src/main/java/one/talon/model/ApplicationSession.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import one.talon.model.CartItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -599,10 +598,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationSessionEntity.java b/src/main/java/one/talon/model/ApplicationSessionEntity.java index bbe103f8..f130986c 100644 --- a/src/main/java/one/talon/model/ApplicationSessionEntity.java +++ b/src/main/java/one/talon/model/ApplicationSessionEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ApplicationStoreEntity.java b/src/main/java/one/talon/model/ApplicationStoreEntity.java index 045ccb33..3b7dd243 100644 --- a/src/main/java/one/talon/model/ApplicationStoreEntity.java +++ b/src/main/java/one/talon/model/ApplicationStoreEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AsyncCouponCreationResponse.java b/src/main/java/one/talon/model/AsyncCouponCreationResponse.java index 1336809c..715d4ac2 100644 --- a/src/main/java/one/talon/model/AsyncCouponCreationResponse.java +++ b/src/main/java/one/talon/model/AsyncCouponCreationResponse.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AsyncCouponDeletionJobResponse.java b/src/main/java/one/talon/model/AsyncCouponDeletionJobResponse.java index 8527e21d..6fb77c32 100644 --- a/src/main/java/one/talon/model/AsyncCouponDeletionJobResponse.java +++ b/src/main/java/one/talon/model/AsyncCouponDeletionJobResponse.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AsyncCouponsData.java b/src/main/java/one/talon/model/AsyncCouponsData.java index 83a0b7ac..79a01d9a 100644 --- a/src/main/java/one/talon/model/AsyncCouponsData.java +++ b/src/main/java/one/talon/model/AsyncCouponsData.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -310,10 +309,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Attribute.java b/src/main/java/one/talon/model/Attribute.java index 489ec534..7c4fff06 100644 --- a/src/main/java/one/talon/model/Attribute.java +++ b/src/main/java/one/talon/model/Attribute.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -795,10 +794,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AttributesMandatory.java b/src/main/java/one/talon/model/AttributesMandatory.java index 4ebf369d..9c09d1bc 100644 --- a/src/main/java/one/talon/model/AttributesMandatory.java +++ b/src/main/java/one/talon/model/AttributesMandatory.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -200,10 +199,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AttributesSettings.java b/src/main/java/one/talon/model/AttributesSettings.java index 8a62eb24..89138f3e 100644 --- a/src/main/java/one/talon/model/AttributesSettings.java +++ b/src/main/java/one/talon/model/AttributesSettings.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.AttributesMandatory; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Audience.java b/src/main/java/one/talon/model/Audience.java index 70b31e65..17265a23 100644 --- a/src/main/java/one/talon/model/Audience.java +++ b/src/main/java/one/talon/model/Audience.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -427,10 +426,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AudienceAnalytics.java b/src/main/java/one/talon/model/AudienceAnalytics.java index 22e66157..9cbd4427 100644 --- a/src/main/java/one/talon/model/AudienceAnalytics.java +++ b/src/main/java/one/talon/model/AudienceAnalytics.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AudienceCustomer.java b/src/main/java/one/talon/model/AudienceCustomer.java index 440ca709..9111135f 100644 --- a/src/main/java/one/talon/model/AudienceCustomer.java +++ b/src/main/java/one/talon/model/AudienceCustomer.java @@ -29,7 +29,6 @@ import java.util.Map; import one.talon.model.AudienceMembership; import one.talon.model.LoyaltyMembership; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -516,10 +515,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AudienceIntegrationID.java b/src/main/java/one/talon/model/AudienceIntegrationID.java index 511040c1..ea64f0f8 100644 --- a/src/main/java/one/talon/model/AudienceIntegrationID.java +++ b/src/main/java/one/talon/model/AudienceIntegrationID.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AudienceMembership.java b/src/main/java/one/talon/model/AudienceMembership.java index f39c26cc..03a2ee77 100644 --- a/src/main/java/one/talon/model/AudienceMembership.java +++ b/src/main/java/one/talon/model/AudienceMembership.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AudienceReference.java b/src/main/java/one/talon/model/AudienceReference.java index c2489fb2..5d97d694 100644 --- a/src/main/java/one/talon/model/AudienceReference.java +++ b/src/main/java/one/talon/model/AudienceReference.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/AwardGiveawayEffectProps.java b/src/main/java/one/talon/model/AwardGiveawayEffectProps.java index be216650..6985340f 100644 --- a/src/main/java/one/talon/model/AwardGiveawayEffectProps.java +++ b/src/main/java/one/talon/model/AwardGiveawayEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -260,10 +259,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseCampaign.java b/src/main/java/one/talon/model/BaseCampaign.java index 0f28228d..173a7895 100644 --- a/src/main/java/one/talon/model/BaseCampaign.java +++ b/src/main/java/one/talon/model/BaseCampaign.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -170,7 +169,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -783,10 +784,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseLoyaltyProgram.java b/src/main/java/one/talon/model/BaseLoyaltyProgram.java index e1fff9aa..009df2ca 100644 --- a/src/main/java/one/talon/model/BaseLoyaltyProgram.java +++ b/src/main/java/one/talon/model/BaseLoyaltyProgram.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CodeGeneratorSettings; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -749,10 +748,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseNotification.java b/src/main/java/one/talon/model/BaseNotification.java index 54155d34..0bb158e4 100644 --- a/src/main/java/one/talon/model/BaseNotification.java +++ b/src/main/java/one/talon/model/BaseNotification.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.BaseNotificationWebhook; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -338,10 +337,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseNotificationEntity.java b/src/main/java/one/talon/model/BaseNotificationEntity.java index 7a503c4d..54f33d57 100644 --- a/src/main/java/one/talon/model/BaseNotificationEntity.java +++ b/src/main/java/one/talon/model/BaseNotificationEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseNotificationWebhook.java b/src/main/java/one/talon/model/BaseNotificationWebhook.java index 64a8ad63..1a0c579d 100644 --- a/src/main/java/one/talon/model/BaseNotificationWebhook.java +++ b/src/main/java/one/talon/model/BaseNotificationWebhook.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -297,10 +296,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseNotifications.java b/src/main/java/one/talon/model/BaseNotifications.java index 7c62e7a5..1245c90a 100644 --- a/src/main/java/one/talon/model/BaseNotifications.java +++ b/src/main/java/one/talon/model/BaseNotifications.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.BaseNotification; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BaseSamlConnection.java b/src/main/java/one/talon/model/BaseSamlConnection.java index 008665f4..bdcc81ed 100644 --- a/src/main/java/one/talon/model/BaseSamlConnection.java +++ b/src/main/java/one/talon/model/BaseSamlConnection.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -338,10 +337,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BestPriorPrice.java b/src/main/java/one/talon/model/BestPriorPrice.java index 7ca27b16..023e3db5 100644 --- a/src/main/java/one/talon/model/BestPriorPrice.java +++ b/src/main/java/one/talon/model/BestPriorPrice.java @@ -22,9 +22,10 @@ import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import one.talon.model.BestPriorPriceMetadata; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -69,10 +70,15 @@ public class BestPriorPrice { @javax.annotation.Nonnull private OffsetDateTime observedAt; + public static final String SERIALIZED_NAME_CONTEXT_IDS = "contextIds"; + @SerializedName(SERIALIZED_NAME_CONTEXT_IDS) + @javax.annotation.Nonnull + private List contextIds = new ArrayList<>(); + public static final String SERIALIZED_NAME_CONTEXT_ID = "contextId"; @SerializedName(SERIALIZED_NAME_CONTEXT_ID) - @javax.annotation.Nonnull - private String contextId; + @javax.annotation.Nullable + private String contextId = ""; public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) @@ -149,21 +155,48 @@ public void setObservedAt(@javax.annotation.Nonnull OffsetDateTime observedAt) { } - public BestPriorPrice contextId(@javax.annotation.Nonnull String contextId) { + public BestPriorPrice contextIds(@javax.annotation.Nonnull List contextIds) { + this.contextIds = contextIds; + return this; + } + + public BestPriorPrice addContextIdsItem(String contextIdsItem) { + if (this.contextIds == null) { + this.contextIds = new ArrayList<>(); + } + this.contextIds.add(contextIdsItem); + return this; + } + + /** + * The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. + * @return contextIds + */ + @javax.annotation.Nonnull + public List getContextIds() { + return contextIds; + } + + public void setContextIds(@javax.annotation.Nonnull List contextIds) { + this.contextIds = contextIds; + } + + + public BestPriorPrice contextId(@javax.annotation.Nullable String contextId) { this.contextId = contextId; return this; } /** - * The context ID of the context active at the time of observation. + * This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. * @return contextId */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getContextId() { return contextId; } - public void setContextId(@javax.annotation.Nonnull String contextId) { + public void setContextId(@javax.annotation.Nullable String contextId) { this.contextId = contextId; } @@ -282,6 +315,7 @@ public boolean equals(Object o) { return Objects.equals(this.id, bestPriorPrice.id) && Objects.equals(this.sku, bestPriorPrice.sku) && Objects.equals(this.observedAt, bestPriorPrice.observedAt) && + Objects.equals(this.contextIds, bestPriorPrice.contextIds) && Objects.equals(this.contextId, bestPriorPrice.contextId) && Objects.equals(this.price, bestPriorPrice.price) && Objects.equals(this.metadata, bestPriorPrice.metadata) && @@ -291,7 +325,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, sku, observedAt, contextId, price, metadata, target, additionalProperties); + return Objects.hash(id, sku, observedAt, contextIds, contextId, price, metadata, target, additionalProperties); } @Override @@ -301,6 +335,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" sku: ").append(toIndentedString(sku)).append("\n"); sb.append(" observedAt: ").append(toIndentedString(observedAt)).append("\n"); + sb.append(" contextIds: ").append(toIndentedString(contextIds)).append("\n"); sb.append(" contextId: ").append(toIndentedString(contextId)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); @@ -315,10 +350,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -327,10 +359,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "sku", "observedAt", "contextId", "price", "metadata", "target")); + openapiFields = new HashSet(Arrays.asList("id", "sku", "observedAt", "contextIds", "contextId", "price", "metadata", "target")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "sku", "observedAt", "contextId", "price", "metadata", "target")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "sku", "observedAt", "contextIds", "price", "metadata", "target")); } /** @@ -356,7 +388,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("sku").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sku").toString())); } - if (!jsonObj.get("contextId").isJsonPrimitive()) { + // ensure the required json array is present + if (jsonObj.get("contextIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("contextIds").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `contextIds` to be an array in the JSON string but got `%s`", jsonObj.get("contextIds").toString())); + } + if ((jsonObj.get("contextId") != null && !jsonObj.get("contextId").isJsonNull()) && !jsonObj.get("contextId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `contextId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contextId").toString())); } // validate the required field `metadata` diff --git a/src/main/java/one/talon/model/BestPriorPriceMetadata.java b/src/main/java/one/talon/model/BestPriorPriceMetadata.java index 1e20caba..3147d026 100644 --- a/src/main/java/one/talon/model/BestPriorPriceMetadata.java +++ b/src/main/java/one/talon/model/BestPriorPriceMetadata.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.AdjustmentDetails; import one.talon.model.InfluencingCampaignDetails; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BestPriorPriceRequest.java b/src/main/java/one/talon/model/BestPriorPriceRequest.java index b929f955..5821ed6e 100644 --- a/src/main/java/one/talon/model/BestPriorPriceRequest.java +++ b/src/main/java/one/talon/model/BestPriorPriceRequest.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.BestPriorTarget; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -326,10 +325,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BestPriorTarget.java b/src/main/java/one/talon/model/BestPriorTarget.java index 6064ca56..1b0fccb0 100644 --- a/src/main/java/one/talon/model/BestPriorTarget.java +++ b/src/main/java/one/talon/model/BestPriorTarget.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Binding.java b/src/main/java/one/talon/model/Binding.java index a42ced89..2933b480 100644 --- a/src/main/java/one/talon/model/Binding.java +++ b/src/main/java/one/talon/model/Binding.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -349,10 +348,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Blueprint.java b/src/main/java/one/talon/model/Blueprint.java index ec5c013d..733eb945 100644 --- a/src/main/java/one/talon/model/Blueprint.java +++ b/src/main/java/one/talon/model/Blueprint.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CartItemFilterTemplate; import one.talon.model.CatalogRule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -597,10 +596,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BulkApplicationNotification.java b/src/main/java/one/talon/model/BulkApplicationNotification.java index ad727ffc..e237c17f 100644 --- a/src/main/java/one/talon/model/BulkApplicationNotification.java +++ b/src/main/java/one/talon/model/BulkApplicationNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationNotification; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/BulkOperationOnCampaigns.java b/src/main/java/one/talon/model/BulkOperationOnCampaigns.java index 3a0f39ca..df3f876e 100644 --- a/src/main/java/one/talon/model/BulkOperationOnCampaigns.java +++ b/src/main/java/one/talon/model/BulkOperationOnCampaigns.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -273,10 +272,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Campaign.java b/src/main/java/one/talon/model/Campaign.java index c6843344..26592a4f 100644 --- a/src/main/java/one/talon/model/Campaign.java +++ b/src/main/java/one/talon/model/Campaign.java @@ -28,7 +28,6 @@ import one.talon.model.CampaignBudget; import one.talon.model.CodeGeneratorSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,7 +191,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -1849,10 +1850,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignActivationRequest.java b/src/main/java/one/talon/model/CampaignActivationRequest.java index 58f31953..c36f30c1 100644 --- a/src/main/java/one/talon/model/CampaignActivationRequest.java +++ b/src/main/java/one/talon/model/CampaignActivationRequest.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignAnalytics.java b/src/main/java/one/talon/model/CampaignAnalytics.java index f23c05fd..d9f961ca 100644 --- a/src/main/java/one/talon/model/CampaignAnalytics.java +++ b/src/main/java/one/talon/model/CampaignAnalytics.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -782,10 +781,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignBudget.java b/src/main/java/one/talon/model/CampaignBudget.java index a6ad492e..402e56ce 100644 --- a/src/main/java/one/talon/model/CampaignBudget.java +++ b/src/main/java/one/talon/model/CampaignBudget.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -211,10 +210,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCollection.java b/src/main/java/one/talon/model/CampaignCollection.java index 1faf1c50..26566e31 100644 --- a/src/main/java/one/talon/model/CampaignCollection.java +++ b/src/main/java/one/talon/model/CampaignCollection.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -427,10 +426,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCollectionEditedNotification.java b/src/main/java/one/talon/model/CampaignCollectionEditedNotification.java index 3eaaa06b..b7f1b766 100644 --- a/src/main/java/one/talon/model/CampaignCollectionEditedNotification.java +++ b/src/main/java/one/talon/model/CampaignCollectionEditedNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignCollectionEditedNotificationItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCollectionEditedNotificationItem.java b/src/main/java/one/talon/model/CampaignCollectionEditedNotificationItem.java index 3407d142..4e027d8c 100644 --- a/src/main/java/one/talon/model/CampaignCollectionEditedNotificationItem.java +++ b/src/main/java/one/talon/model/CampaignCollectionEditedNotificationItem.java @@ -27,7 +27,6 @@ import one.talon.model.CollectionWithoutPayload; import one.talon.model.PlaceholderDetails; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -274,10 +273,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCollectionWithoutPayload.java b/src/main/java/one/talon/model/CampaignCollectionWithoutPayload.java index 9c3e6fe7..05866a0b 100644 --- a/src/main/java/one/talon/model/CampaignCollectionWithoutPayload.java +++ b/src/main/java/one/talon/model/CampaignCollectionWithoutPayload.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -391,10 +390,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCopy.java b/src/main/java/one/talon/model/CampaignCopy.java index 19980b3d..7772c244 100644 --- a/src/main/java/one/talon/model/CampaignCopy.java +++ b/src/main/java/one/talon/model/CampaignCopy.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -331,10 +330,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCreatedNotification.java b/src/main/java/one/talon/model/CampaignCreatedNotification.java index 5f349f9b..5e5e8a07 100644 --- a/src/main/java/one/talon/model/CampaignCreatedNotification.java +++ b/src/main/java/one/talon/model/CampaignCreatedNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignCreatedNotificationItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignCreatedNotificationItem.java b/src/main/java/one/talon/model/CampaignCreatedNotificationItem.java index 793b6e66..ec0b7144 100644 --- a/src/main/java/one/talon/model/CampaignCreatedNotificationItem.java +++ b/src/main/java/one/talon/model/CampaignCreatedNotificationItem.java @@ -27,7 +27,6 @@ import one.talon.model.CampaignEvaluationPosition; import one.talon.model.PlaceholderDetails; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -274,10 +273,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignDeactivationRequest.java b/src/main/java/one/talon/model/CampaignDeactivationRequest.java index cc41e648..e18133da 100644 --- a/src/main/java/one/talon/model/CampaignDeactivationRequest.java +++ b/src/main/java/one/talon/model/CampaignDeactivationRequest.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignDeletedNotification.java b/src/main/java/one/talon/model/CampaignDeletedNotification.java index 186b4ef7..82def811 100644 --- a/src/main/java/one/talon/model/CampaignDeletedNotification.java +++ b/src/main/java/one/talon/model/CampaignDeletedNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignDeletedNotificationItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignDeletedNotificationItem.java b/src/main/java/one/talon/model/CampaignDeletedNotificationItem.java index 9704997d..39c669e9 100644 --- a/src/main/java/one/talon/model/CampaignDeletedNotificationItem.java +++ b/src/main/java/one/talon/model/CampaignDeletedNotificationItem.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.Campaign; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignDetail.java b/src/main/java/one/talon/model/CampaignDetail.java index 93875ca8..7caee82f 100644 --- a/src/main/java/one/talon/model/CampaignDetail.java +++ b/src/main/java/one/talon/model/CampaignDetail.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEditedNotification.java b/src/main/java/one/talon/model/CampaignEditedNotification.java index 506de795..0ef41abe 100644 --- a/src/main/java/one/talon/model/CampaignEditedNotification.java +++ b/src/main/java/one/talon/model/CampaignEditedNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignEditedNotificationItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEditedNotificationItem.java b/src/main/java/one/talon/model/CampaignEditedNotificationItem.java index dc754e36..fe9592eb 100644 --- a/src/main/java/one/talon/model/CampaignEditedNotificationItem.java +++ b/src/main/java/one/talon/model/CampaignEditedNotificationItem.java @@ -26,7 +26,6 @@ import one.talon.model.Campaign; import one.talon.model.PlaceholderDetails; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -273,10 +272,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEligibility.java b/src/main/java/one/talon/model/CampaignEligibility.java index bbce466e..b87d9568 100644 --- a/src/main/java/one/talon/model/CampaignEligibility.java +++ b/src/main/java/one/talon/model/CampaignEligibility.java @@ -25,8 +25,7 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignEligibilityDetails; -import one.talon.model.RuleMetadata; -import com.google.gson.JsonElement; +import one.talon.model.RuleMetadataEligibility; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,16 +55,16 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") public class CampaignEligibility { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private Long id; - public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; @SerializedName(SERIALIZED_NAME_APPLICATION_ID) @javax.annotation.Nonnull private Long applicationId; + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @javax.annotation.Nonnull @@ -216,54 +215,54 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private List features = new ArrayList<>(); - public static final String SERIALIZED_NAME_RULES = "rules"; - @SerializedName(SERIALIZED_NAME_RULES) - @javax.annotation.Nullable - private List rules; - public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; @SerializedName(SERIALIZED_NAME_ELIGIBILITY) @javax.annotation.Nonnull private List eligibility = new ArrayList<>(); + public static final String SERIALIZED_NAME_RULES = "rules"; + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nonnull + private List rules = new ArrayList<>(); + public CampaignEligibility() { } - public CampaignEligibility id(@javax.annotation.Nonnull Long id) { - this.id = id; + public CampaignEligibility applicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; return this; } /** - * Unique ID of Campaign. - * @return id + * The ID of the Application that owns this entity. + * @return applicationId */ @javax.annotation.Nonnull - public Long getId() { - return id; + public Long getApplicationId() { + return applicationId; } - public void setId(@javax.annotation.Nonnull Long id) { - this.id = id; + public void setApplicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; } - public CampaignEligibility applicationId(@javax.annotation.Nonnull Long applicationId) { - this.applicationId = applicationId; + public CampaignEligibility id(@javax.annotation.Nonnull Long id) { + this.id = id; return this; } /** - * The ID of the Application that owns this entity. - * @return applicationId + * Unique ID of Campaign. + * @return id */ @javax.annotation.Nonnull - public Long getApplicationId() { - return applicationId; + public Long getId() { + return id; } - public void setApplicationId(@javax.annotation.Nonnull Long applicationId) { - this.applicationId = applicationId; + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; } @@ -435,57 +434,57 @@ public void setFeatures(@javax.annotation.Nonnull List features) { } - public CampaignEligibility rules(@javax.annotation.Nullable List rules) { - this.rules = rules; + public CampaignEligibility eligibility(@javax.annotation.Nonnull List eligibility) { + this.eligibility = eligibility; return this; } - public CampaignEligibility addRulesItem(RuleMetadata rulesItem) { - if (this.rules == null) { - this.rules = new ArrayList<>(); + public CampaignEligibility addEligibilityItem(CampaignEligibilityDetails eligibilityItem) { + if (this.eligibility == null) { + this.eligibility = new ArrayList<>(); } - this.rules.add(rulesItem); + this.eligibility.add(eligibilityItem); return this; } /** - * A list of rules containing customer-facing details of the rewards defined in the campaign. - * @return rules + * The customer's eligibility for each campaign in the current customer session. + * @return eligibility */ - @javax.annotation.Nullable - public List getRules() { - return rules; + @javax.annotation.Nonnull + public List getEligibility() { + return eligibility; } - public void setRules(@javax.annotation.Nullable List rules) { - this.rules = rules; + public void setEligibility(@javax.annotation.Nonnull List eligibility) { + this.eligibility = eligibility; } - public CampaignEligibility eligibility(@javax.annotation.Nonnull List eligibility) { - this.eligibility = eligibility; + public CampaignEligibility rules(@javax.annotation.Nonnull List rules) { + this.rules = rules; return this; } - public CampaignEligibility addEligibilityItem(CampaignEligibilityDetails eligibilityItem) { - if (this.eligibility == null) { - this.eligibility = new ArrayList<>(); + public CampaignEligibility addRulesItem(RuleMetadataEligibility rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); } - this.eligibility.add(eligibilityItem); + this.rules.add(rulesItem); return this; } /** - * The customer's eligibility for each campaign in the current customer session. - * @return eligibility + * A list of rules containing customer-facing details of the rewards defined in the campaign. + * @return rules */ @javax.annotation.Nonnull - public List getEligibility() { - return eligibility; + public List getRules() { + return rules; } - public void setEligibility(@javax.annotation.Nonnull List eligibility) { - this.eligibility = eligibility; + public void setRules(@javax.annotation.Nonnull List rules) { + this.rules = rules; } /** @@ -543,8 +542,8 @@ public boolean equals(Object o) { return false; } CampaignEligibility campaignEligibility = (CampaignEligibility) o; - return Objects.equals(this.id, campaignEligibility.id) && - Objects.equals(this.applicationId, campaignEligibility.applicationId) && + return Objects.equals(this.applicationId, campaignEligibility.applicationId) && + Objects.equals(this.id, campaignEligibility.id) && Objects.equals(this.name, campaignEligibility.name) && Objects.equals(this.description, campaignEligibility.description) && Objects.equals(this.startTime, campaignEligibility.startTime) && @@ -553,22 +552,22 @@ public boolean equals(Object o) { Objects.equals(this.state, campaignEligibility.state) && Objects.equals(this.tags, campaignEligibility.tags) && Objects.equals(this.features, campaignEligibility.features) && - Objects.equals(this.rules, campaignEligibility.rules) && - Objects.equals(this.eligibility, campaignEligibility.eligibility)&& + Objects.equals(this.eligibility, campaignEligibility.eligibility) && + Objects.equals(this.rules, campaignEligibility.rules)&& Objects.equals(this.additionalProperties, campaignEligibility.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, applicationId, name, description, startTime, endTime, attributes, state, tags, features, rules, eligibility, additionalProperties); + return Objects.hash(applicationId, id, name, description, startTime, endTime, attributes, state, tags, features, eligibility, rules, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CampaignEligibility {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); @@ -577,8 +576,8 @@ public String toString() { sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" features: ").append(toIndentedString(features)).append("\n"); - sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); sb.append(" eligibility: ").append(toIndentedString(eligibility)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -589,10 +588,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -601,10 +597,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "applicationId", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "rules", "eligibility")); + openapiFields = new HashSet(Arrays.asList("applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "eligibility", "rules")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "applicationId", "name", "state", "tags", "features", "eligibility")); + openapiRequiredFields = new HashSet(Arrays.asList("applicationId", "id", "name", "state", "tags", "features", "eligibility", "rules")); } /** @@ -650,20 +646,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else if (!jsonObj.get("features").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); } - if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { - JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); - if (jsonArrayrules != null) { - // ensure the json data is an array - if (!jsonObj.get("rules").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); - } - - // validate the optional field `rules` (array) - for (int i = 0; i < jsonArrayrules.size(); i++) { - RuleMetadata.validateJsonElement(jsonArrayrules.get(i)); - }; - } - } if (jsonObj.get("eligibility") != null) { if (!jsonObj.get("eligibility").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `eligibility` to be an array in the JSON string but got `%s`", jsonObj.get("eligibility").toString())); @@ -674,6 +656,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CampaignEligibilityDetails.validateJsonElement(jsonArrayeligibility.get(i)); } } + if (jsonObj.get("rules") != null) { + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); + } + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); + // validate the required field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + RuleMetadataEligibility.validateJsonElement(jsonArrayrules.get(i)); + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/CampaignEligibilityDetails.java b/src/main/java/one/talon/model/CampaignEligibilityDetails.java index 3a910df8..d4cf586d 100644 --- a/src/main/java/one/talon/model/CampaignEligibilityDetails.java +++ b/src/main/java/one/talon/model/CampaignEligibilityDetails.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CampaignEligibilityFailureDetails; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEligibilityFailureDetails.java b/src/main/java/one/talon/model/CampaignEligibilityFailureDetails.java index 2abbbae3..81033940 100644 --- a/src/main/java/one/talon/model/CampaignEligibilityFailureDetails.java +++ b/src/main/java/one/talon/model/CampaignEligibilityFailureDetails.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEntity.java b/src/main/java/one/talon/model/CampaignEntity.java index 2965a255..ee7e0d93 100644 --- a/src/main/java/one/talon/model/CampaignEntity.java +++ b/src/main/java/one/talon/model/CampaignEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEvaluationGroup.java b/src/main/java/one/talon/model/CampaignEvaluationGroup.java index 235537bb..5e3533bf 100644 --- a/src/main/java/one/talon/model/CampaignEvaluationGroup.java +++ b/src/main/java/one/talon/model/CampaignEvaluationGroup.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -447,10 +446,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEvaluationPosition.java b/src/main/java/one/talon/model/CampaignEvaluationPosition.java index a0aa67bd..1248e76c 100644 --- a/src/main/java/one/talon/model/CampaignEvaluationPosition.java +++ b/src/main/java/one/talon/model/CampaignEvaluationPosition.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEvaluationTreeChangedMessage.java b/src/main/java/one/talon/model/CampaignEvaluationTreeChangedMessage.java index 8fcf416a..a393e26f 100644 --- a/src/main/java/one/talon/model/CampaignEvaluationTreeChangedMessage.java +++ b/src/main/java/one/talon/model/CampaignEvaluationTreeChangedMessage.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationNotification; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignEvaluationTreeChangedNotification.java b/src/main/java/one/talon/model/CampaignEvaluationTreeChangedNotification.java index 877830bd..328be46c 100644 --- a/src/main/java/one/talon/model/CampaignEvaluationTreeChangedNotification.java +++ b/src/main/java/one/talon/model/CampaignEvaluationTreeChangedNotification.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CampaignSet; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignGroup.java b/src/main/java/one/talon/model/CampaignGroup.java index 3df8cf64..c4bb36bd 100644 --- a/src/main/java/one/talon/model/CampaignGroup.java +++ b/src/main/java/one/talon/model/CampaignGroup.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -357,10 +356,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignGroupEntity.java b/src/main/java/one/talon/model/CampaignGroupEntity.java index 56b96c6b..f12db572 100644 --- a/src/main/java/one/talon/model/CampaignGroupEntity.java +++ b/src/main/java/one/talon/model/CampaignGroupEntity.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignLogSummary.java b/src/main/java/one/talon/model/CampaignLogSummary.java index 23b529e6..e0fcd4d7 100644 --- a/src/main/java/one/talon/model/CampaignLogSummary.java +++ b/src/main/java/one/talon/model/CampaignLogSummary.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -315,10 +314,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignNotificationBase.java b/src/main/java/one/talon/model/CampaignNotificationBase.java index a64c3f16..16ce8013 100644 --- a/src/main/java/one/talon/model/CampaignNotificationBase.java +++ b/src/main/java/one/talon/model/CampaignNotificationBase.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -232,10 +231,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignNotificationGeneric.java b/src/main/java/one/talon/model/CampaignNotificationGeneric.java index 3931a76b..6ea00ca3 100644 --- a/src/main/java/one/talon/model/CampaignNotificationGeneric.java +++ b/src/main/java/one/talon/model/CampaignNotificationGeneric.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -268,10 +267,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignNotificationItemBase.java b/src/main/java/one/talon/model/CampaignNotificationItemBase.java index b9f65be0..5a65e817 100644 --- a/src/main/java/one/talon/model/CampaignNotificationItemBase.java +++ b/src/main/java/one/talon/model/CampaignNotificationItemBase.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignNotificationPolicy.java b/src/main/java/one/talon/model/CampaignNotificationPolicy.java index 705c32e1..0c042e94 100644 --- a/src/main/java/one/talon/model/CampaignNotificationPolicy.java +++ b/src/main/java/one/talon/model/CampaignNotificationPolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignRulesetChangedNotification.java b/src/main/java/one/talon/model/CampaignRulesetChangedNotification.java index d438f7c1..34a3d05e 100644 --- a/src/main/java/one/talon/model/CampaignRulesetChangedNotification.java +++ b/src/main/java/one/talon/model/CampaignRulesetChangedNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignRulesetChangedNotificationItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignRulesetChangedNotificationItem.java b/src/main/java/one/talon/model/CampaignRulesetChangedNotificationItem.java index 125f2408..76193cba 100644 --- a/src/main/java/one/talon/model/CampaignRulesetChangedNotificationItem.java +++ b/src/main/java/one/talon/model/CampaignRulesetChangedNotificationItem.java @@ -26,7 +26,6 @@ import one.talon.model.Campaign; import one.talon.model.PlaceholderDetails; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -307,10 +306,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignSearch.java b/src/main/java/one/talon/model/CampaignSearch.java index 7a56ac15..67e79ddc 100644 --- a/src/main/java/one/talon/model/CampaignSearch.java +++ b/src/main/java/one/talon/model/CampaignSearch.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignSet.java b/src/main/java/one/talon/model/CampaignSet.java index 8e35382f..f77e8656 100644 --- a/src/main/java/one/talon/model/CampaignSet.java +++ b/src/main/java/one/talon/model/CampaignSet.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CampaignSetBranchNode; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignSetBranchNode.java b/src/main/java/one/talon/model/CampaignSetBranchNode.java index 63225a3a..8de46a95 100644 --- a/src/main/java/one/talon/model/CampaignSetBranchNode.java +++ b/src/main/java/one/talon/model/CampaignSetBranchNode.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignSetNode; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -585,10 +584,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignSetLeafNode.java b/src/main/java/one/talon/model/CampaignSetLeafNode.java index 76ca9ea7..03c5bc93 100644 --- a/src/main/java/one/talon/model/CampaignSetLeafNode.java +++ b/src/main/java/one/talon/model/CampaignSetLeafNode.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -232,10 +231,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignSetNode.java b/src/main/java/one/talon/model/CampaignSetNode.java index 3a348f32..69c4d0d5 100644 --- a/src/main/java/one/talon/model/CampaignSetNode.java +++ b/src/main/java/one/talon/model/CampaignSetNode.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignStateChangedNotification.java b/src/main/java/one/talon/model/CampaignStateChangedNotification.java index 41ab3b10..f7e349c9 100644 --- a/src/main/java/one/talon/model/CampaignStateChangedNotification.java +++ b/src/main/java/one/talon/model/CampaignStateChangedNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignStateChangedNotificationItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignStateChangedNotificationItem.java b/src/main/java/one/talon/model/CampaignStateChangedNotificationItem.java index f28b4cd5..cafdd685 100644 --- a/src/main/java/one/talon/model/CampaignStateChangedNotificationItem.java +++ b/src/main/java/one/talon/model/CampaignStateChangedNotificationItem.java @@ -26,7 +26,6 @@ import one.talon.model.Campaign; import one.talon.model.PlaceholderDetails; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -299,10 +298,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignStoreBudget.java b/src/main/java/one/talon/model/CampaignStoreBudget.java index 4830f340..2edf1d41 100644 --- a/src/main/java/one/talon/model/CampaignStoreBudget.java +++ b/src/main/java/one/talon/model/CampaignStoreBudget.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignStoreBudgetLimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -272,10 +271,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignStoreBudgetLimitConfig.java b/src/main/java/one/talon/model/CampaignStoreBudgetLimitConfig.java index 611f5957..af822e7c 100644 --- a/src/main/java/one/talon/model/CampaignStoreBudgetLimitConfig.java +++ b/src/main/java/one/talon/model/CampaignStoreBudgetLimitConfig.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -388,10 +387,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignTemplate.java b/src/main/java/one/talon/model/CampaignTemplate.java index 1cd0c3bc..5397ea1c 100644 --- a/src/main/java/one/talon/model/CampaignTemplate.java +++ b/src/main/java/one/talon/model/CampaignTemplate.java @@ -29,7 +29,6 @@ import one.talon.model.CampaignTemplateParams; import one.talon.model.CodeGeneratorSettings; import one.talon.model.TemplateLimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,7 +192,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -1088,10 +1089,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignTemplateCollection.java b/src/main/java/one/talon/model/CampaignTemplateCollection.java index 53488355..872fa4c7 100644 --- a/src/main/java/one/talon/model/CampaignTemplateCollection.java +++ b/src/main/java/one/talon/model/CampaignTemplateCollection.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignTemplateCouponReservationSettings.java b/src/main/java/one/talon/model/CampaignTemplateCouponReservationSettings.java index c717f25b..e64eb74e 100644 --- a/src/main/java/one/talon/model/CampaignTemplateCouponReservationSettings.java +++ b/src/main/java/one/talon/model/CampaignTemplateCouponReservationSettings.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -184,10 +183,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignTemplateParams.java b/src/main/java/one/talon/model/CampaignTemplateParams.java index d19e1e38..17887f1d 100644 --- a/src/main/java/one/talon/model/CampaignTemplateParams.java +++ b/src/main/java/one/talon/model/CampaignTemplateParams.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -296,10 +295,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CampaignVersions.java b/src/main/java/one/talon/model/CampaignVersions.java index 4c302d77..3fb34676 100644 --- a/src/main/java/one/talon/model/CampaignVersions.java +++ b/src/main/java/one/talon/model/CampaignVersions.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -364,10 +363,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotification.java b/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotification.java index 81482f95..9bacce5c 100644 --- a/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotification.java +++ b/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotification.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AddedDeductedPointsBalancesAction; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -567,10 +566,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotificationPolicy.java b/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotificationPolicy.java index 475915e5..ce3e1aee 100644 --- a/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotificationPolicy.java +++ b/src/main/java/one/talon/model/CardAddedDeductedPointsBalancesNotificationPolicy.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -248,10 +247,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardAddedDeductedPointsNotification.java b/src/main/java/one/talon/model/CardAddedDeductedPointsNotification.java index b126b525..e14ce96d 100644 --- a/src/main/java/one/talon/model/CardAddedDeductedPointsNotification.java +++ b/src/main/java/one/talon/model/CardAddedDeductedPointsNotification.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -718,10 +717,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardAddedDeductedPointsNotificationPolicy.java b/src/main/java/one/talon/model/CardAddedDeductedPointsNotificationPolicy.java index f0e201b5..48694e38 100644 --- a/src/main/java/one/talon/model/CardAddedDeductedPointsNotificationPolicy.java +++ b/src/main/java/one/talon/model/CardAddedDeductedPointsNotificationPolicy.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -248,10 +247,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardExpiringPointsNotificationPolicy.java b/src/main/java/one/talon/model/CardExpiringPointsNotificationPolicy.java index 6a8a1339..e9c56f1d 100644 --- a/src/main/java/one/talon/model/CardExpiringPointsNotificationPolicy.java +++ b/src/main/java/one/talon/model/CardExpiringPointsNotificationPolicy.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CardExpiringPointsNotificationTrigger; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardExpiringPointsNotificationTrigger.java b/src/main/java/one/talon/model/CardExpiringPointsNotificationTrigger.java index c34769d4..eb52fd3b 100644 --- a/src/main/java/one/talon/model/CardExpiringPointsNotificationTrigger.java +++ b/src/main/java/one/talon/model/CardExpiringPointsNotificationTrigger.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardLedgerPointsEntryIntegrationAPI.java b/src/main/java/one/talon/model/CardLedgerPointsEntryIntegrationAPI.java index 2f4d2901..6785040c 100644 --- a/src/main/java/one/talon/model/CardLedgerPointsEntryIntegrationAPI.java +++ b/src/main/java/one/talon/model/CardLedgerPointsEntryIntegrationAPI.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -444,10 +443,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardLedgerTransactionLogEntry.java b/src/main/java/one/talon/model/CardLedgerTransactionLogEntry.java index 73578d35..8a804c0b 100644 --- a/src/main/java/one/talon/model/CardLedgerTransactionLogEntry.java +++ b/src/main/java/one/talon/model/CardLedgerTransactionLogEntry.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -548,10 +547,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CardLedgerTransactionLogEntryIntegrationAPI.java b/src/main/java/one/talon/model/CardLedgerTransactionLogEntryIntegrationAPI.java index ab9eb669..45d60cff 100644 --- a/src/main/java/one/talon/model/CardLedgerTransactionLogEntryIntegrationAPI.java +++ b/src/main/java/one/talon/model/CardLedgerTransactionLogEntryIntegrationAPI.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -574,10 +573,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CartItem.java b/src/main/java/one/talon/model/CartItem.java index c4a12fb8..acd59370 100644 --- a/src/main/java/one/talon/model/CartItem.java +++ b/src/main/java/one/talon/model/CartItem.java @@ -29,7 +29,6 @@ import one.talon.model.AdditionalCost; import one.talon.model.PriceDetail; import one.talon.model.Product; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -644,10 +643,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CartItemFilterTemplate.java b/src/main/java/one/talon/model/CartItemFilterTemplate.java index 2697b137..27c43872 100644 --- a/src/main/java/one/talon/model/CartItemFilterTemplate.java +++ b/src/main/java/one/talon/model/CartItemFilterTemplate.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Catalog.java b/src/main/java/one/talon/model/Catalog.java index adaa9a95..847cf35a 100644 --- a/src/main/java/one/talon/model/Catalog.java +++ b/src/main/java/one/talon/model/Catalog.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -375,10 +374,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CatalogAction.java b/src/main/java/one/talon/model/CatalogAction.java new file mode 100644 index 00000000..099fdcda --- /dev/null +++ b/src/main/java/one/talon/model/CatalogAction.java @@ -0,0 +1,378 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * Definition of all the properties that are needed for a single catalog sync action. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class CatalogAction { + /** + * The type of sync action. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ADD("ADD"), + + PATCH("PATCH"), + + PATCH_MANY("PATCH_MANY"), + + REMOVE("REMOVE"), + + REMOVE_MANY("REMOVE_MANY"), + + ADD_PRICE_ADJUSTMENT("ADD_PRICE_ADJUSTMENT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + @javax.annotation.Nonnull + private Object payload; + + public CatalogAction() { + } + + public CatalogAction type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of sync action. + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public CatalogAction payload(@javax.annotation.Nonnull Object payload) { + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + */ + @javax.annotation.Nonnull + public Object getPayload() { + return payload; + } + + public void setPayload(@javax.annotation.Nonnull Object payload) { + this.payload = payload; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CatalogAction instance itself + */ + public CatalogAction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogAction catalogAction = (CatalogAction) o; + return Objects.equals(this.type, catalogAction.type) && + Objects.equals(this.payload, catalogAction.payload)&& + Objects.equals(this.additionalProperties, catalogAction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, payload, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogAction {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "payload")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "payload")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogAction + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogAction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in CatalogAction is not found in the empty JSON string", CatalogAction.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogAction.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogAction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogAction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogAction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogAction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CatalogAction read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CatalogAction instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogAction given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogAction + * @throws IOException if the JSON string is invalid with respect to CatalogAction + */ + public static CatalogAction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogAction.class); + } + + /** + * Convert an instance of CatalogAction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/CatalogActionFilter.java b/src/main/java/one/talon/model/CatalogActionFilter.java index 01a526b0..25858932 100644 --- a/src/main/java/one/talon/model/CatalogActionFilter.java +++ b/src/main/java/one/talon/model/CatalogActionFilter.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -268,10 +267,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CatalogItem.java b/src/main/java/one/talon/model/CatalogItem.java index ca3dc773..d2aa822e 100644 --- a/src/main/java/one/talon/model/CatalogItem.java +++ b/src/main/java/one/talon/model/CatalogItem.java @@ -27,7 +27,6 @@ import java.util.List; import one.talon.model.ItemAttribute; import one.talon.model.Product; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -353,10 +352,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CatalogRule.java b/src/main/java/one/talon/model/CatalogRule.java index 5a357b7e..55632784 100644 --- a/src/main/java/one/talon/model/CatalogRule.java +++ b/src/main/java/one/talon/model/CatalogRule.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Binding; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CatalogSyncRequest.java b/src/main/java/one/talon/model/CatalogSyncRequest.java index 371293b2..87fe5c2c 100644 --- a/src/main/java/one/talon/model/CatalogSyncRequest.java +++ b/src/main/java/one/talon/model/CatalogSyncRequest.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; +import one.talon.model.CatalogAction; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,7 +56,7 @@ public class CatalogSyncRequest { public static final String SERIALIZED_NAME_ACTIONS = "actions"; @SerializedName(SERIALIZED_NAME_ACTIONS) @javax.annotation.Nonnull - private List actions = new ArrayList<>(); + private List actions = new ArrayList<>(); public static final String SERIALIZED_NAME_VERSION = "version"; @SerializedName(SERIALIZED_NAME_VERSION) @@ -66,12 +66,12 @@ public class CatalogSyncRequest { public CatalogSyncRequest() { } - public CatalogSyncRequest actions(@javax.annotation.Nonnull List actions) { + public CatalogSyncRequest actions(@javax.annotation.Nonnull List actions) { this.actions = actions; return this; } - public CatalogSyncRequest addActionsItem(Object actionsItem) { + public CatalogSyncRequest addActionsItem(CatalogAction actionsItem) { if (this.actions == null) { this.actions = new ArrayList<>(); } @@ -84,11 +84,11 @@ public CatalogSyncRequest addActionsItem(Object actionsItem) { * @return actions */ @javax.annotation.Nonnull - public List getActions() { + public List getActions() { return actions; } - public void setActions(@javax.annotation.Nonnull List actions) { + public void setActions(@javax.annotation.Nonnull List actions) { this.actions = actions; } @@ -193,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -231,11 +228,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("actions") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); + if (jsonObj.get("actions") != null) { + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); + } + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + // validate the required field `actions` (array) + for (int i = 0; i < jsonArrayactions.size(); i++) { + CatalogAction.validateJsonElement(jsonArrayactions.get(i)); + } } } diff --git a/src/main/java/one/talon/model/CatalogsStrikethroughNotificationPolicy.java b/src/main/java/one/talon/model/CatalogsStrikethroughNotificationPolicy.java index f577e1bd..020a6b1a 100644 --- a/src/main/java/one/talon/model/CatalogsStrikethroughNotificationPolicy.java +++ b/src/main/java/one/talon/model/CatalogsStrikethroughNotificationPolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Change.java b/src/main/java/one/talon/model/Change.java index b6543f29..4e45cdb9 100644 --- a/src/main/java/one/talon/model/Change.java +++ b/src/main/java/one/talon/model/Change.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -339,10 +338,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ChangeLoyaltyTierLevelEffectProps.java b/src/main/java/one/talon/model/ChangeLoyaltyTierLevelEffectProps.java index a3f37c9d..b0034ee6 100644 --- a/src/main/java/one/talon/model/ChangeLoyaltyTierLevelEffectProps.java +++ b/src/main/java/one/talon/model/ChangeLoyaltyTierLevelEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -287,10 +286,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ChangeProfilePassword.java b/src/main/java/one/talon/model/ChangeProfilePassword.java index bedd12c8..0f7e1b00 100644 --- a/src/main/java/one/talon/model/ChangeProfilePassword.java +++ b/src/main/java/one/talon/model/ChangeProfilePassword.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CodeGeneratorSettings.java b/src/main/java/one/talon/model/CodeGeneratorSettings.java index 12770a30..b3ad9d47 100644 --- a/src/main/java/one/talon/model/CodeGeneratorSettings.java +++ b/src/main/java/one/talon/model/CodeGeneratorSettings.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Collection.java b/src/main/java/one/talon/model/Collection.java index bdef8f87..4c8b58d0 100644 --- a/src/main/java/one/talon/model/Collection.java +++ b/src/main/java/one/talon/model/Collection.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -461,10 +460,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CollectionItem.java b/src/main/java/one/talon/model/CollectionItem.java index 0de0e1b2..ce5148e5 100644 --- a/src/main/java/one/talon/model/CollectionItem.java +++ b/src/main/java/one/talon/model/CollectionItem.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CollectionWithoutPayload.java b/src/main/java/one/talon/model/CollectionWithoutPayload.java index d536721e..6aca8c1f 100644 --- a/src/main/java/one/talon/model/CollectionWithoutPayload.java +++ b/src/main/java/one/talon/model/CollectionWithoutPayload.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -427,10 +426,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Coupon.java b/src/main/java/one/talon/model/Coupon.java index e2f54c3b..745e9fb9 100644 --- a/src/main/java/one/talon/model/Coupon.java +++ b/src/main/java/one/talon/model/Coupon.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -721,10 +720,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponConstraints.java b/src/main/java/one/talon/model/CouponConstraints.java index c7ffd611..3bbf3f0d 100644 --- a/src/main/java/one/talon/model/CouponConstraints.java +++ b/src/main/java/one/talon/model/CouponConstraints.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -268,10 +267,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponCreatedEffectProps.java b/src/main/java/one/talon/model/CouponCreatedEffectProps.java index f4ca4ce5..06d515a5 100644 --- a/src/main/java/one/talon/model/CouponCreatedEffectProps.java +++ b/src/main/java/one/talon/model/CouponCreatedEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponCreationJob.java b/src/main/java/one/talon/model/CouponCreationJob.java index 04229103..1c23cb23 100644 --- a/src/main/java/one/talon/model/CouponCreationJob.java +++ b/src/main/java/one/talon/model/CouponCreationJob.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CodeGeneratorSettings; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -749,10 +748,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponDeletionFilters.java b/src/main/java/one/talon/model/CouponDeletionFilters.java index d395988c..5879714f 100644 --- a/src/main/java/one/talon/model/CouponDeletionFilters.java +++ b/src/main/java/one/talon/model/CouponDeletionFilters.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -549,10 +548,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponDeletionJob.java b/src/main/java/one/talon/model/CouponDeletionJob.java index 6d6ccd56..c1e2ce32 100644 --- a/src/main/java/one/talon/model/CouponDeletionJob.java +++ b/src/main/java/one/talon/model/CouponDeletionJob.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CouponDeletionFilters; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -462,10 +461,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponEntity.java b/src/main/java/one/talon/model/CouponEntity.java index 196a894b..657b0864 100644 --- a/src/main/java/one/talon/model/CouponEntity.java +++ b/src/main/java/one/talon/model/CouponEntity.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponFailureSummary.java b/src/main/java/one/talon/model/CouponFailureSummary.java index d1a0f3b8..56f9ba86 100644 --- a/src/main/java/one/talon/model/CouponFailureSummary.java +++ b/src/main/java/one/talon/model/CouponFailureSummary.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -391,10 +390,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponLimitConfigs.java b/src/main/java/one/talon/model/CouponLimitConfigs.java index f9bbecc7..1a192af2 100644 --- a/src/main/java/one/talon/model/CouponLimitConfigs.java +++ b/src/main/java/one/talon/model/CouponLimitConfigs.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponRejectionReason.java b/src/main/java/one/talon/model/CouponRejectionReason.java index ce2316dc..5fb0d8ac 100644 --- a/src/main/java/one/talon/model/CouponRejectionReason.java +++ b/src/main/java/one/talon/model/CouponRejectionReason.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -280,10 +279,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponReservations.java b/src/main/java/one/talon/model/CouponReservations.java index 3ba1719a..4cc1d78c 100644 --- a/src/main/java/one/talon/model/CouponReservations.java +++ b/src/main/java/one/talon/model/CouponReservations.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponSearch.java b/src/main/java/one/talon/model/CouponSearch.java index fef6c237..b73f7efa 100644 --- a/src/main/java/one/talon/model/CouponSearch.java +++ b/src/main/java/one/talon/model/CouponSearch.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponValue.java b/src/main/java/one/talon/model/CouponValue.java index 65659bd4..338f59de 100644 --- a/src/main/java/one/talon/model/CouponValue.java +++ b/src/main/java/one/talon/model/CouponValue.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponWithApplication.java b/src/main/java/one/talon/model/CouponWithApplication.java index 8391f279..d3e262d0 100644 --- a/src/main/java/one/talon/model/CouponWithApplication.java +++ b/src/main/java/one/talon/model/CouponWithApplication.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -773,10 +772,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponsNotificationData.java b/src/main/java/one/talon/model/CouponsNotificationData.java index bf5f77c4..c8f11f87 100644 --- a/src/main/java/one/talon/model/CouponsNotificationData.java +++ b/src/main/java/one/talon/model/CouponsNotificationData.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExtendedCoupon; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -349,10 +348,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CouponsNotificationPolicy.java b/src/main/java/one/talon/model/CouponsNotificationPolicy.java index a0f165c7..17dbed35 100644 --- a/src/main/java/one/talon/model/CouponsNotificationPolicy.java +++ b/src/main/java/one/talon/model/CouponsNotificationPolicy.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -326,10 +325,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateAchievement.java b/src/main/java/one/talon/model/CreateAchievement.java index e27cfc6c..498a6c7b 100644 --- a/src/main/java/one/talon/model/CreateAchievement.java +++ b/src/main/java/one/talon/model/CreateAchievement.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.TimePoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -530,10 +529,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateAchievementV2.java b/src/main/java/one/talon/model/CreateAchievementV2.java index 3eb32560..8abc3f04 100644 --- a/src/main/java/one/talon/model/CreateAchievementV2.java +++ b/src/main/java/one/talon/model/CreateAchievementV2.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -211,16 +210,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private Boolean allowRollbackAfterCompletion; - public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; - @SerializedName(SERIALIZED_NAME_SANDBOX) - @javax.annotation.Nonnull - private Boolean sandbox; - public static final String SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS = "subscribedApplications"; @SerializedName(SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS) @javax.annotation.Nullable private List subscribedApplications; + public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; + @SerializedName(SERIALIZED_NAME_SANDBOX) + @javax.annotation.Nonnull + private Boolean sandbox; + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; @SerializedName(SERIALIZED_NAME_TIMEZONE) @javax.annotation.Nonnull @@ -419,25 +418,6 @@ public void setAllowRollbackAfterCompletion(@javax.annotation.Nullable Boolean a } - public CreateAchievementV2 sandbox(@javax.annotation.Nonnull Boolean sandbox) { - this.sandbox = sandbox; - return this; - } - - /** - * Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. - * @return sandbox - */ - @javax.annotation.Nonnull - public Boolean getSandbox() { - return sandbox; - } - - public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { - this.sandbox = sandbox; - } - - public CreateAchievementV2 subscribedApplications(@javax.annotation.Nullable List subscribedApplications) { this.subscribedApplications = subscribedApplications; return this; @@ -465,6 +445,25 @@ public void setSubscribedApplications(@javax.annotation.Nullable List subs } + public CreateAchievementV2 sandbox(@javax.annotation.Nonnull Boolean sandbox) { + this.sandbox = sandbox; + return this; + } + + /** + * Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. + * @return sandbox + */ + @javax.annotation.Nonnull + public Boolean getSandbox() { + return sandbox; + } + + public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { + this.sandbox = sandbox; + } + + public CreateAchievementV2 timezone(@javax.annotation.Nonnull String timezone) { this.timezone = timezone; return this; @@ -548,15 +547,15 @@ public boolean equals(Object o) { Objects.equals(this.fixedStartDate, createAchievementV2.fixedStartDate) && Objects.equals(this.endDate, createAchievementV2.endDate) && Objects.equals(this.allowRollbackAfterCompletion, createAchievementV2.allowRollbackAfterCompletion) && - Objects.equals(this.sandbox, createAchievementV2.sandbox) && Objects.equals(this.subscribedApplications, createAchievementV2.subscribedApplications) && + Objects.equals(this.sandbox, createAchievementV2.sandbox) && Objects.equals(this.timezone, createAchievementV2.timezone)&& Objects.equals(this.additionalProperties, createAchievementV2.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, sandbox, subscribedApplications, timezone, additionalProperties); + return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, subscribedApplications, sandbox, timezone, additionalProperties); } @Override @@ -573,8 +572,8 @@ public String toString() { sb.append(" fixedStartDate: ").append(toIndentedString(fixedStartDate)).append("\n"); sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); sb.append(" allowRollbackAfterCompletion: ").append(toIndentedString(allowRollbackAfterCompletion)).append("\n"); - sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); sb.append(" subscribedApplications: ").append(toIndentedString(subscribedApplications)).append("\n"); + sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -586,10 +585,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -598,7 +594,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone")); + openapiFields = new HashSet(Arrays.asList("name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications", "sandbox", "timezone")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name", "title", "description", "target", "sandbox", "timezone")); diff --git a/src/main/java/one/talon/model/CreateApplicationAPIKey.java b/src/main/java/one/talon/model/CreateApplicationAPIKey.java index e07287d6..ea2f38c0 100644 --- a/src/main/java/one/talon/model/CreateApplicationAPIKey.java +++ b/src/main/java/one/talon/model/CreateApplicationAPIKey.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -379,10 +378,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateCouponData.java b/src/main/java/one/talon/model/CreateCouponData.java index 7b31d3fa..05808aef 100644 --- a/src/main/java/one/talon/model/CreateCouponData.java +++ b/src/main/java/one/talon/model/CreateCouponData.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExtendedCoupon; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -373,10 +372,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateCoupons200Response.java b/src/main/java/one/talon/model/CreateCoupons200Response.java index 6f1ad244..339b68fa 100644 --- a/src/main/java/one/talon/model/CreateCoupons200Response.java +++ b/src/main/java/one/talon/model/CreateCoupons200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Coupon; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateMCPKey.java b/src/main/java/one/talon/model/CreateMCPKey.java index 57270906..a549ee63 100644 --- a/src/main/java/one/talon/model/CreateMCPKey.java +++ b/src/main/java/one/talon/model/CreateMCPKey.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateManagementKey.java b/src/main/java/one/talon/model/CreateManagementKey.java index 0cc31fae..ce7bb562 100644 --- a/src/main/java/one/talon/model/CreateManagementKey.java +++ b/src/main/java/one/talon/model/CreateManagementKey.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Endpoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -254,10 +253,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateReferralsForMultipleAdvocates201Response.java b/src/main/java/one/talon/model/CreateReferralsForMultipleAdvocates201Response.java index 485a1b05..98b36ce7 100644 --- a/src/main/java/one/talon/model/CreateReferralsForMultipleAdvocates201Response.java +++ b/src/main/java/one/talon/model/CreateReferralsForMultipleAdvocates201Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Referral; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateTemplateCampaign.java b/src/main/java/one/talon/model/CreateTemplateCampaign.java index ccc9780d..d110c6ac 100644 --- a/src/main/java/one/talon/model/CreateTemplateCampaign.java +++ b/src/main/java/one/talon/model/CreateTemplateCampaign.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.Binding; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -434,10 +433,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CreateTemplateCampaignResponse.java b/src/main/java/one/talon/model/CreateTemplateCampaignResponse.java index 9e2bc3bd..6e04d534 100644 --- a/src/main/java/one/talon/model/CreateTemplateCampaignResponse.java +++ b/src/main/java/one/talon/model/CreateTemplateCampaignResponse.java @@ -26,7 +26,6 @@ import one.talon.model.Campaign; import one.talon.model.Collection; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -221,10 +220,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomEffect.java b/src/main/java/one/talon/model/CustomEffect.java index 1ae6d656..39ed139f 100644 --- a/src/main/java/one/talon/model/CustomEffect.java +++ b/src/main/java/one/talon/model/CustomEffect.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -514,10 +513,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomEffectProps.java b/src/main/java/one/talon/model/CustomEffectProps.java index ad984349..7f7a211c 100644 --- a/src/main/java/one/talon/model/CustomEffectProps.java +++ b/src/main/java/one/talon/model/CustomEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerActivityReport.java b/src/main/java/one/talon/model/CustomerActivityReport.java index dafe578f..a39f9c64 100644 --- a/src/main/java/one/talon/model/CustomerActivityReport.java +++ b/src/main/java/one/talon/model/CustomerActivityReport.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -470,10 +469,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerAnalytics.java b/src/main/java/one/talon/model/CustomerAnalytics.java index 565dde61..277f72af 100644 --- a/src/main/java/one/talon/model/CustomerAnalytics.java +++ b/src/main/java/one/talon/model/CustomerAnalytics.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerInventory.java b/src/main/java/one/talon/model/CustomerInventory.java index 9baf2052..17a74e61 100644 --- a/src/main/java/one/talon/model/CustomerInventory.java +++ b/src/main/java/one/talon/model/CustomerInventory.java @@ -29,7 +29,6 @@ import one.talon.model.InventoryCoupon; import one.talon.model.InventoryReferral; import one.talon.model.Loyalty; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -326,10 +325,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfile.java b/src/main/java/one/talon/model/CustomerProfile.java index 405d8eed..4ca66df1 100644 --- a/src/main/java/one/talon/model/CustomerProfile.java +++ b/src/main/java/one/talon/model/CustomerProfile.java @@ -29,7 +29,6 @@ import java.util.Map; import one.talon.model.AudienceMembership; import one.talon.model.LoyaltyMembership; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -448,10 +447,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileAudienceRequest.java b/src/main/java/one/talon/model/CustomerProfileAudienceRequest.java index 8cb65423..27b953b5 100644 --- a/src/main/java/one/talon/model/CustomerProfileAudienceRequest.java +++ b/src/main/java/one/talon/model/CustomerProfileAudienceRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerProfileAudienceRequestItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileAudienceRequestItem.java b/src/main/java/one/talon/model/CustomerProfileAudienceRequestItem.java index 609ce927..3e32f020 100644 --- a/src/main/java/one/talon/model/CustomerProfileAudienceRequestItem.java +++ b/src/main/java/one/talon/model/CustomerProfileAudienceRequestItem.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -260,10 +259,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileEntity.java b/src/main/java/one/talon/model/CustomerProfileEntity.java index 43fa4082..c28de372 100644 --- a/src/main/java/one/talon/model/CustomerProfileEntity.java +++ b/src/main/java/one/talon/model/CustomerProfileEntity.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileIntegrationRequestV2.java b/src/main/java/one/talon/model/CustomerProfileIntegrationRequestV2.java index a31842ba..f8dbe321 100644 --- a/src/main/java/one/talon/model/CustomerProfileIntegrationRequestV2.java +++ b/src/main/java/one/talon/model/CustomerProfileIntegrationRequestV2.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import one.talon.model.ProfileAudiencesChanges; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -325,10 +324,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileIntegrationResponseV2.java b/src/main/java/one/talon/model/CustomerProfileIntegrationResponseV2.java index 6ad65f35..a851a186 100644 --- a/src/main/java/one/talon/model/CustomerProfileIntegrationResponseV2.java +++ b/src/main/java/one/talon/model/CustomerProfileIntegrationResponseV2.java @@ -33,7 +33,6 @@ import one.talon.model.Loyalty; import one.talon.model.Referral; import one.talon.model.RuleFailureReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -458,10 +457,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileSearchQuery.java b/src/main/java/one/talon/model/CustomerProfileSearchQuery.java index 57d13055..ee8c9ccf 100644 --- a/src/main/java/one/talon/model/CustomerProfileSearchQuery.java +++ b/src/main/java/one/talon/model/CustomerProfileSearchQuery.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -226,10 +225,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerProfileUpdateV2Response.java b/src/main/java/one/talon/model/CustomerProfileUpdateV2Response.java index 71d39011..0c9e4367 100644 --- a/src/main/java/one/talon/model/CustomerProfileUpdateV2Response.java +++ b/src/main/java/one/talon/model/CustomerProfileUpdateV2Response.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CustomerProfile; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerSession.java b/src/main/java/one/talon/model/CustomerSession.java index 3f64325b..37fb8331 100644 --- a/src/main/java/one/talon/model/CustomerSession.java +++ b/src/main/java/one/talon/model/CustomerSession.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import one.talon.model.CartItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -607,10 +606,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/CustomerSessionV2.java b/src/main/java/one/talon/model/CustomerSessionV2.java index cc8bf908..d23120c9 100644 --- a/src/main/java/one/talon/model/CustomerSessionV2.java +++ b/src/main/java/one/talon/model/CustomerSessionV2.java @@ -30,7 +30,6 @@ import one.talon.model.AdditionalCost; import one.talon.model.CartItem; import one.talon.model.ExperimentVariantAllocation; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -221,6 +220,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private BigDecimal additionalCostTotal; + public static final String SERIALIZED_NAME_CART_ITEM_ADDITIONAL_COST_TOTAL = "cartItemAdditionalCostTotal"; + @SerializedName(SERIALIZED_NAME_CART_ITEM_ADDITIONAL_COST_TOTAL) + @javax.annotation.Nonnull + private BigDecimal cartItemAdditionalCostTotal; + public static final String SERIALIZED_NAME_UPDATED = "updated"; @SerializedName(SERIALIZED_NAME_UPDATED) @javax.annotation.Nonnull @@ -229,6 +233,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public CustomerSessionV2() { } + public CustomerSessionV2( + BigDecimal cartItemAdditionalCostTotal + ) { + this(); + this.cartItemAdditionalCostTotal = cartItemAdditionalCostTotal; + } + public CustomerSessionV2 id(@javax.annotation.Nonnull Long id) { this.id = id; return this; @@ -692,6 +703,17 @@ public void setAdditionalCostTotal(@javax.annotation.Nonnull BigDecimal addition } + /** + * The total value of additional costs applied to individual items, before any discounts are applied. + * @return cartItemAdditionalCostTotal + */ + @javax.annotation.Nonnull + public BigDecimal getCartItemAdditionalCostTotal() { + return cartItemAdditionalCostTotal; + } + + + public CustomerSessionV2 updated(@javax.annotation.Nonnull OffsetDateTime updated) { this.updated = updated; return this; @@ -786,13 +808,14 @@ public boolean equals(Object o) { Objects.equals(this.total, customerSessionV2.total) && Objects.equals(this.cartItemTotal, customerSessionV2.cartItemTotal) && Objects.equals(this.additionalCostTotal, customerSessionV2.additionalCostTotal) && + Objects.equals(this.cartItemAdditionalCostTotal, customerSessionV2.cartItemAdditionalCostTotal) && Objects.equals(this.updated, customerSessionV2.updated)&& Objects.equals(this.additionalProperties, customerSessionV2.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, created, integrationId, applicationId, profileId, storeIntegrationId, evaluableCampaignIds, couponCodes, referralCode, loyaltyCards, state, cartItems, experimentVariantAllocations, additionalCosts, identifiers, attributes, firstSession, updateCount, total, cartItemTotal, additionalCostTotal, updated, additionalProperties); + return Objects.hash(id, created, integrationId, applicationId, profileId, storeIntegrationId, evaluableCampaignIds, couponCodes, referralCode, loyaltyCards, state, cartItems, experimentVariantAllocations, additionalCosts, identifiers, attributes, firstSession, updateCount, total, cartItemTotal, additionalCostTotal, cartItemAdditionalCostTotal, updated, additionalProperties); } @Override @@ -820,6 +843,7 @@ public String toString() { sb.append(" total: ").append(toIndentedString(total)).append("\n"); sb.append(" cartItemTotal: ").append(toIndentedString(cartItemTotal)).append("\n"); sb.append(" additionalCostTotal: ").append(toIndentedString(additionalCostTotal)).append("\n"); + sb.append(" cartItemAdditionalCostTotal: ").append(toIndentedString(cartItemAdditionalCostTotal)).append("\n"); sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -831,10 +855,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -843,10 +864,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "created", "integrationId", "applicationId", "profileId", "storeIntegrationId", "evaluableCampaignIds", "couponCodes", "referralCode", "loyaltyCards", "state", "cartItems", "experimentVariantAllocations", "additionalCosts", "identifiers", "attributes", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "updated")); + openapiFields = new HashSet(Arrays.asList("id", "created", "integrationId", "applicationId", "profileId", "storeIntegrationId", "evaluableCampaignIds", "couponCodes", "referralCode", "loyaltyCards", "state", "cartItems", "experimentVariantAllocations", "additionalCosts", "identifiers", "attributes", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "cartItemAdditionalCostTotal", "updated")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "integrationId", "applicationId", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "updated")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "integrationId", "applicationId", "firstSession", "updateCount", "total", "cartItemTotal", "additionalCostTotal", "cartItemAdditionalCostTotal", "updated")); } /** diff --git a/src/main/java/one/talon/model/DeactivateUserRequest.java b/src/main/java/one/talon/model/DeactivateUserRequest.java index 33973d1a..b252cd34 100644 --- a/src/main/java/one/talon/model/DeactivateUserRequest.java +++ b/src/main/java/one/talon/model/DeactivateUserRequest.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/DeductLoyaltyPoints.java b/src/main/java/one/talon/model/DeductLoyaltyPoints.java index ffcc6caf..a402f37b 100644 --- a/src/main/java/one/talon/model/DeductLoyaltyPoints.java +++ b/src/main/java/one/talon/model/DeductLoyaltyPoints.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -237,10 +236,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/DeductLoyaltyPointsEffectProps.java b/src/main/java/one/talon/model/DeductLoyaltyPointsEffectProps.java index 3faab458..fbd48936 100644 --- a/src/main/java/one/talon/model/DeductLoyaltyPointsEffectProps.java +++ b/src/main/java/one/talon/model/DeductLoyaltyPointsEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/DeleteCouponsData.java b/src/main/java/one/talon/model/DeleteCouponsData.java index e5692319..dd3c8943 100644 --- a/src/main/java/one/talon/model/DeleteCouponsData.java +++ b/src/main/java/one/talon/model/DeleteCouponsData.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -388,10 +387,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/DeleteLoyaltyTransactionsRequest.java b/src/main/java/one/talon/model/DeleteLoyaltyTransactionsRequest.java index 3d93ebf5..8861bd74 100644 --- a/src/main/java/one/talon/model/DeleteLoyaltyTransactionsRequest.java +++ b/src/main/java/one/talon/model/DeleteLoyaltyTransactionsRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -256,10 +255,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/DeleteUserRequest.java b/src/main/java/one/talon/model/DeleteUserRequest.java index a4e417e1..5b9c793d 100644 --- a/src/main/java/one/talon/model/DeleteUserRequest.java +++ b/src/main/java/one/talon/model/DeleteUserRequest.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Effect.java b/src/main/java/one/talon/model/Effect.java index e6eebcb9..f2c5dd95 100644 --- a/src/main/java/one/talon/model/Effect.java +++ b/src/main/java/one/talon/model/Effect.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -574,10 +573,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EffectEntity.java b/src/main/java/one/talon/model/EffectEntity.java index 6b57ed40..175c0dbc 100644 --- a/src/main/java/one/talon/model/EffectEntity.java +++ b/src/main/java/one/talon/model/EffectEntity.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -548,10 +547,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EmailEntity.java b/src/main/java/one/talon/model/EmailEntity.java index fa8d06d0..2b8a1a65 100644 --- a/src/main/java/one/talon/model/EmailEntity.java +++ b/src/main/java/one/talon/model/EmailEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EmbeddedAnalyticsConfiguration.java b/src/main/java/one/talon/model/EmbeddedAnalyticsConfiguration.java index 420713da..8af96988 100644 --- a/src/main/java/one/talon/model/EmbeddedAnalyticsConfiguration.java +++ b/src/main/java/one/talon/model/EmbeddedAnalyticsConfiguration.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.EmbeddedAnalyticsConfigurationDashboards; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EmbeddedAnalyticsConfigurationDashboards.java b/src/main/java/one/talon/model/EmbeddedAnalyticsConfigurationDashboards.java index 57b34878..eb3263a9 100644 --- a/src/main/java/one/talon/model/EmbeddedAnalyticsConfigurationDashboards.java +++ b/src/main/java/one/talon/model/EmbeddedAnalyticsConfigurationDashboards.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.EmbeddedDashboardConfiguration; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EmbeddedDashboardConfiguration.java b/src/main/java/one/talon/model/EmbeddedDashboardConfiguration.java index 4af1ff51..e920fa25 100644 --- a/src/main/java/one/talon/model/EmbeddedDashboardConfiguration.java +++ b/src/main/java/one/talon/model/EmbeddedDashboardConfiguration.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Endpoint.java b/src/main/java/one/talon/model/Endpoint.java index 53582e21..ebe0f5de 100644 --- a/src/main/java/one/talon/model/Endpoint.java +++ b/src/main/java/one/talon/model/Endpoint.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Entity.java b/src/main/java/one/talon/model/Entity.java index 289106de..5a336fd8 100644 --- a/src/main/java/one/talon/model/Entity.java +++ b/src/main/java/one/talon/model/Entity.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EntityWithTalangVisibleID.java b/src/main/java/one/talon/model/EntityWithTalangVisibleID.java index 5eb48cc1..5087cad5 100644 --- a/src/main/java/one/talon/model/EntityWithTalangVisibleID.java +++ b/src/main/java/one/talon/model/EntityWithTalangVisibleID.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Environment.java b/src/main/java/one/talon/model/Environment.java index c23d2bb4..69174ed7 100644 --- a/src/main/java/one/talon/model/Environment.java +++ b/src/main/java/one/talon/model/Environment.java @@ -36,7 +36,6 @@ import one.talon.model.PriceType; import one.talon.model.SlotDef; import one.talon.model.TemplateDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -657,10 +656,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ErrorEffectProps.java b/src/main/java/one/talon/model/ErrorEffectProps.java index 75f2eb57..741d51b7 100644 --- a/src/main/java/one/talon/model/ErrorEffectProps.java +++ b/src/main/java/one/talon/model/ErrorEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ErrorResponse.java b/src/main/java/one/talon/model/ErrorResponse.java index 81f07c11..17f06a5a 100644 --- a/src/main/java/one/talon/model/ErrorResponse.java +++ b/src/main/java/one/talon/model/ErrorResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.APIError; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ErrorResponseWithStatus.java b/src/main/java/one/talon/model/ErrorResponseWithStatus.java index f6fe76f1..7a7673e3 100644 --- a/src/main/java/one/talon/model/ErrorResponseWithStatus.java +++ b/src/main/java/one/talon/model/ErrorResponseWithStatus.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.APIError; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ErrorSource.java b/src/main/java/one/talon/model/ErrorSource.java index 38575cb5..f7a9af33 100644 --- a/src/main/java/one/talon/model/ErrorSource.java +++ b/src/main/java/one/talon/model/ErrorSource.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EvaluableCampaignIds.java b/src/main/java/one/talon/model/EvaluableCampaignIds.java index 1286dcfd..dce3bc84 100644 --- a/src/main/java/one/talon/model/EvaluableCampaignIds.java +++ b/src/main/java/one/talon/model/EvaluableCampaignIds.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Event.java b/src/main/java/one/talon/model/Event.java index 5ddb84bf..c659fa67 100644 --- a/src/main/java/one/talon/model/Event.java +++ b/src/main/java/one/talon/model/Event.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.LedgerEntry; import one.talon.model.Meta; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -91,6 +90,11 @@ public class Event { @javax.annotation.Nonnull private Object attributes; + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + @javax.annotation.Nullable + private String integrationId; + public static final String SERIALIZED_NAME_SESSION_ID = "sessionId"; @SerializedName(SERIALIZED_NAME_SESSION_ID) @javax.annotation.Nullable @@ -215,7 +219,7 @@ public Event type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event. Must not be a reserved event name. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -247,6 +251,25 @@ public void setAttributes(@javax.annotation.Nonnull Object attributes) { } + public Event integrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId + */ + @javax.annotation.Nullable + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; + } + + public Event sessionId(@javax.annotation.Nullable String sessionId) { this.sessionId = sessionId; return this; @@ -400,6 +423,7 @@ public boolean equals(Object o) { Objects.equals(this.storeIntegrationId, event.storeIntegrationId) && Objects.equals(this.type, event.type) && Objects.equals(this.attributes, event.attributes) && + Objects.equals(this.integrationId, event.integrationId) && Objects.equals(this.sessionId, event.sessionId) && Objects.equals(this.effects, event.effects) && Objects.equals(this.ledgerEntries, event.ledgerEntries) && @@ -409,7 +433,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, created, applicationId, profileId, storeIntegrationId, type, attributes, sessionId, effects, ledgerEntries, meta, additionalProperties); + return Objects.hash(id, created, applicationId, profileId, storeIntegrationId, type, attributes, integrationId, sessionId, effects, ledgerEntries, meta, additionalProperties); } @Override @@ -423,6 +447,7 @@ public String toString() { sb.append(" storeIntegrationId: ").append(toIndentedString(storeIntegrationId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); sb.append(" effects: ").append(toIndentedString(effects)).append("\n"); sb.append(" ledgerEntries: ").append(toIndentedString(ledgerEntries)).append("\n"); @@ -437,10 +462,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -449,7 +471,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "created", "applicationId", "profileId", "storeIntegrationId", "type", "attributes", "sessionId", "effects", "ledgerEntries", "meta")); + openapiFields = new HashSet(Arrays.asList("id", "created", "applicationId", "profileId", "storeIntegrationId", "type", "attributes", "integrationId", "sessionId", "effects", "ledgerEntries", "meta")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "applicationId", "type", "attributes", "effects")); @@ -484,6 +506,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } + if ((jsonObj.get("integrationId") != null && !jsonObj.get("integrationId").isJsonNull()) && !jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); + } if ((jsonObj.get("sessionId") != null && !jsonObj.get("sessionId").isJsonNull()) && !jsonObj.get("sessionId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); } diff --git a/src/main/java/one/talon/model/EventAttributesEntity.java b/src/main/java/one/talon/model/EventAttributesEntity.java index b80cbf4d..aed14043 100644 --- a/src/main/java/one/talon/model/EventAttributesEntity.java +++ b/src/main/java/one/talon/model/EventAttributesEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -70,7 +69,7 @@ public EventAttributesEntity type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EventType.java b/src/main/java/one/talon/model/EventType.java index 83e9aca8..85271a30 100644 --- a/src/main/java/one/talon/model/EventType.java +++ b/src/main/java/one/talon/model/EventType.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EventV2.java b/src/main/java/one/talon/model/EventV2.java index 229e0349..68f1a2a1 100644 --- a/src/main/java/one/talon/model/EventV2.java +++ b/src/main/java/one/talon/model/EventV2.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -152,7 +151,7 @@ public EventV2 type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -270,10 +269,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/EventV3.java b/src/main/java/one/talon/model/EventV3.java index 8bc96ba3..a11ac1eb 100644 --- a/src/main/java/one/talon/model/EventV3.java +++ b/src/main/java/one/talon/model/EventV3.java @@ -20,10 +20,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,9 +53,29 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") public class EventV3 { + public static final String SERIALIZED_NAME_CONNECTED_SESSION_ID = "connectedSessionId"; + @SerializedName(SERIALIZED_NAME_CONNECTED_SESSION_ID) + @javax.annotation.Nullable + private String connectedSessionId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull + private OffsetDateTime created; + + public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; + @SerializedName(SERIALIZED_NAME_APPLICATION_ID) + @javax.annotation.Nonnull + private Long applicationId; + public static final String SERIALIZED_NAME_PROFILE_ID = "profileId"; @SerializedName(SERIALIZED_NAME_PROFILE_ID) - @javax.annotation.Nonnull + @javax.annotation.Nullable private String profileId; public static final String SERIALIZED_NAME_STORE_INTEGRATION_ID = "storeIntegrationId"; @@ -63,16 +83,6 @@ public class EventV3 { @javax.annotation.Nullable private String storeIntegrationId; - public static final String SERIALIZED_NAME_EVALUABLE_CAMPAIGN_IDS = "evaluableCampaignIds"; - @SerializedName(SERIALIZED_NAME_EVALUABLE_CAMPAIGN_IDS) - @javax.annotation.Nullable - private List evaluableCampaignIds; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - @javax.annotation.Nonnull - private String integrationId; - public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull @@ -80,103 +90,133 @@ public class EventV3 { public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; @SerializedName(SERIALIZED_NAME_ATTRIBUTES) - @javax.annotation.Nullable + @javax.annotation.Nonnull private Object attributes; - public static final String SERIALIZED_NAME_CONNECTED_SESSION_I_D = "connectedSessionID"; - @SerializedName(SERIALIZED_NAME_CONNECTED_SESSION_I_D) + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) @javax.annotation.Nullable - private String connectedSessionID; + private String integrationId; - public static final String SERIALIZED_NAME_PREVIOUS_EVENT_I_D = "previousEventID"; - @SerializedName(SERIALIZED_NAME_PREVIOUS_EVENT_I_D) - @javax.annotation.Nullable - private String previousEventID; + public static final String SERIALIZED_NAME_EFFECTS = "effects"; + @SerializedName(SERIALIZED_NAME_EFFECTS) + @javax.annotation.Nonnull + private List effects = new ArrayList<>(); public EventV3() { } - public EventV3 profileId(@javax.annotation.Nonnull String profileId) { - this.profileId = profileId; + public EventV3 connectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; return this; } /** - * ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. - * @return profileId + * The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. + * @return connectedSessionId + */ + @javax.annotation.Nullable + public String getConnectedSessionId() { + return connectedSessionId; + } + + public void setConnectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; + } + + + public EventV3 id(@javax.annotation.Nonnull Long id) { + this.id = id; + return this; + } + + /** + * The internal ID of this entity. + * @return id */ @javax.annotation.Nonnull - public String getProfileId() { - return profileId; + public Long getId() { + return id; } - public void setProfileId(@javax.annotation.Nonnull String profileId) { - this.profileId = profileId; + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; } - public EventV3 storeIntegrationId(@javax.annotation.Nullable String storeIntegrationId) { - this.storeIntegrationId = storeIntegrationId; + public EventV3 created(@javax.annotation.Nonnull OffsetDateTime created) { + this.created = created; return this; } /** - * The integration ID of the store. You choose this ID when you create a store. - * @return storeIntegrationId + * The time this entity was created. + * @return created */ - @javax.annotation.Nullable - public String getStoreIntegrationId() { - return storeIntegrationId; + @javax.annotation.Nonnull + public OffsetDateTime getCreated() { + return created; } - public void setStoreIntegrationId(@javax.annotation.Nullable String storeIntegrationId) { - this.storeIntegrationId = storeIntegrationId; + public void setCreated(@javax.annotation.Nonnull OffsetDateTime created) { + this.created = created; } - public EventV3 evaluableCampaignIds(@javax.annotation.Nullable List evaluableCampaignIds) { - this.evaluableCampaignIds = evaluableCampaignIds; + public EventV3 applicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; return this; } - public EventV3 addEvaluableCampaignIdsItem(Long evaluableCampaignIdsItem) { - if (this.evaluableCampaignIds == null) { - this.evaluableCampaignIds = new ArrayList<>(); - } - this.evaluableCampaignIds.add(evaluableCampaignIdsItem); + /** + * The ID of the Application that owns this entity. + * @return applicationId + */ + @javax.annotation.Nonnull + public Long getApplicationId() { + return applicationId; + } + + public void setApplicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + } + + + public EventV3 profileId(@javax.annotation.Nullable String profileId) { + this.profileId = profileId; return this; } /** - * When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. - * @return evaluableCampaignIds + * ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. + * @return profileId */ @javax.annotation.Nullable - public List getEvaluableCampaignIds() { - return evaluableCampaignIds; + public String getProfileId() { + return profileId; } - public void setEvaluableCampaignIds(@javax.annotation.Nullable List evaluableCampaignIds) { - this.evaluableCampaignIds = evaluableCampaignIds; + public void setProfileId(@javax.annotation.Nullable String profileId) { + this.profileId = profileId; } - public EventV3 integrationId(@javax.annotation.Nonnull String integrationId) { - this.integrationId = integrationId; + public EventV3 storeIntegrationId(@javax.annotation.Nullable String storeIntegrationId) { + this.storeIntegrationId = storeIntegrationId; return this; } /** - * The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. - * @return integrationId + * The integration ID of the store. You choose this ID when you create a store. + * @return storeIntegrationId */ - @javax.annotation.Nonnull - public String getIntegrationId() { - return integrationId; + @javax.annotation.Nullable + public String getStoreIntegrationId() { + return storeIntegrationId; } - public void setIntegrationId(@javax.annotation.Nonnull String integrationId) { - this.integrationId = integrationId; + public void setStoreIntegrationId(@javax.annotation.Nullable String storeIntegrationId) { + this.storeIntegrationId = storeIntegrationId; } @@ -186,7 +226,7 @@ public EventV3 type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -199,60 +239,68 @@ public void setType(@javax.annotation.Nonnull String type) { } - public EventV3 attributes(@javax.annotation.Nullable Object attributes) { + public EventV3 attributes(@javax.annotation.Nonnull Object attributes) { this.attributes = attributes; return this; } /** - * Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). + * Arbitrary additional JSON data associated with the event. * @return attributes */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public Object getAttributes() { return attributes; } - public void setAttributes(@javax.annotation.Nullable Object attributes) { + public void setAttributes(@javax.annotation.Nonnull Object attributes) { this.attributes = attributes; } - public EventV3 connectedSessionID(@javax.annotation.Nullable String connectedSessionID) { - this.connectedSessionID = connectedSessionID; + public EventV3 integrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; return this; } /** - * The ID of the session that happened in the past. - * @return connectedSessionID + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId */ @javax.annotation.Nullable - public String getConnectedSessionID() { - return connectedSessionID; + public String getIntegrationId() { + return integrationId; } - public void setConnectedSessionID(@javax.annotation.Nullable String connectedSessionID) { - this.connectedSessionID = connectedSessionID; + public void setIntegrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; } - public EventV3 previousEventID(@javax.annotation.Nullable String previousEventID) { - this.previousEventID = previousEventID; + public EventV3 effects(@javax.annotation.Nonnull List effects) { + this.effects = effects; + return this; + } + + public EventV3 addEffectsItem(Object effectsItem) { + if (this.effects == null) { + this.effects = new ArrayList<>(); + } + this.effects.add(effectsItem); return this; } /** - * The unique identifier of the event that happened in the past. - * @return previousEventID + * An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). + * @return effects */ - @javax.annotation.Nullable - public String getPreviousEventID() { - return previousEventID; + @javax.annotation.Nonnull + public List getEffects() { + return effects; } - public void setPreviousEventID(@javax.annotation.Nullable String previousEventID) { - this.previousEventID = previousEventID; + public void setEffects(@javax.annotation.Nonnull List effects) { + this.effects = effects; } /** @@ -310,34 +358,38 @@ public boolean equals(Object o) { return false; } EventV3 eventV3 = (EventV3) o; - return Objects.equals(this.profileId, eventV3.profileId) && + return Objects.equals(this.connectedSessionId, eventV3.connectedSessionId) && + Objects.equals(this.id, eventV3.id) && + Objects.equals(this.created, eventV3.created) && + Objects.equals(this.applicationId, eventV3.applicationId) && + Objects.equals(this.profileId, eventV3.profileId) && Objects.equals(this.storeIntegrationId, eventV3.storeIntegrationId) && - Objects.equals(this.evaluableCampaignIds, eventV3.evaluableCampaignIds) && - Objects.equals(this.integrationId, eventV3.integrationId) && Objects.equals(this.type, eventV3.type) && Objects.equals(this.attributes, eventV3.attributes) && - Objects.equals(this.connectedSessionID, eventV3.connectedSessionID) && - Objects.equals(this.previousEventID, eventV3.previousEventID)&& + Objects.equals(this.integrationId, eventV3.integrationId) && + Objects.equals(this.effects, eventV3.effects)&& Objects.equals(this.additionalProperties, eventV3.additionalProperties); } @Override public int hashCode() { - return Objects.hash(profileId, storeIntegrationId, evaluableCampaignIds, integrationId, type, attributes, connectedSessionID, previousEventID, additionalProperties); + return Objects.hash(connectedSessionId, id, created, applicationId, profileId, storeIntegrationId, type, attributes, integrationId, effects, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EventV3 {\n"); + sb.append(" connectedSessionId: ").append(toIndentedString(connectedSessionId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); sb.append(" profileId: ").append(toIndentedString(profileId)).append("\n"); sb.append(" storeIntegrationId: ").append(toIndentedString(storeIntegrationId)).append("\n"); - sb.append(" evaluableCampaignIds: ").append(toIndentedString(evaluableCampaignIds)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); - sb.append(" connectedSessionID: ").append(toIndentedString(connectedSessionID)).append("\n"); - sb.append(" previousEventID: ").append(toIndentedString(previousEventID)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" effects: ").append(toIndentedString(effects)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -348,10 +400,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -360,10 +409,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("profileId", "storeIntegrationId", "evaluableCampaignIds", "integrationId", "type", "attributes", "connectedSessionID", "previousEventID")); + openapiFields = new HashSet(Arrays.asList("connectedSessionId", "id", "created", "applicationId", "profileId", "storeIntegrationId", "type", "attributes", "integrationId", "effects")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("profileId", "integrationId", "type")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "applicationId", "type", "attributes", "effects")); } /** @@ -386,27 +435,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("profileId").isJsonPrimitive()) { + if ((jsonObj.get("connectedSessionId") != null && !jsonObj.get("connectedSessionId").isJsonNull()) && !jsonObj.get("connectedSessionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `connectedSessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectedSessionId").toString())); + } + if ((jsonObj.get("profileId") != null && !jsonObj.get("profileId").isJsonNull()) && !jsonObj.get("profileId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `profileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profileId").toString())); } if ((jsonObj.get("storeIntegrationId") != null && !jsonObj.get("storeIntegrationId").isJsonNull()) && !jsonObj.get("storeIntegrationId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `storeIntegrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeIntegrationId").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("evaluableCampaignIds") != null && !jsonObj.get("evaluableCampaignIds").isJsonNull() && !jsonObj.get("evaluableCampaignIds").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evaluableCampaignIds` to be an array in the JSON string but got `%s`", jsonObj.get("evaluableCampaignIds").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); - } if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } - if ((jsonObj.get("connectedSessionID") != null && !jsonObj.get("connectedSessionID").isJsonNull()) && !jsonObj.get("connectedSessionID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `connectedSessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectedSessionID").toString())); + if ((jsonObj.get("integrationId") != null && !jsonObj.get("integrationId").isJsonNull()) && !jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); } - if ((jsonObj.get("previousEventID") != null && !jsonObj.get("previousEventID").isJsonNull()) && !jsonObj.get("previousEventID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `previousEventID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previousEventID").toString())); + // ensure the required json array is present + if (jsonObj.get("effects") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("effects").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `effects` to be an array in the JSON string but got `%s`", jsonObj.get("effects").toString())); } } diff --git a/src/main/java/one/talon/model/EventV3Connections.java b/src/main/java/one/talon/model/EventV3Connections.java new file mode 100644 index 00000000..bab11545 --- /dev/null +++ b/src/main/java/one/talon/model/EventV3Connections.java @@ -0,0 +1,283 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * EventV3Connections + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class EventV3Connections { + public static final String SERIALIZED_NAME_CONNECTED_SESSION_ID = "connectedSessionId"; + @SerializedName(SERIALIZED_NAME_CONNECTED_SESSION_ID) + @javax.annotation.Nullable + private String connectedSessionId; + + public EventV3Connections() { + } + + public EventV3Connections connectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; + return this; + } + + /** + * The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. + * @return connectedSessionId + */ + @javax.annotation.Nullable + public String getConnectedSessionId() { + return connectedSessionId; + } + + public void setConnectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EventV3Connections instance itself + */ + public EventV3Connections putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventV3Connections eventV3Connections = (EventV3Connections) o; + return Objects.equals(this.connectedSessionId, eventV3Connections.connectedSessionId)&& + Objects.equals(this.additionalProperties, eventV3Connections.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectedSessionId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventV3Connections {\n"); + sb.append(" connectedSessionId: ").append(toIndentedString(connectedSessionId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("connectedSessionId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventV3Connections + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventV3Connections.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in EventV3Connections is not found in the empty JSON string", EventV3Connections.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("connectedSessionId") != null && !jsonObj.get("connectedSessionId").isJsonNull()) && !jsonObj.get("connectedSessionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `connectedSessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectedSessionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventV3Connections.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventV3Connections' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventV3Connections.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventV3Connections value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EventV3Connections read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventV3Connections instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventV3Connections given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventV3Connections + * @throws IOException if the JSON string is invalid with respect to EventV3Connections + */ + public static EventV3Connections fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventV3Connections.class); + } + + /** + * Convert an instance of EventV3Connections to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/EventV3Entity.java b/src/main/java/one/talon/model/EventV3Entity.java new file mode 100644 index 00000000..2e3ee69a --- /dev/null +++ b/src/main/java/one/talon/model/EventV3Entity.java @@ -0,0 +1,283 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * EventV3Entity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class EventV3Entity { + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + @javax.annotation.Nullable + private String integrationId; + + public EventV3Entity() { + } + + public EventV3Entity integrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId + */ + @javax.annotation.Nullable + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(@javax.annotation.Nullable String integrationId) { + this.integrationId = integrationId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EventV3Entity instance itself + */ + public EventV3Entity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventV3Entity eventV3Entity = (EventV3Entity) o; + return Objects.equals(this.integrationId, eventV3Entity.integrationId)&& + Objects.equals(this.additionalProperties, eventV3Entity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(integrationId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventV3Entity {\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("integrationId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventV3Entity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventV3Entity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in EventV3Entity is not found in the empty JSON string", EventV3Entity.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("integrationId") != null && !jsonObj.get("integrationId").isJsonNull()) && !jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventV3Entity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventV3Entity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventV3Entity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventV3Entity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EventV3Entity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventV3Entity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventV3Entity given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventV3Entity + * @throws IOException if the JSON string is invalid with respect to EventV3Entity + */ + public static EventV3Entity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventV3Entity.class); + } + + /** + * Convert an instance of EventV3Entity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/EventV3RequestEntity.java b/src/main/java/one/talon/model/EventV3RequestEntity.java new file mode 100644 index 00000000..4d60c0e3 --- /dev/null +++ b/src/main/java/one/talon/model/EventV3RequestEntity.java @@ -0,0 +1,472 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * EventV3RequestEntity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class EventV3RequestEntity { + public static final String SERIALIZED_NAME_PROFILE_ID = "profileId"; + @SerializedName(SERIALIZED_NAME_PROFILE_ID) + @javax.annotation.Nonnull + private String profileId; + + public static final String SERIALIZED_NAME_STORE_INTEGRATION_ID = "storeIntegrationId"; + @SerializedName(SERIALIZED_NAME_STORE_INTEGRATION_ID) + @javax.annotation.Nullable + private String storeIntegrationId; + + public static final String SERIALIZED_NAME_EVALUABLE_CAMPAIGN_IDS = "evaluableCampaignIds"; + @SerializedName(SERIALIZED_NAME_EVALUABLE_CAMPAIGN_IDS) + @javax.annotation.Nullable + private List evaluableCampaignIds; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private Object attributes; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + @javax.annotation.Nonnull + private String integrationId; + + public static final String SERIALIZED_NAME_CONNECTED_SESSION_ID = "connectedSessionId"; + @SerializedName(SERIALIZED_NAME_CONNECTED_SESSION_ID) + @javax.annotation.Nullable + private String connectedSessionId; + + public EventV3RequestEntity() { + } + + public EventV3RequestEntity profileId(@javax.annotation.Nonnull String profileId) { + this.profileId = profileId; + return this; + } + + /** + * ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. + * @return profileId + */ + @javax.annotation.Nonnull + public String getProfileId() { + return profileId; + } + + public void setProfileId(@javax.annotation.Nonnull String profileId) { + this.profileId = profileId; + } + + + public EventV3RequestEntity storeIntegrationId(@javax.annotation.Nullable String storeIntegrationId) { + this.storeIntegrationId = storeIntegrationId; + return this; + } + + /** + * The integration ID of the store. You choose this ID when you create a store. + * @return storeIntegrationId + */ + @javax.annotation.Nullable + public String getStoreIntegrationId() { + return storeIntegrationId; + } + + public void setStoreIntegrationId(@javax.annotation.Nullable String storeIntegrationId) { + this.storeIntegrationId = storeIntegrationId; + } + + + public EventV3RequestEntity evaluableCampaignIds(@javax.annotation.Nullable List evaluableCampaignIds) { + this.evaluableCampaignIds = evaluableCampaignIds; + return this; + } + + public EventV3RequestEntity addEvaluableCampaignIdsItem(Long evaluableCampaignIdsItem) { + if (this.evaluableCampaignIds == null) { + this.evaluableCampaignIds = new ArrayList<>(); + } + this.evaluableCampaignIds.add(evaluableCampaignIdsItem); + return this; + } + + /** + * When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. + * @return evaluableCampaignIds + */ + @javax.annotation.Nullable + public List getEvaluableCampaignIds() { + return evaluableCampaignIds; + } + + public void setEvaluableCampaignIds(@javax.annotation.Nullable List evaluableCampaignIds) { + this.evaluableCampaignIds = evaluableCampaignIds; + } + + + public EventV3RequestEntity type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public EventV3RequestEntity attributes(@javax.annotation.Nullable Object attributes) { + this.attributes = attributes; + return this; + } + + /** + * Arbitrary additional JSON properties associated with the event. They must be created in the Campaign Manager before setting them with this property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute). + * @return attributes + */ + @javax.annotation.Nullable + public Object getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable Object attributes) { + this.attributes = attributes; + } + + + public EventV3RequestEntity integrationId(@javax.annotation.Nonnull String integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId + */ + @javax.annotation.Nonnull + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(@javax.annotation.Nonnull String integrationId) { + this.integrationId = integrationId; + } + + + public EventV3RequestEntity connectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; + return this; + } + + /** + * The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. + * @return connectedSessionId + */ + @javax.annotation.Nullable + public String getConnectedSessionId() { + return connectedSessionId; + } + + public void setConnectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EventV3RequestEntity instance itself + */ + public EventV3RequestEntity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventV3RequestEntity eventV3RequestEntity = (EventV3RequestEntity) o; + return Objects.equals(this.profileId, eventV3RequestEntity.profileId) && + Objects.equals(this.storeIntegrationId, eventV3RequestEntity.storeIntegrationId) && + Objects.equals(this.evaluableCampaignIds, eventV3RequestEntity.evaluableCampaignIds) && + Objects.equals(this.type, eventV3RequestEntity.type) && + Objects.equals(this.attributes, eventV3RequestEntity.attributes) && + Objects.equals(this.integrationId, eventV3RequestEntity.integrationId) && + Objects.equals(this.connectedSessionId, eventV3RequestEntity.connectedSessionId)&& + Objects.equals(this.additionalProperties, eventV3RequestEntity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(profileId, storeIntegrationId, evaluableCampaignIds, type, attributes, integrationId, connectedSessionId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventV3RequestEntity {\n"); + sb.append(" profileId: ").append(toIndentedString(profileId)).append("\n"); + sb.append(" storeIntegrationId: ").append(toIndentedString(storeIntegrationId)).append("\n"); + sb.append(" evaluableCampaignIds: ").append(toIndentedString(evaluableCampaignIds)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" connectedSessionId: ").append(toIndentedString(connectedSessionId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "integrationId", "connectedSessionId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("profileId", "type", "integrationId")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventV3RequestEntity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventV3RequestEntity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in EventV3RequestEntity is not found in the empty JSON string", EventV3RequestEntity.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventV3RequestEntity.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("profileId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `profileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profileId").toString())); + } + if ((jsonObj.get("storeIntegrationId") != null && !jsonObj.get("storeIntegrationId").isJsonNull()) && !jsonObj.get("storeIntegrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `storeIntegrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeIntegrationId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("evaluableCampaignIds") != null && !jsonObj.get("evaluableCampaignIds").isJsonNull() && !jsonObj.get("evaluableCampaignIds").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evaluableCampaignIds` to be an array in the JSON string but got `%s`", jsonObj.get("evaluableCampaignIds").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); + } + if ((jsonObj.get("connectedSessionId") != null && !jsonObj.get("connectedSessionId").isJsonNull()) && !jsonObj.get("connectedSessionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `connectedSessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectedSessionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventV3RequestEntity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventV3RequestEntity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventV3RequestEntity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventV3RequestEntity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EventV3RequestEntity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventV3RequestEntity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventV3RequestEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventV3RequestEntity + * @throws IOException if the JSON string is invalid with respect to EventV3RequestEntity + */ + public static EventV3RequestEntity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventV3RequestEntity.class); + } + + /** + * Convert an instance of EventV3RequestEntity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/Experiment.java b/src/main/java/one/talon/model/Experiment.java index 6b97fc60..64de43f6 100644 --- a/src/main/java/one/talon/model/Experiment.java +++ b/src/main/java/one/talon/model/Experiment.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.Campaign; import one.talon.model.ExperimentVariant; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -150,6 +149,72 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private List variants; + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. + */ + @JsonAdapter(GoalTypeEnum.Adapter.class) + public enum GoalTypeEnum { + OTHER("other"), + + MAXIMIZE_REVENUE("maximize_revenue"), + + OPTIMIZE_DISCOUNT_EFFICIENCY("optimize_discount_efficiency"), + + MAXIMIZE_ITEMS_SOLD("maximize_items_sold"); + + private String value; + + GoalTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GoalTypeEnum fromValue(String value) { + for (GoalTypeEnum b : GoalTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GoalTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GoalTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GoalTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GoalTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GOAL_TYPE = "goalType"; + @SerializedName(SERIALIZED_NAME_GOAL_TYPE) + @javax.annotation.Nonnull + private GoalTypeEnum goalType; + + public static final String SERIALIZED_NAME_GOAL_DESCRIPTION = "goalDescription"; + @SerializedName(SERIALIZED_NAME_GOAL_DESCRIPTION) + @javax.annotation.Nullable + private String goalDescription; + public static final String SERIALIZED_NAME_DELETEDAT = "deletedat"; @SerializedName(SERIALIZED_NAME_DELETEDAT) @javax.annotation.Nullable @@ -318,6 +383,44 @@ public void setVariants(@javax.annotation.Nullable List varia } + public Experiment goalType(@javax.annotation.Nonnull GoalTypeEnum goalType) { + this.goalType = goalType; + return this; + } + + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. + * @return goalType + */ + @javax.annotation.Nonnull + public GoalTypeEnum getGoalType() { + return goalType; + } + + public void setGoalType(@javax.annotation.Nonnull GoalTypeEnum goalType) { + this.goalType = goalType; + } + + + public Experiment goalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + return this; + } + + /** + * A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. + * @return goalDescription + */ + @javax.annotation.Nullable + public String getGoalDescription() { + return goalDescription; + } + + public void setGoalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + } + + public Experiment deletedat(@javax.annotation.Nullable OffsetDateTime deletedat) { this.deletedat = deletedat; return this; @@ -399,13 +502,15 @@ public boolean equals(Object o) { Objects.equals(this.activated, experiment.activated) && Objects.equals(this.state, experiment.state) && Objects.equals(this.variants, experiment.variants) && + Objects.equals(this.goalType, experiment.goalType) && + Objects.equals(this.goalDescription, experiment.goalDescription) && Objects.equals(this.deletedat, experiment.deletedat)&& Objects.equals(this.additionalProperties, experiment.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, created, applicationId, isVariantAssignmentExternal, campaign, activated, state, variants, deletedat, additionalProperties); + return Objects.hash(id, created, applicationId, isVariantAssignmentExternal, campaign, activated, state, variants, goalType, goalDescription, deletedat, additionalProperties); } @Override @@ -420,6 +525,8 @@ public String toString() { sb.append(" activated: ").append(toIndentedString(activated)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" variants: ").append(toIndentedString(variants)).append("\n"); + sb.append(" goalType: ").append(toIndentedString(goalType)).append("\n"); + sb.append(" goalDescription: ").append(toIndentedString(goalDescription)).append("\n"); sb.append(" deletedat: ").append(toIndentedString(deletedat)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -431,10 +538,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -443,10 +547,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "created", "applicationId", "isVariantAssignmentExternal", "campaign", "activated", "state", "variants", "deletedat")); + openapiFields = new HashSet(Arrays.asList("id", "created", "applicationId", "isVariantAssignmentExternal", "campaign", "activated", "state", "variants", "goalType", "goalDescription", "deletedat")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "applicationId", "state")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "applicationId", "state", "goalType")); } /** @@ -492,6 +596,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } + if (!jsonObj.get("goalType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalType").toString())); + } + // validate the required field `goalType` + GoalTypeEnum.validateJsonElement(jsonObj.get("goalType")); + if ((jsonObj.get("goalDescription") != null && !jsonObj.get("goalDescription").isJsonNull()) && !jsonObj.get("goalDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalDescription").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/ExperimentCampaignCopy.java b/src/main/java/one/talon/model/ExperimentCampaignCopy.java index 2aa21a49..2fb0ec5c 100644 --- a/src/main/java/one/talon/model/ExperimentCampaignCopy.java +++ b/src/main/java/one/talon/model/ExperimentCampaignCopy.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -297,10 +296,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentCopy.java b/src/main/java/one/talon/model/ExperimentCopy.java index 492a15e7..915cd3f5 100644 --- a/src/main/java/one/talon/model/ExperimentCopy.java +++ b/src/main/java/one/talon/model/ExperimentCopy.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ExperimentCopyExperiment; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentCopyExperiment.java b/src/main/java/one/talon/model/ExperimentCopyExperiment.java index 0650feba..4e59e900 100644 --- a/src/main/java/one/talon/model/ExperimentCopyExperiment.java +++ b/src/main/java/one/talon/model/ExperimentCopyExperiment.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ExperimentCampaignCopy; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,6 +61,72 @@ public class ExperimentCopyExperiment { @javax.annotation.Nonnull private ExperimentCampaignCopy campaign; + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the value from the source experiment is used. + */ + @JsonAdapter(GoalTypeEnum.Adapter.class) + public enum GoalTypeEnum { + OTHER("other"), + + MAXIMIZE_REVENUE("maximize_revenue"), + + MAXIMIZE_ITEMS_SOLD("maximize_items_sold"), + + OPTIMIZE_DISCOUNT_EFFICIENCY("optimize_discount_efficiency"); + + private String value; + + GoalTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GoalTypeEnum fromValue(String value) { + for (GoalTypeEnum b : GoalTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GoalTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GoalTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GoalTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GoalTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GOAL_TYPE = "goalType"; + @SerializedName(SERIALIZED_NAME_GOAL_TYPE) + @javax.annotation.Nullable + private GoalTypeEnum goalType; + + public static final String SERIALIZED_NAME_GOAL_DESCRIPTION = "goalDescription"; + @SerializedName(SERIALIZED_NAME_GOAL_DESCRIPTION) + @javax.annotation.Nullable + private String goalDescription; + public ExperimentCopyExperiment() { } @@ -102,6 +167,44 @@ public void setCampaign(@javax.annotation.Nonnull ExperimentCampaignCopy campaig this.campaign = campaign; } + + public ExperimentCopyExperiment goalType(@javax.annotation.Nullable GoalTypeEnum goalType) { + this.goalType = goalType; + return this; + } + + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the value from the source experiment is used. + * @return goalType + */ + @javax.annotation.Nullable + public GoalTypeEnum getGoalType() { + return goalType; + } + + public void setGoalType(@javax.annotation.Nullable GoalTypeEnum goalType) { + this.goalType = goalType; + } + + + public ExperimentCopyExperiment goalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + return this; + } + + /** + * A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the value from the source experiment is used. + * @return goalDescription + */ + @javax.annotation.Nullable + public String getGoalDescription() { + return goalDescription; + } + + public void setGoalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -158,13 +261,15 @@ public boolean equals(Object o) { } ExperimentCopyExperiment experimentCopyExperiment = (ExperimentCopyExperiment) o; return Objects.equals(this.isVariantAssignmentExternal, experimentCopyExperiment.isVariantAssignmentExternal) && - Objects.equals(this.campaign, experimentCopyExperiment.campaign)&& + Objects.equals(this.campaign, experimentCopyExperiment.campaign) && + Objects.equals(this.goalType, experimentCopyExperiment.goalType) && + Objects.equals(this.goalDescription, experimentCopyExperiment.goalDescription)&& Objects.equals(this.additionalProperties, experimentCopyExperiment.additionalProperties); } @Override public int hashCode() { - return Objects.hash(isVariantAssignmentExternal, campaign, additionalProperties); + return Objects.hash(isVariantAssignmentExternal, campaign, goalType, goalDescription, additionalProperties); } @Override @@ -173,6 +278,8 @@ public String toString() { sb.append("class ExperimentCopyExperiment {\n"); sb.append(" isVariantAssignmentExternal: ").append(toIndentedString(isVariantAssignmentExternal)).append("\n"); sb.append(" campaign: ").append(toIndentedString(campaign)).append("\n"); + sb.append(" goalType: ").append(toIndentedString(goalType)).append("\n"); + sb.append(" goalDescription: ").append(toIndentedString(goalDescription)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -183,10 +290,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -195,7 +299,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign")); + openapiFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign", "goalType", "goalDescription")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign")); @@ -223,6 +327,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `campaign` ExperimentCampaignCopy.validateJsonElement(jsonObj.get("campaign")); + if ((jsonObj.get("goalType") != null && !jsonObj.get("goalType").isJsonNull()) && !jsonObj.get("goalType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalType").toString())); + } + // validate the optional field `goalType` + if (jsonObj.get("goalType") != null && !jsonObj.get("goalType").isJsonNull()) { + GoalTypeEnum.validateJsonElement(jsonObj.get("goalType")); + } + if ((jsonObj.get("goalDescription") != null && !jsonObj.get("goalDescription").isJsonNull()) && !jsonObj.get("goalDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalDescription").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/ExperimentListResults.java b/src/main/java/one/talon/model/ExperimentListResults.java index 757723a0..23202785 100644 --- a/src/main/java/one/talon/model/ExperimentListResults.java +++ b/src/main/java/one/talon/model/ExperimentListResults.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExperimentResult; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentListResultsRequest.java b/src/main/java/one/talon/model/ExperimentListResultsRequest.java index 8d7e369c..9ef2526d 100644 --- a/src/main/java/one/talon/model/ExperimentListResultsRequest.java +++ b/src/main/java/one/talon/model/ExperimentListResultsRequest.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentResult.java b/src/main/java/one/talon/model/ExperimentResult.java index d1041008..7446b42f 100644 --- a/src/main/java/one/talon/model/ExperimentResult.java +++ b/src/main/java/one/talon/model/ExperimentResult.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.ExperimentVariantResult; import one.talon.model.ExperimentVariantResultConfidence; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -220,10 +219,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentResults.java b/src/main/java/one/talon/model/ExperimentResults.java index ef9dd070..a25fb784 100644 --- a/src/main/java/one/talon/model/ExperimentResults.java +++ b/src/main/java/one/talon/model/ExperimentResults.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.ExperimentVariantResult; import one.talon.model.ExperimentVariantResultConfidence; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentSegmentInsight.java b/src/main/java/one/talon/model/ExperimentSegmentInsight.java index dec1f24c..7e6c8183 100644 --- a/src/main/java/one/talon/model/ExperimentSegmentInsight.java +++ b/src/main/java/one/talon/model/ExperimentSegmentInsight.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExperimentSegmentInsightVariant; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -387,10 +386,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentSegmentInsightMetric.java b/src/main/java/one/talon/model/ExperimentSegmentInsightMetric.java index ce6dc117..d693c647 100644 --- a/src/main/java/one/talon/model/ExperimentSegmentInsightMetric.java +++ b/src/main/java/one/talon/model/ExperimentSegmentInsightMetric.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExperimentSegmentInsight; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -247,10 +246,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentSegmentInsightVariant.java b/src/main/java/one/talon/model/ExperimentSegmentInsightVariant.java index c61a1e65..1be8e79f 100644 --- a/src/main/java/one/talon/model/ExperimentSegmentInsightVariant.java +++ b/src/main/java/one/talon/model/ExperimentSegmentInsightVariant.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentSegmentInsights.java b/src/main/java/one/talon/model/ExperimentSegmentInsights.java index b31b8d70..147c4afc 100644 --- a/src/main/java/one/talon/model/ExperimentSegmentInsights.java +++ b/src/main/java/one/talon/model/ExperimentSegmentInsights.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExperimentSegmentInsightMetric; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentVariant.java b/src/main/java/one/talon/model/ExperimentVariant.java index 51060207..dbfbec0f 100644 --- a/src/main/java/one/talon/model/ExperimentVariant.java +++ b/src/main/java/one/talon/model/ExperimentVariant.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -314,10 +313,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentVariantAllocation.java b/src/main/java/one/talon/model/ExperimentVariantAllocation.java index adf885d3..067d0f4f 100644 --- a/src/main/java/one/talon/model/ExperimentVariantAllocation.java +++ b/src/main/java/one/talon/model/ExperimentVariantAllocation.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentVariantResult.java b/src/main/java/one/talon/model/ExperimentVariantResult.java index b54bdd86..3576af89 100644 --- a/src/main/java/one/talon/model/ExperimentVariantResult.java +++ b/src/main/java/one/talon/model/ExperimentVariantResult.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -417,10 +416,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentVariantResultConfidence.java b/src/main/java/one/talon/model/ExperimentVariantResultConfidence.java index 075cf8c1..c8df433c 100644 --- a/src/main/java/one/talon/model/ExperimentVariantResultConfidence.java +++ b/src/main/java/one/talon/model/ExperimentVariantResultConfidence.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentVerdict.java b/src/main/java/one/talon/model/ExperimentVerdict.java index fe25d74e..0208097a 100644 --- a/src/main/java/one/talon/model/ExperimentVerdict.java +++ b/src/main/java/one/talon/model/ExperimentVerdict.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -270,10 +269,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExperimentVerdictResponse.java b/src/main/java/one/talon/model/ExperimentVerdictResponse.java index 5c8d5f87..6f83c3da 100644 --- a/src/main/java/one/talon/model/ExperimentVerdictResponse.java +++ b/src/main/java/one/talon/model/ExperimentVerdictResponse.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.ExperimentVerdict; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -184,10 +183,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringCardPointsData.java b/src/main/java/one/talon/model/ExpiringCardPointsData.java index 8b10dc4a..4a31f6b4 100644 --- a/src/main/java/one/talon/model/ExpiringCardPointsData.java +++ b/src/main/java/one/talon/model/ExpiringCardPointsData.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -326,10 +325,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringCardPointsNotification.java b/src/main/java/one/talon/model/ExpiringCardPointsNotification.java index 14751ed4..78e49c87 100644 --- a/src/main/java/one/talon/model/ExpiringCardPointsNotification.java +++ b/src/main/java/one/talon/model/ExpiringCardPointsNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExpiringCardPointsData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringCouponsData.java b/src/main/java/one/talon/model/ExpiringCouponsData.java index 7a3ad05c..081d8c1c 100644 --- a/src/main/java/one/talon/model/ExpiringCouponsData.java +++ b/src/main/java/one/talon/model/ExpiringCouponsData.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -404,10 +403,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringCouponsNotification.java b/src/main/java/one/talon/model/ExpiringCouponsNotification.java index d55ca925..6d94018f 100644 --- a/src/main/java/one/talon/model/ExpiringCouponsNotification.java +++ b/src/main/java/one/talon/model/ExpiringCouponsNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExpiringCouponsData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringCouponsNotificationPolicy.java b/src/main/java/one/talon/model/ExpiringCouponsNotificationPolicy.java index 110b6e16..40ed41ff 100644 --- a/src/main/java/one/talon/model/ExpiringCouponsNotificationPolicy.java +++ b/src/main/java/one/talon/model/ExpiringCouponsNotificationPolicy.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExpiringCouponsNotificationTrigger; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringCouponsNotificationTrigger.java b/src/main/java/one/talon/model/ExpiringCouponsNotificationTrigger.java index 3f211cdb..fa5ff445 100644 --- a/src/main/java/one/talon/model/ExpiringCouponsNotificationTrigger.java +++ b/src/main/java/one/talon/model/ExpiringCouponsNotificationTrigger.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringPointsData.java b/src/main/java/one/talon/model/ExpiringPointsData.java index 9fc0dec9..093fac02 100644 --- a/src/main/java/one/talon/model/ExpiringPointsData.java +++ b/src/main/java/one/talon/model/ExpiringPointsData.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -263,10 +262,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringPointsNotification.java b/src/main/java/one/talon/model/ExpiringPointsNotification.java index 4c9f2a46..3b0ff8e2 100644 --- a/src/main/java/one/talon/model/ExpiringPointsNotification.java +++ b/src/main/java/one/talon/model/ExpiringPointsNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExpiringPointsData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringPointsNotificationPolicy.java b/src/main/java/one/talon/model/ExpiringPointsNotificationPolicy.java index c024e263..cd1bf751 100644 --- a/src/main/java/one/talon/model/ExpiringPointsNotificationPolicy.java +++ b/src/main/java/one/talon/model/ExpiringPointsNotificationPolicy.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ExpiringPointsNotificationTrigger; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExpiringPointsNotificationTrigger.java b/src/main/java/one/talon/model/ExpiringPointsNotificationTrigger.java index 00466590..41cf71f8 100644 --- a/src/main/java/one/talon/model/ExpiringPointsNotificationTrigger.java +++ b/src/main/java/one/talon/model/ExpiringPointsNotificationTrigger.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Export.java b/src/main/java/one/talon/model/Export.java index 55021e34..10b29cef 100644 --- a/src/main/java/one/talon/model/Export.java +++ b/src/main/java/one/talon/model/Export.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -349,10 +348,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExtendLoyaltyPointsExpiryDateEffectProps.java b/src/main/java/one/talon/model/ExtendLoyaltyPointsExpiryDateEffectProps.java index ef850bd2..ba91395e 100644 --- a/src/main/java/one/talon/model/ExtendLoyaltyPointsExpiryDateEffectProps.java +++ b/src/main/java/one/talon/model/ExtendLoyaltyPointsExpiryDateEffectProps.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyLedgerEntryExpiryDateChange; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ExtendedCoupon.java b/src/main/java/one/talon/model/ExtendedCoupon.java index 6e2dcc25..cfb6cbc8 100644 --- a/src/main/java/one/talon/model/ExtendedCoupon.java +++ b/src/main/java/one/talon/model/ExtendedCoupon.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -747,10 +746,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/FeatureFlag.java b/src/main/java/one/talon/model/FeatureFlag.java index bd4a693a..a134d1c3 100644 --- a/src/main/java/one/talon/model/FeatureFlag.java +++ b/src/main/java/one/talon/model/FeatureFlag.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/FeatureFlagUpdate.java b/src/main/java/one/talon/model/FeatureFlagUpdate.java new file mode 100644 index 00000000..17dd3ff1 --- /dev/null +++ b/src/main/java/one/talon/model/FeatureFlagUpdate.java @@ -0,0 +1,319 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * FeatureFlagUpdate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class FeatureFlagUpdate { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public FeatureFlagUpdate() { + } + + public FeatureFlagUpdate name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the feature flag. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public FeatureFlagUpdate value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The value of the feature flag. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FeatureFlagUpdate instance itself + */ + public FeatureFlagUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FeatureFlagUpdate featureFlagUpdate = (FeatureFlagUpdate) o; + return Objects.equals(this.name, featureFlagUpdate.name) && + Objects.equals(this.value, featureFlagUpdate.value)&& + Objects.equals(this.additionalProperties, featureFlagUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FeatureFlagUpdate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "value")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FeatureFlagUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FeatureFlagUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in FeatureFlagUpdate is not found in the empty JSON string", FeatureFlagUpdate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FeatureFlagUpdate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FeatureFlagUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FeatureFlagUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FeatureFlagUpdate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FeatureFlagUpdate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FeatureFlagUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FeatureFlagUpdate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FeatureFlagUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of FeatureFlagUpdate + * @throws IOException if the JSON string is invalid with respect to FeatureFlagUpdate + */ + public static FeatureFlagUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FeatureFlagUpdate.class); + } + + /** + * Convert an instance of FeatureFlagUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/FeaturesFeed.java b/src/main/java/one/talon/model/FeaturesFeed.java index e537f6e2..21cb0915 100644 --- a/src/main/java/one/talon/model/FeaturesFeed.java +++ b/src/main/java/one/talon/model/FeaturesFeed.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/FuncArgDef.java b/src/main/java/one/talon/model/FuncArgDef.java index 2808d68a..408c102d 100644 --- a/src/main/java/one/talon/model/FuncArgDef.java +++ b/src/main/java/one/talon/model/FuncArgDef.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -242,10 +241,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/FunctionDef.java b/src/main/java/one/talon/model/FunctionDef.java index a4655341..3b59c262 100644 --- a/src/main/java/one/talon/model/FunctionDef.java +++ b/src/main/java/one/talon/model/FunctionDef.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.FuncArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -271,10 +270,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateAuditLogSummary.java b/src/main/java/one/talon/model/GenerateAuditLogSummary.java index 0e2fd538..c6faabc7 100644 --- a/src/main/java/one/talon/model/GenerateAuditLogSummary.java +++ b/src/main/java/one/talon/model/GenerateAuditLogSummary.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateCampaignDescription.java b/src/main/java/one/talon/model/GenerateCampaignDescription.java index 7f4615bf..17fe6471 100644 --- a/src/main/java/one/talon/model/GenerateCampaignDescription.java +++ b/src/main/java/one/talon/model/GenerateCampaignDescription.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateCampaignSummary.java b/src/main/java/one/talon/model/GenerateCampaignSummary.java index 396e4df0..1b4bb645 100644 --- a/src/main/java/one/talon/model/GenerateCampaignSummary.java +++ b/src/main/java/one/talon/model/GenerateCampaignSummary.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateCampaignTags.java b/src/main/java/one/talon/model/GenerateCampaignTags.java index 5b0937b8..98592bd5 100644 --- a/src/main/java/one/talon/model/GenerateCampaignTags.java +++ b/src/main/java/one/talon/model/GenerateCampaignTags.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateCouponFailureDetailedSummary.java b/src/main/java/one/talon/model/GenerateCouponFailureDetailedSummary.java index 67fd152f..a46146eb 100644 --- a/src/main/java/one/talon/model/GenerateCouponFailureDetailedSummary.java +++ b/src/main/java/one/talon/model/GenerateCouponFailureDetailedSummary.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateCouponFailureSummary.java b/src/main/java/one/talon/model/GenerateCouponFailureSummary.java index aa0fd8b0..345c7a08 100644 --- a/src/main/java/one/talon/model/GenerateCouponFailureSummary.java +++ b/src/main/java/one/talon/model/GenerateCouponFailureSummary.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateCouponRejections200Response.java b/src/main/java/one/talon/model/GenerateCouponRejections200Response.java index 6851287c..27ece9fe 100644 --- a/src/main/java/one/talon/model/GenerateCouponRejections200Response.java +++ b/src/main/java/one/talon/model/GenerateCouponRejections200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CouponFailureSummary; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateItemFilterDescription.java b/src/main/java/one/talon/model/GenerateItemFilterDescription.java index 44b1eb81..6174dbc5 100644 --- a/src/main/java/one/talon/model/GenerateItemFilterDescription.java +++ b/src/main/java/one/talon/model/GenerateItemFilterDescription.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateLoyaltyCard.java b/src/main/java/one/talon/model/GenerateLoyaltyCard.java index fc7fda67..b9bcd3bf 100644 --- a/src/main/java/one/talon/model/GenerateLoyaltyCard.java +++ b/src/main/java/one/talon/model/GenerateLoyaltyCard.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -270,10 +269,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateRuleTitle.java b/src/main/java/one/talon/model/GenerateRuleTitle.java index e8c2c475..0e709705 100644 --- a/src/main/java/one/talon/model/GenerateRuleTitle.java +++ b/src/main/java/one/talon/model/GenerateRuleTitle.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.GenerateRuleTitleRule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateRuleTitleRule.java b/src/main/java/one/talon/model/GenerateRuleTitleRule.java index 29439eb8..ba801e3b 100644 --- a/src/main/java/one/talon/model/GenerateRuleTitleRule.java +++ b/src/main/java/one/talon/model/GenerateRuleTitleRule.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -200,10 +199,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GenerateUserSessionSummary.java b/src/main/java/one/talon/model/GenerateUserSessionSummary.java index 26f821b6..4d3d69d5 100644 --- a/src/main/java/one/talon/model/GenerateUserSessionSummary.java +++ b/src/main/java/one/talon/model/GenerateUserSessionSummary.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetAccessLogsWithoutTotalCount200Response.java b/src/main/java/one/talon/model/GetAccessLogsWithoutTotalCount200Response.java index ecfad40f..21586b9a 100644 --- a/src/main/java/one/talon/model/GetAccessLogsWithoutTotalCount200Response.java +++ b/src/main/java/one/talon/model/GetAccessLogsWithoutTotalCount200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AccessLogEntry; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetAdditionalCosts200Response.java b/src/main/java/one/talon/model/GetAdditionalCosts200Response.java index 8c32be4d..f706cd20 100644 --- a/src/main/java/one/talon/model/GetAdditionalCosts200Response.java +++ b/src/main/java/one/talon/model/GetAdditionalCosts200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AccountAdditionalCost; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplicationCustomerFriends200Response.java b/src/main/java/one/talon/model/GetApplicationCustomerFriends200Response.java index 7be54ba5..7da669b8 100644 --- a/src/main/java/one/talon/model/GetApplicationCustomerFriends200Response.java +++ b/src/main/java/one/talon/model/GetApplicationCustomerFriends200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationReferee; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplicationCustomers200Response.java b/src/main/java/one/talon/model/GetApplicationCustomers200Response.java index 9e8b2396..4f323543 100644 --- a/src/main/java/one/talon/model/GetApplicationCustomers200Response.java +++ b/src/main/java/one/talon/model/GetApplicationCustomers200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationCustomer; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplicationCustomersByAttributes200Response.java b/src/main/java/one/talon/model/GetApplicationCustomersByAttributes200Response.java index 22a3a08a..a8322de0 100644 --- a/src/main/java/one/talon/model/GetApplicationCustomersByAttributes200Response.java +++ b/src/main/java/one/talon/model/GetApplicationCustomersByAttributes200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationCustomer; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplicationEventTypes200Response.java b/src/main/java/one/talon/model/GetApplicationEventTypes200Response.java index 94e3f3da..9e5fe713 100644 --- a/src/main/java/one/talon/model/GetApplicationEventTypes200Response.java +++ b/src/main/java/one/talon/model/GetApplicationEventTypes200Response.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplicationEventsWithoutTotalCount200Response.java b/src/main/java/one/talon/model/GetApplicationEventsWithoutTotalCount200Response.java index dd2dd20d..8c2ff706 100644 --- a/src/main/java/one/talon/model/GetApplicationEventsWithoutTotalCount200Response.java +++ b/src/main/java/one/talon/model/GetApplicationEventsWithoutTotalCount200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationEvent; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplicationSessions200Response.java b/src/main/java/one/talon/model/GetApplicationSessions200Response.java index 52a4b0e4..cf448fc9 100644 --- a/src/main/java/one/talon/model/GetApplicationSessions200Response.java +++ b/src/main/java/one/talon/model/GetApplicationSessions200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationSession; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetApplications200Response.java b/src/main/java/one/talon/model/GetApplications200Response.java index 34313aac..3e8c9c90 100644 --- a/src/main/java/one/talon/model/GetApplications200Response.java +++ b/src/main/java/one/talon/model/GetApplications200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Application; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetAttributes200Response.java b/src/main/java/one/talon/model/GetAttributes200Response.java index ba877d2a..e0ea3127 100644 --- a/src/main/java/one/talon/model/GetAttributes200Response.java +++ b/src/main/java/one/talon/model/GetAttributes200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Attribute; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetAudienceMemberships200Response.java b/src/main/java/one/talon/model/GetAudienceMemberships200Response.java index 2154f4dc..06ed9676 100644 --- a/src/main/java/one/talon/model/GetAudienceMemberships200Response.java +++ b/src/main/java/one/talon/model/GetAudienceMemberships200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerProfile; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetAudiences200Response.java b/src/main/java/one/talon/model/GetAudiences200Response.java index ea516c41..ed3ac241 100644 --- a/src/main/java/one/talon/model/GetAudiences200Response.java +++ b/src/main/java/one/talon/model/GetAudiences200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Audience; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetAudiencesAnalytics200Response.java b/src/main/java/one/talon/model/GetAudiencesAnalytics200Response.java index 564f7078..1d67e96b 100644 --- a/src/main/java/one/talon/model/GetAudiencesAnalytics200Response.java +++ b/src/main/java/one/talon/model/GetAudiencesAnalytics200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AudienceAnalytics; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCampaignAnalytics200Response.java b/src/main/java/one/talon/model/GetCampaignAnalytics200Response.java index ea8fa522..47376737 100644 --- a/src/main/java/one/talon/model/GetCampaignAnalytics200Response.java +++ b/src/main/java/one/talon/model/GetCampaignAnalytics200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignAnalytics; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCampaignGroups200Response.java b/src/main/java/one/talon/model/GetCampaignGroups200Response.java index 3162a88b..4ce0a75c 100644 --- a/src/main/java/one/talon/model/GetCampaignGroups200Response.java +++ b/src/main/java/one/talon/model/GetCampaignGroups200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignGroup; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCampaignTemplates200Response.java b/src/main/java/one/talon/model/GetCampaignTemplates200Response.java index d5419c0d..2092e8b8 100644 --- a/src/main/java/one/talon/model/GetCampaignTemplates200Response.java +++ b/src/main/java/one/talon/model/GetCampaignTemplates200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignTemplate; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCampaigns200Response.java b/src/main/java/one/talon/model/GetCampaigns200Response.java index dc5f8463..4308365d 100644 --- a/src/main/java/one/talon/model/GetCampaigns200Response.java +++ b/src/main/java/one/talon/model/GetCampaigns200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Campaign; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetChanges200Response.java b/src/main/java/one/talon/model/GetChanges200Response.java index af50d5f9..08ef7eb5 100644 --- a/src/main/java/one/talon/model/GetChanges200Response.java +++ b/src/main/java/one/talon/model/GetChanges200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Change; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCollectionItems200Response.java b/src/main/java/one/talon/model/GetCollectionItems200Response.java index a421f0b5..c1277dcc 100644 --- a/src/main/java/one/talon/model/GetCollectionItems200Response.java +++ b/src/main/java/one/talon/model/GetCollectionItems200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CollectionItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCouponsWithoutTotalCount200Response.java b/src/main/java/one/talon/model/GetCouponsWithoutTotalCount200Response.java index e106b20e..7dbc969f 100644 --- a/src/main/java/one/talon/model/GetCouponsWithoutTotalCount200Response.java +++ b/src/main/java/one/talon/model/GetCouponsWithoutTotalCount200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Coupon; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCustomerAchievementHistory200Response.java b/src/main/java/one/talon/model/GetCustomerAchievementHistory200Response.java index f357eb74..6a8543d0 100644 --- a/src/main/java/one/talon/model/GetCustomerAchievementHistory200Response.java +++ b/src/main/java/one/talon/model/GetCustomerAchievementHistory200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AchievementProgress; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCustomerAchievements200Response.java b/src/main/java/one/talon/model/GetCustomerAchievements200Response.java index 5d8ec9e9..94de6b71 100644 --- a/src/main/java/one/talon/model/GetCustomerAchievements200Response.java +++ b/src/main/java/one/talon/model/GetCustomerAchievements200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AchievementStatusEntry; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCustomerActivityReportsWithoutTotalCount200Response.java b/src/main/java/one/talon/model/GetCustomerActivityReportsWithoutTotalCount200Response.java index 4ee03757..999e3665 100644 --- a/src/main/java/one/talon/model/GetCustomerActivityReportsWithoutTotalCount200Response.java +++ b/src/main/java/one/talon/model/GetCustomerActivityReportsWithoutTotalCount200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerActivityReport; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCustomerProfileAchievementProgress200Response.java b/src/main/java/one/talon/model/GetCustomerProfileAchievementProgress200Response.java index d898a9c1..48a5415b 100644 --- a/src/main/java/one/talon/model/GetCustomerProfileAchievementProgress200Response.java +++ b/src/main/java/one/talon/model/GetCustomerProfileAchievementProgress200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.AchievementProgressWithDefinition; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCustomerProfiles200Response.java b/src/main/java/one/talon/model/GetCustomerProfiles200Response.java index 6d432d82..680d8f7b 100644 --- a/src/main/java/one/talon/model/GetCustomerProfiles200Response.java +++ b/src/main/java/one/talon/model/GetCustomerProfiles200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerProfile; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetCustomersByAttributes200Response.java b/src/main/java/one/talon/model/GetCustomersByAttributes200Response.java index 71ee7795..7f777a78 100644 --- a/src/main/java/one/talon/model/GetCustomersByAttributes200Response.java +++ b/src/main/java/one/talon/model/GetCustomersByAttributes200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerProfile; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetDashboardStatistics200Response.java b/src/main/java/one/talon/model/GetDashboardStatistics200Response.java index b5e11248..0ce0b320 100644 --- a/src/main/java/one/talon/model/GetDashboardStatistics200Response.java +++ b/src/main/java/one/talon/model/GetDashboardStatistics200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyDashboardData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetEventTypes200Response.java b/src/main/java/one/talon/model/GetEventTypes200Response.java index 7cc61c59..9d87866d 100644 --- a/src/main/java/one/talon/model/GetEventTypes200Response.java +++ b/src/main/java/one/talon/model/GetEventTypes200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.EventType; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetExports200Response.java b/src/main/java/one/talon/model/GetExports200Response.java index 141c886d..4825a053 100644 --- a/src/main/java/one/talon/model/GetExports200Response.java +++ b/src/main/java/one/talon/model/GetExports200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Export; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetIntegrationCouponRequest.java b/src/main/java/one/talon/model/GetIntegrationCouponRequest.java index 34d961b4..a726405f 100644 --- a/src/main/java/one/talon/model/GetIntegrationCouponRequest.java +++ b/src/main/java/one/talon/model/GetIntegrationCouponRequest.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyCardPoints200Response.java b/src/main/java/one/talon/model/GetLoyaltyCardPoints200Response.java index e7f40368..2c568ff9 100644 --- a/src/main/java/one/talon/model/GetLoyaltyCardPoints200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyCardPoints200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CardLedgerPointsEntryIntegrationAPI; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyCardTransactionLogs200Response.java b/src/main/java/one/talon/model/GetLoyaltyCardTransactionLogs200Response.java index 69124617..4f20ca7a 100644 --- a/src/main/java/one/talon/model/GetLoyaltyCardTransactionLogs200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyCardTransactionLogs200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CardLedgerTransactionLogEntry; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyCardTransactions200Response.java b/src/main/java/one/talon/model/GetLoyaltyCardTransactions200Response.java index b29d64a7..8fdcee66 100644 --- a/src/main/java/one/talon/model/GetLoyaltyCardTransactions200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyCardTransactions200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CardLedgerTransactionLogEntryIntegrationAPI; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyCards200Response.java b/src/main/java/one/talon/model/GetLoyaltyCards200Response.java index 02008f8b..629c6085 100644 --- a/src/main/java/one/talon/model/GetLoyaltyCards200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyCards200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyCard; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyProgramProfilePoints200Response.java b/src/main/java/one/talon/model/GetLoyaltyProgramProfilePoints200Response.java index b613a80c..7d6b4ec1 100644 --- a/src/main/java/one/talon/model/GetLoyaltyProgramProfilePoints200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyProgramProfilePoints200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LedgerPointsEntryIntegrationAPI; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyProgramProfileTransactions200Response.java b/src/main/java/one/talon/model/GetLoyaltyProgramProfileTransactions200Response.java index 8d1e4cb3..6263a48e 100644 --- a/src/main/java/one/talon/model/GetLoyaltyProgramProfileTransactions200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyProgramProfileTransactions200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LedgerTransactionLogEntryIntegrationAPI; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyProgramTransactions200Response.java b/src/main/java/one/talon/model/GetLoyaltyProgramTransactions200Response.java index f99bfcf2..e9bffebe 100644 --- a/src/main/java/one/talon/model/GetLoyaltyProgramTransactions200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyProgramTransactions200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyProgramTransaction; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetLoyaltyPrograms200Response.java b/src/main/java/one/talon/model/GetLoyaltyPrograms200Response.java index 0ce1ec3e..57e25575 100644 --- a/src/main/java/one/talon/model/GetLoyaltyPrograms200Response.java +++ b/src/main/java/one/talon/model/GetLoyaltyPrograms200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyProgram; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetReferralsWithoutTotalCount200Response.java b/src/main/java/one/talon/model/GetReferralsWithoutTotalCount200Response.java index 43e424e6..cc592e08 100644 --- a/src/main/java/one/talon/model/GetReferralsWithoutTotalCount200Response.java +++ b/src/main/java/one/talon/model/GetReferralsWithoutTotalCount200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Referral; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetReservedCustomers200Response.java b/src/main/java/one/talon/model/GetReservedCustomers200Response.java index 8f54ce3d..e8098987 100644 --- a/src/main/java/one/talon/model/GetReservedCustomers200Response.java +++ b/src/main/java/one/talon/model/GetReservedCustomers200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerProfile; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetRulesets200Response.java b/src/main/java/one/talon/model/GetRulesets200Response.java index 421ce1c0..afc8460d 100644 --- a/src/main/java/one/talon/model/GetRulesets200Response.java +++ b/src/main/java/one/talon/model/GetRulesets200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Ruleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetUsers200Response.java b/src/main/java/one/talon/model/GetUsers200Response.java index ce8e3668..facc9f35 100644 --- a/src/main/java/one/talon/model/GetUsers200Response.java +++ b/src/main/java/one/talon/model/GetUsers200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.User; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GetWebhooks200Response.java b/src/main/java/one/talon/model/GetWebhooks200Response.java index 766590a2..e6d86e9e 100644 --- a/src/main/java/one/talon/model/GetWebhooks200Response.java +++ b/src/main/java/one/talon/model/GetWebhooks200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.WebhookWithOutgoingIntegrationDetails; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Giveaway.java b/src/main/java/one/talon/model/Giveaway.java index c259ddb9..1cd20721 100644 --- a/src/main/java/one/talon/model/Giveaway.java +++ b/src/main/java/one/talon/model/Giveaway.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -417,10 +416,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GiveawayPoolNotification.java b/src/main/java/one/talon/model/GiveawayPoolNotification.java index 863367e5..f892095e 100644 --- a/src/main/java/one/talon/model/GiveawayPoolNotification.java +++ b/src/main/java/one/talon/model/GiveawayPoolNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.GiveawayPoolNotificationData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GiveawayPoolNotificationData.java b/src/main/java/one/talon/model/GiveawayPoolNotificationData.java index ad8626bf..95de5685 100644 --- a/src/main/java/one/talon/model/GiveawayPoolNotificationData.java +++ b/src/main/java/one/talon/model/GiveawayPoolNotificationData.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -393,10 +392,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/GiveawaysPool.java b/src/main/java/one/talon/model/GiveawaysPool.java index 0854808a..6d057fd9 100644 --- a/src/main/java/one/talon/model/GiveawaysPool.java +++ b/src/main/java/one/talon/model/GiveawaysPool.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -401,10 +400,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/HiddenConditionsEffects.java b/src/main/java/one/talon/model/HiddenConditionsEffects.java index d5e4b004..002206d3 100644 --- a/src/main/java/one/talon/model/HiddenConditionsEffects.java +++ b/src/main/java/one/talon/model/HiddenConditionsEffects.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -268,10 +267,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/History.java b/src/main/java/one/talon/model/History.java index e295d36b..7047627b 100644 --- a/src/main/java/one/talon/model/History.java +++ b/src/main/java/one/talon/model/History.java @@ -22,9 +22,10 @@ import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import one.talon.model.BestPriorPriceMetadata; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -64,10 +65,15 @@ public class History { @javax.annotation.Nonnull private OffsetDateTime observedAt; + public static final String SERIALIZED_NAME_CONTEXT_IDS = "contextIds"; + @SerializedName(SERIALIZED_NAME_CONTEXT_IDS) + @javax.annotation.Nonnull + private List contextIds = new ArrayList<>(); + public static final String SERIALIZED_NAME_CONTEXT_ID = "contextId"; @SerializedName(SERIALIZED_NAME_CONTEXT_ID) - @javax.annotation.Nonnull - private String contextId; + @javax.annotation.Nullable + private String contextId = ""; public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) @@ -125,21 +131,48 @@ public void setObservedAt(@javax.annotation.Nonnull OffsetDateTime observedAt) { } - public History contextId(@javax.annotation.Nonnull String contextId) { + public History contextIds(@javax.annotation.Nonnull List contextIds) { + this.contextIds = contextIds; + return this; + } + + public History addContextIdsItem(String contextIdsItem) { + if (this.contextIds == null) { + this.contextIds = new ArrayList<>(); + } + this.contextIds.add(contextIdsItem); + return this; + } + + /** + * The identifiers of the relevant context at the time the price was observed. Includes the context IDs of any price adjustments and of the campaigns that influenced the final price. + * @return contextIds + */ + @javax.annotation.Nonnull + public List getContextIds() { + return contextIds; + } + + public void setContextIds(@javax.annotation.Nonnull List contextIds) { + this.contextIds = contextIds; + } + + + public History contextId(@javax.annotation.Nullable String contextId) { this.contextId = contextId; return this; } /** - * Identifier of the relevant context at the time the price was observed (e.g. summer sale). + * This property is **deprecated**. Use `contextIds` instead. Defaults to an empty string. * @return contextId */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getContextId() { return contextId; } - public void setContextId(@javax.annotation.Nonnull String contextId) { + public void setContextId(@javax.annotation.Nullable String contextId) { this.contextId = contextId; } @@ -257,6 +290,7 @@ public boolean equals(Object o) { History history = (History) o; return Objects.equals(this.id, history.id) && Objects.equals(this.observedAt, history.observedAt) && + Objects.equals(this.contextIds, history.contextIds) && Objects.equals(this.contextId, history.contextId) && Objects.equals(this.price, history.price) && Objects.equals(this.metadata, history.metadata) && @@ -266,7 +300,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, observedAt, contextId, price, metadata, target, additionalProperties); + return Objects.hash(id, observedAt, contextIds, contextId, price, metadata, target, additionalProperties); } @Override @@ -275,6 +309,7 @@ public String toString() { sb.append("class History {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" observedAt: ").append(toIndentedString(observedAt)).append("\n"); + sb.append(" contextIds: ").append(toIndentedString(contextIds)).append("\n"); sb.append(" contextId: ").append(toIndentedString(contextId)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); @@ -289,10 +324,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -301,10 +333,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "observedAt", "contextId", "price", "metadata", "target")); + openapiFields = new HashSet(Arrays.asList("id", "observedAt", "contextIds", "contextId", "price", "metadata", "target")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "observedAt", "contextId", "price", "metadata", "target")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "observedAt", "contextIds", "price", "metadata", "target")); } /** @@ -327,7 +359,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("contextId").isJsonPrimitive()) { + // ensure the required json array is present + if (jsonObj.get("contextIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("contextIds").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `contextIds` to be an array in the JSON string but got `%s`", jsonObj.get("contextIds").toString())); + } + if ((jsonObj.get("contextId") != null && !jsonObj.get("contextId").isJsonNull()) && !jsonObj.get("contextId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `contextId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contextId").toString())); } // validate the required field `metadata` diff --git a/src/main/java/one/talon/model/IdentifiableEntity.java b/src/main/java/one/talon/model/IdentifiableEntity.java index 9b8e236b..ec3fb2ab 100644 --- a/src/main/java/one/talon/model/IdentifiableEntity.java +++ b/src/main/java/one/talon/model/IdentifiableEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ImportEntity.java b/src/main/java/one/talon/model/ImportEntity.java index 86ecd245..6c13c66f 100644 --- a/src/main/java/one/talon/model/ImportEntity.java +++ b/src/main/java/one/talon/model/ImportEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IncreaseAchievementProgressEffectProps.java b/src/main/java/one/talon/model/IncreaseAchievementProgressEffectProps.java index 12d78d40..c1eac714 100644 --- a/src/main/java/one/talon/model/IncreaseAchievementProgressEffectProps.java +++ b/src/main/java/one/talon/model/IncreaseAchievementProgressEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/InfluencingCampaignDetails.java b/src/main/java/one/talon/model/InfluencingCampaignDetails.java index 0367b649..c5b28ac6 100644 --- a/src/main/java/one/talon/model/InfluencingCampaignDetails.java +++ b/src/main/java/one/talon/model/InfluencingCampaignDetails.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationCampaign.java b/src/main/java/one/talon/model/IntegrationCampaign.java index f36083c8..69b0d851 100644 --- a/src/main/java/one/talon/model/IntegrationCampaign.java +++ b/src/main/java/one/talon/model/IntegrationCampaign.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.RuleMetadata; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -217,8 +216,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti public static final String SERIALIZED_NAME_RULES = "rules"; @SerializedName(SERIALIZED_NAME_RULES) - @javax.annotation.Nullable - private List rules; + @javax.annotation.Nonnull + private List rules = new ArrayList<>(); public IntegrationCampaign() { } @@ -429,7 +428,7 @@ public void setFeatures(@javax.annotation.Nonnull List features) { } - public IntegrationCampaign rules(@javax.annotation.Nullable List rules) { + public IntegrationCampaign rules(@javax.annotation.Nonnull List rules) { this.rules = rules; return this; } @@ -446,12 +445,12 @@ public IntegrationCampaign addRulesItem(RuleMetadata rulesItem) { * A list of rules containing customer-facing details of the rewards defined in the campaign. * @return rules */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getRules() { return rules; } - public void setRules(@javax.annotation.Nullable List rules) { + public void setRules(@javax.annotation.Nonnull List rules) { this.rules = rules; } @@ -554,10 +553,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -569,7 +565,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(Arrays.asList("applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features", "rules")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("applicationId", "id", "name", "state", "tags", "features")); + openapiRequiredFields = new HashSet(Arrays.asList("applicationId", "id", "name", "state", "tags", "features", "rules")); } /** @@ -615,18 +611,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else if (!jsonObj.get("features").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); } - if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { + if (jsonObj.get("rules") != null) { + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); + } JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); - if (jsonArrayrules != null) { - // ensure the json data is an array - if (!jsonObj.get("rules").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); - } - - // validate the optional field `rules` (array) - for (int i = 0; i < jsonArrayrules.size(); i++) { - RuleMetadata.validateJsonElement(jsonArrayrules.get(i)); - }; + // validate the required field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + RuleMetadata.validateJsonElement(jsonArrayrules.get(i)); } } } diff --git a/src/main/java/one/talon/model/IntegrationCampaignBase.java b/src/main/java/one/talon/model/IntegrationCampaignBase.java new file mode 100644 index 00000000..5717e627 --- /dev/null +++ b/src/main/java/one/talon/model/IntegrationCampaignBase.java @@ -0,0 +1,673 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * IntegrationCampaignBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class IntegrationCampaignBase { + public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; + @SerializedName(SERIALIZED_NAME_APPLICATION_ID) + @javax.annotation.Nonnull + private Long applicationId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + @SerializedName(SERIALIZED_NAME_START_TIME) + @javax.annotation.Nullable + private OffsetDateTime startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + @SerializedName(SERIALIZED_NAME_END_TIME) + @javax.annotation.Nullable + private OffsetDateTime endTime; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private Object attributes; + + /** + * The state of the campaign. + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + ENABLED("enabled"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StateEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nonnull + private StateEnum state = StateEnum.ENABLED; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + @javax.annotation.Nonnull + private List tags = new ArrayList<>(); + + /** + * Gets or Sets features + */ + @JsonAdapter(FeaturesEnum.Adapter.class) + public enum FeaturesEnum { + COUPONS("coupons"), + + REFERRALS("referrals"), + + LOYALTY("loyalty"), + + GIVEAWAYS("giveaways"), + + STRIKETHROUGH("strikethrough"), + + ACHIEVEMENTS("achievements"); + + private String value; + + FeaturesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FeaturesEnum fromValue(String value) { + for (FeaturesEnum b : FeaturesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FeaturesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FeaturesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FeaturesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FeaturesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FEATURES = "features"; + @SerializedName(SERIALIZED_NAME_FEATURES) + @javax.annotation.Nonnull + private List features = new ArrayList<>(); + + public IntegrationCampaignBase() { + } + + public IntegrationCampaignBase applicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * The ID of the Application that owns this entity. + * @return applicationId + */ + @javax.annotation.Nonnull + public Long getApplicationId() { + return applicationId; + } + + public void setApplicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + } + + + public IntegrationCampaignBase id(@javax.annotation.Nonnull Long id) { + this.id = id; + return this; + } + + /** + * Unique ID of Campaign. + * @return id + */ + @javax.annotation.Nonnull + public Long getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; + } + + + public IntegrationCampaignBase name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the campaign. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public IntegrationCampaignBase description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A detailed description of the campaign. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public IntegrationCampaignBase startTime(@javax.annotation.Nullable OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Timestamp when the campaign will become active. + * @return startTime + */ + @javax.annotation.Nullable + public OffsetDateTime getStartTime() { + return startTime; + } + + public void setStartTime(@javax.annotation.Nullable OffsetDateTime startTime) { + this.startTime = startTime; + } + + + public IntegrationCampaignBase endTime(@javax.annotation.Nullable OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Timestamp when the campaign will become inactive. + * @return endTime + */ + @javax.annotation.Nullable + public OffsetDateTime getEndTime() { + return endTime; + } + + public void setEndTime(@javax.annotation.Nullable OffsetDateTime endTime) { + this.endTime = endTime; + } + + + public IntegrationCampaignBase attributes(@javax.annotation.Nullable Object attributes) { + this.attributes = attributes; + return this; + } + + /** + * Arbitrary properties associated with this campaign. + * @return attributes + */ + @javax.annotation.Nullable + public Object getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable Object attributes) { + this.attributes = attributes; + } + + + public IntegrationCampaignBase state(@javax.annotation.Nonnull StateEnum state) { + this.state = state; + return this; + } + + /** + * The state of the campaign. + * @return state + */ + @javax.annotation.Nonnull + public StateEnum getState() { + return state; + } + + public void setState(@javax.annotation.Nonnull StateEnum state) { + this.state = state; + } + + + public IntegrationCampaignBase tags(@javax.annotation.Nonnull List tags) { + this.tags = tags; + return this; + } + + public IntegrationCampaignBase addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags for the campaign. + * @return tags + */ + @javax.annotation.Nonnull + public List getTags() { + return tags; + } + + public void setTags(@javax.annotation.Nonnull List tags) { + this.tags = tags; + } + + + public IntegrationCampaignBase features(@javax.annotation.Nonnull List features) { + this.features = features; + return this; + } + + public IntegrationCampaignBase addFeaturesItem(FeaturesEnum featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * The features enabled in this campaign. + * @return features + */ + @javax.annotation.Nonnull + public List getFeatures() { + return features; + } + + public void setFeatures(@javax.annotation.Nonnull List features) { + this.features = features; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationCampaignBase instance itself + */ + public IntegrationCampaignBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationCampaignBase integrationCampaignBase = (IntegrationCampaignBase) o; + return Objects.equals(this.applicationId, integrationCampaignBase.applicationId) && + Objects.equals(this.id, integrationCampaignBase.id) && + Objects.equals(this.name, integrationCampaignBase.name) && + Objects.equals(this.description, integrationCampaignBase.description) && + Objects.equals(this.startTime, integrationCampaignBase.startTime) && + Objects.equals(this.endTime, integrationCampaignBase.endTime) && + Objects.equals(this.attributes, integrationCampaignBase.attributes) && + Objects.equals(this.state, integrationCampaignBase.state) && + Objects.equals(this.tags, integrationCampaignBase.tags) && + Objects.equals(this.features, integrationCampaignBase.features)&& + Objects.equals(this.additionalProperties, integrationCampaignBase.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(applicationId, id, name, description, startTime, endTime, attributes, state, tags, features, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationCampaignBase {\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("applicationId", "id", "name", "description", "startTime", "endTime", "attributes", "state", "tags", "features")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("applicationId", "id", "name", "state", "tags", "features")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationCampaignBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationCampaignBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in IntegrationCampaignBase is not found in the empty JSON string", IntegrationCampaignBase.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationCampaignBase.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + // validate the required field `state` + StateEnum.validateJsonElement(jsonObj.get("state")); + // ensure the required json array is present + if (jsonObj.get("tags") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + // ensure the required json array is present + if (jsonObj.get("features") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("features").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `features` to be an array in the JSON string but got `%s`", jsonObj.get("features").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationCampaignBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationCampaignBase' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationCampaignBase.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationCampaignBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationCampaignBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationCampaignBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationCampaignBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationCampaignBase + * @throws IOException if the JSON string is invalid with respect to IntegrationCampaignBase + */ + public static IntegrationCampaignBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationCampaignBase.class); + } + + /** + * Convert an instance of IntegrationCampaignBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/IntegrationCoupon.java b/src/main/java/one/talon/model/IntegrationCoupon.java index 823619df..a91d177f 100644 --- a/src/main/java/one/talon/model/IntegrationCoupon.java +++ b/src/main/java/one/talon/model/IntegrationCoupon.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -747,10 +746,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequest.java b/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequest.java index 509901a4..823e0349 100644 --- a/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequest.java +++ b/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.IntegrationCustomerProfileAudienceRequestItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequestItem.java b/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequestItem.java index 0876ce6e..e752067c 100644 --- a/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequestItem.java +++ b/src/main/java/one/talon/model/IntegrationCustomerProfileAudienceRequestItem.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -260,10 +259,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationCustomerSessionResponse.java b/src/main/java/one/talon/model/IntegrationCustomerSessionResponse.java index 8c6589c9..8c0f9e6a 100644 --- a/src/main/java/one/talon/model/IntegrationCustomerSessionResponse.java +++ b/src/main/java/one/talon/model/IntegrationCustomerSessionResponse.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.CustomerSessionV2; import one.talon.model.Effect; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationEntity.java b/src/main/java/one/talon/model/IntegrationEntity.java index cd609280..aba7ff92 100644 --- a/src/main/java/one/talon/model/IntegrationEntity.java +++ b/src/main/java/one/talon/model/IntegrationEntity.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationEvent.java b/src/main/java/one/talon/model/IntegrationEvent.java index c03f2a1c..16c97997 100644 --- a/src/main/java/one/talon/model/IntegrationEvent.java +++ b/src/main/java/one/talon/model/IntegrationEvent.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -118,7 +117,7 @@ public IntegrationEvent type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event. Must not be a reserved event name. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationEventV2Request.java b/src/main/java/one/talon/model/IntegrationEventV2Request.java index 61279019..fada5436 100644 --- a/src/main/java/one/talon/model/IntegrationEventV2Request.java +++ b/src/main/java/one/talon/model/IntegrationEventV2Request.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -224,7 +223,7 @@ public IntegrationEventV2Request type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -400,10 +399,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationEventV2Response.java b/src/main/java/one/talon/model/IntegrationEventV2Response.java index 1a6432cd..20abd0c3 100644 --- a/src/main/java/one/talon/model/IntegrationEventV2Response.java +++ b/src/main/java/one/talon/model/IntegrationEventV2Response.java @@ -33,7 +33,6 @@ import one.talon.model.Loyalty; import one.talon.model.Referral; import one.talon.model.RuleFailureReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -458,10 +457,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationEventV3Request.java b/src/main/java/one/talon/model/IntegrationEventV3Request.java index c20cad33..d14d6167 100644 --- a/src/main/java/one/talon/model/IntegrationEventV3Request.java +++ b/src/main/java/one/talon/model/IntegrationEventV3Request.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -68,11 +67,6 @@ public class IntegrationEventV3Request { @javax.annotation.Nullable private List evaluableCampaignIds; - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - @javax.annotation.Nonnull - private String integrationId; - public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull @@ -83,15 +77,15 @@ public class IntegrationEventV3Request { @javax.annotation.Nullable private Object attributes; - public static final String SERIALIZED_NAME_CONNECTED_SESSION_I_D = "connectedSessionID"; - @SerializedName(SERIALIZED_NAME_CONNECTED_SESSION_I_D) - @javax.annotation.Nullable - private String connectedSessionID; + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + @javax.annotation.Nonnull + private String integrationId; - public static final String SERIALIZED_NAME_PREVIOUS_EVENT_I_D = "previousEventID"; - @SerializedName(SERIALIZED_NAME_PREVIOUS_EVENT_I_D) + public static final String SERIALIZED_NAME_CONNECTED_SESSION_ID = "connectedSessionId"; + @SerializedName(SERIALIZED_NAME_CONNECTED_SESSION_ID) @javax.annotation.Nullable - private String previousEventID; + private String connectedSessionId; public static final String SERIALIZED_NAME_LOYALTY_CARDS = "loyaltyCards"; @SerializedName(SERIALIZED_NAME_LOYALTY_CARDS) @@ -231,32 +225,13 @@ public void setEvaluableCampaignIds(@javax.annotation.Nullable List evalua } - public IntegrationEventV3Request integrationId(@javax.annotation.Nonnull String integrationId) { - this.integrationId = integrationId; - return this; - } - - /** - * The unique ID of the current event. Only one event with this ID could be activated, duplicated events are forbidden. - * @return integrationId - */ - @javax.annotation.Nonnull - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(@javax.annotation.Nonnull String integrationId) { - this.integrationId = integrationId; - } - - public IntegrationEventV3Request type(@javax.annotation.Nonnull String type) { this.type = type; return this; } /** - * A string representing the event name. Must not be a reserved event name. You create this value when you [create an attribute](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) of type `event` in the Campaign Manager. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -288,41 +263,41 @@ public void setAttributes(@javax.annotation.Nullable Object attributes) { } - public IntegrationEventV3Request connectedSessionID(@javax.annotation.Nullable String connectedSessionID) { - this.connectedSessionID = connectedSessionID; + public IntegrationEventV3Request integrationId(@javax.annotation.Nonnull String integrationId) { + this.integrationId = integrationId; return this; } /** - * The ID of the session that happened in the past. - * @return connectedSessionID + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId */ - @javax.annotation.Nullable - public String getConnectedSessionID() { - return connectedSessionID; + @javax.annotation.Nonnull + public String getIntegrationId() { + return integrationId; } - public void setConnectedSessionID(@javax.annotation.Nullable String connectedSessionID) { - this.connectedSessionID = connectedSessionID; + public void setIntegrationId(@javax.annotation.Nonnull String integrationId) { + this.integrationId = integrationId; } - public IntegrationEventV3Request previousEventID(@javax.annotation.Nullable String previousEventID) { - this.previousEventID = previousEventID; + public IntegrationEventV3Request connectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; return this; } /** - * The unique identifier of the event that happened in the past. - * @return previousEventID + * The ID of the session to reference. The session must be in `closed` state. Otherwise, the API call will fail. + * @return connectedSessionId */ @javax.annotation.Nullable - public String getPreviousEventID() { - return previousEventID; + public String getConnectedSessionId() { + return connectedSessionId; } - public void setPreviousEventID(@javax.annotation.Nullable String previousEventID) { - this.previousEventID = previousEventID; + public void setConnectedSessionId(@javax.annotation.Nullable String connectedSessionId) { + this.connectedSessionId = connectedSessionId; } @@ -437,11 +412,10 @@ public boolean equals(Object o) { return Objects.equals(this.profileId, integrationEventV3Request.profileId) && Objects.equals(this.storeIntegrationId, integrationEventV3Request.storeIntegrationId) && Objects.equals(this.evaluableCampaignIds, integrationEventV3Request.evaluableCampaignIds) && - Objects.equals(this.integrationId, integrationEventV3Request.integrationId) && Objects.equals(this.type, integrationEventV3Request.type) && Objects.equals(this.attributes, integrationEventV3Request.attributes) && - Objects.equals(this.connectedSessionID, integrationEventV3Request.connectedSessionID) && - Objects.equals(this.previousEventID, integrationEventV3Request.previousEventID) && + Objects.equals(this.integrationId, integrationEventV3Request.integrationId) && + Objects.equals(this.connectedSessionId, integrationEventV3Request.connectedSessionId) && Objects.equals(this.loyaltyCards, integrationEventV3Request.loyaltyCards) && Objects.equals(this.responseContent, integrationEventV3Request.responseContent)&& Objects.equals(this.additionalProperties, integrationEventV3Request.additionalProperties); @@ -449,7 +423,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(profileId, storeIntegrationId, evaluableCampaignIds, integrationId, type, attributes, connectedSessionID, previousEventID, loyaltyCards, responseContent, additionalProperties); + return Objects.hash(profileId, storeIntegrationId, evaluableCampaignIds, type, attributes, integrationId, connectedSessionId, loyaltyCards, responseContent, additionalProperties); } @Override @@ -459,11 +433,10 @@ public String toString() { sb.append(" profileId: ").append(toIndentedString(profileId)).append("\n"); sb.append(" storeIntegrationId: ").append(toIndentedString(storeIntegrationId)).append("\n"); sb.append(" evaluableCampaignIds: ").append(toIndentedString(evaluableCampaignIds)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); - sb.append(" connectedSessionID: ").append(toIndentedString(connectedSessionID)).append("\n"); - sb.append(" previousEventID: ").append(toIndentedString(previousEventID)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" connectedSessionId: ").append(toIndentedString(connectedSessionId)).append("\n"); sb.append(" loyaltyCards: ").append(toIndentedString(loyaltyCards)).append("\n"); sb.append(" responseContent: ").append(toIndentedString(responseContent)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -476,10 +449,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -488,10 +458,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("profileId", "storeIntegrationId", "evaluableCampaignIds", "integrationId", "type", "attributes", "connectedSessionID", "previousEventID", "loyaltyCards", "responseContent")); + openapiFields = new HashSet(Arrays.asList("profileId", "storeIntegrationId", "evaluableCampaignIds", "type", "attributes", "integrationId", "connectedSessionId", "loyaltyCards", "responseContent")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("profileId", "integrationId", "type")); + openapiRequiredFields = new HashSet(Arrays.asList("profileId", "type", "integrationId")); } /** @@ -524,17 +494,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("evaluableCampaignIds") != null && !jsonObj.get("evaluableCampaignIds").isJsonNull() && !jsonObj.get("evaluableCampaignIds").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `evaluableCampaignIds` to be an array in the JSON string but got `%s`", jsonObj.get("evaluableCampaignIds").toString())); } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); - } if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } - if ((jsonObj.get("connectedSessionID") != null && !jsonObj.get("connectedSessionID").isJsonNull()) && !jsonObj.get("connectedSessionID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `connectedSessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectedSessionID").toString())); + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); } - if ((jsonObj.get("previousEventID") != null && !jsonObj.get("previousEventID").isJsonNull()) && !jsonObj.get("previousEventID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `previousEventID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previousEventID").toString())); + if ((jsonObj.get("connectedSessionId") != null && !jsonObj.get("connectedSessionId").isJsonNull()) && !jsonObj.get("connectedSessionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `connectedSessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectedSessionId").toString())); } // ensure the optional json data is an array if present if (jsonObj.get("loyaltyCards") != null && !jsonObj.get("loyaltyCards").isJsonNull() && !jsonObj.get("loyaltyCards").isJsonArray()) { diff --git a/src/main/java/one/talon/model/IntegrationEventV3Response.java b/src/main/java/one/talon/model/IntegrationEventV3Response.java index 47e4aed9..73203679 100644 --- a/src/main/java/one/talon/model/IntegrationEventV3Response.java +++ b/src/main/java/one/talon/model/IntegrationEventV3Response.java @@ -33,7 +33,6 @@ import one.talon.model.Loyalty; import one.talon.model.Referral; import one.talon.model.RuleFailureReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -458,10 +457,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationGetAllCampaigns200Response.java b/src/main/java/one/talon/model/IntegrationGetAllCampaigns200Response.java index b2e7e2c6..363ce1e6 100644 --- a/src/main/java/one/talon/model/IntegrationGetAllCampaigns200Response.java +++ b/src/main/java/one/talon/model/IntegrationGetAllCampaigns200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.IntegrationCampaign; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubConfig.java b/src/main/java/one/talon/model/IntegrationHubConfig.java index a0b84dad..27512907 100644 --- a/src/main/java/one/talon/model/IntegrationHubConfig.java +++ b/src/main/java/one/talon/model/IntegrationHubConfig.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotifications.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotifications.java index b314763b..71b422bd 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotifications.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotifications.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.IntegrationHubEventPayloadCouponBasedNotificationsLimits; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -688,10 +687,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotificationsLimits.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotificationsLimits.java index a730bf9f..7e36e1f0 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotificationsLimits.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadCouponBasedNotificationsLimits.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.java index ef155f1a..c30a822c 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotification.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -65,6 +64,11 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedNotification { @javax.annotation.Nonnull private Long loyaltyProgramID; + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_NAME = "LoyaltyProgramName"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_NAME) + @javax.annotation.Nonnull + private String loyaltyProgramName; + public static final String SERIALIZED_NAME_SUBLEDGER_I_D = "SubledgerID"; @SerializedName(SERIALIZED_NAME_SUBLEDGER_I_D) @javax.annotation.Nonnull @@ -75,6 +79,11 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedNotification { @javax.annotation.Nonnull private String sourceOfEvent; + public static final String SERIALIZED_NAME_CURRENT_TIER = "CurrentTier"; + @SerializedName(SERIALIZED_NAME_CURRENT_TIER) + @javax.annotation.Nonnull + private String currentTier; + public static final String SERIALIZED_NAME_EMPLOYEE_NAME = "EmployeeName"; @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME) @javax.annotation.Nullable @@ -100,11 +109,6 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedNotification { @javax.annotation.Nonnull private OffsetDateTime publishedAt; - public static final String SERIALIZED_NAME_CURRENT_TIER = "CurrentTier"; - @SerializedName(SERIALIZED_NAME_CURRENT_TIER) - @javax.annotation.Nullable - private String currentTier; - public static final String SERIALIZED_NAME_OLD_TIER = "OldTier"; @SerializedName(SERIALIZED_NAME_OLD_TIER) @javax.annotation.Nullable @@ -171,6 +175,25 @@ public void setLoyaltyProgramID(@javax.annotation.Nonnull Long loyaltyProgramID) } + public IntegrationHubEventPayloadLoyaltyProfileBasedNotification loyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + return this; + } + + /** + * The name of the loyalty program. + * @return loyaltyProgramName + */ + @javax.annotation.Nonnull + public String getLoyaltyProgramName() { + return loyaltyProgramName; + } + + public void setLoyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + } + + public IntegrationHubEventPayloadLoyaltyProfileBasedNotification subledgerID(@javax.annotation.Nonnull String subledgerID) { this.subledgerID = subledgerID; return this; @@ -209,6 +232,25 @@ public void setSourceOfEvent(@javax.annotation.Nonnull String sourceOfEvent) { } + public IntegrationHubEventPayloadLoyaltyProfileBasedNotification currentTier(@javax.annotation.Nonnull String currentTier) { + this.currentTier = currentTier; + return this; + } + + /** + * The name of the customer's current tier. + * @return currentTier + */ + @javax.annotation.Nonnull + public String getCurrentTier() { + return currentTier; + } + + public void setCurrentTier(@javax.annotation.Nonnull String currentTier) { + this.currentTier = currentTier; + } + + public IntegrationHubEventPayloadLoyaltyProfileBasedNotification employeeName(@javax.annotation.Nullable String employeeName) { this.employeeName = employeeName; return this; @@ -312,25 +354,6 @@ public void setPublishedAt(@javax.annotation.Nonnull OffsetDateTime publishedAt) } - public IntegrationHubEventPayloadLoyaltyProfileBasedNotification currentTier(@javax.annotation.Nullable String currentTier) { - this.currentTier = currentTier; - return this; - } - - /** - * Get currentTier - * @return currentTier - */ - @javax.annotation.Nullable - public String getCurrentTier() { - return currentTier; - } - - public void setCurrentTier(@javax.annotation.Nullable String currentTier) { - this.currentTier = currentTier; - } - - public IntegrationHubEventPayloadLoyaltyProfileBasedNotification oldTier(@javax.annotation.Nullable String oldTier) { this.oldTier = oldTier; return this; @@ -482,14 +505,15 @@ public boolean equals(Object o) { IntegrationHubEventPayloadLoyaltyProfileBasedNotification integrationHubEventPayloadLoyaltyProfileBasedNotification = (IntegrationHubEventPayloadLoyaltyProfileBasedNotification) o; return Objects.equals(this.profileIntegrationID, integrationHubEventPayloadLoyaltyProfileBasedNotification.profileIntegrationID) && Objects.equals(this.loyaltyProgramID, integrationHubEventPayloadLoyaltyProfileBasedNotification.loyaltyProgramID) && + Objects.equals(this.loyaltyProgramName, integrationHubEventPayloadLoyaltyProfileBasedNotification.loyaltyProgramName) && Objects.equals(this.subledgerID, integrationHubEventPayloadLoyaltyProfileBasedNotification.subledgerID) && Objects.equals(this.sourceOfEvent, integrationHubEventPayloadLoyaltyProfileBasedNotification.sourceOfEvent) && + Objects.equals(this.currentTier, integrationHubEventPayloadLoyaltyProfileBasedNotification.currentTier) && Objects.equals(this.employeeName, integrationHubEventPayloadLoyaltyProfileBasedNotification.employeeName) && Objects.equals(this.userID, integrationHubEventPayloadLoyaltyProfileBasedNotification.userID) && Objects.equals(this.currentPoints, integrationHubEventPayloadLoyaltyProfileBasedNotification.currentPoints) && Objects.equals(this.actions, integrationHubEventPayloadLoyaltyProfileBasedNotification.actions) && Objects.equals(this.publishedAt, integrationHubEventPayloadLoyaltyProfileBasedNotification.publishedAt) && - Objects.equals(this.currentTier, integrationHubEventPayloadLoyaltyProfileBasedNotification.currentTier) && Objects.equals(this.oldTier, integrationHubEventPayloadLoyaltyProfileBasedNotification.oldTier) && Objects.equals(this.tierExpirationDate, integrationHubEventPayloadLoyaltyProfileBasedNotification.tierExpirationDate) && Objects.equals(this.timestampOfTierChange, integrationHubEventPayloadLoyaltyProfileBasedNotification.timestampOfTierChange) && @@ -500,7 +524,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(profileIntegrationID, loyaltyProgramID, subledgerID, sourceOfEvent, employeeName, userID, currentPoints, actions, publishedAt, currentTier, oldTier, tierExpirationDate, timestampOfTierChange, pointsRequiredToTheNextTier, nextTier, additionalProperties); + return Objects.hash(profileIntegrationID, loyaltyProgramID, loyaltyProgramName, subledgerID, sourceOfEvent, currentTier, employeeName, userID, currentPoints, actions, publishedAt, oldTier, tierExpirationDate, timestampOfTierChange, pointsRequiredToTheNextTier, nextTier, additionalProperties); } @Override @@ -509,14 +533,15 @@ public String toString() { sb.append("class IntegrationHubEventPayloadLoyaltyProfileBasedNotification {\n"); sb.append(" profileIntegrationID: ").append(toIndentedString(profileIntegrationID)).append("\n"); sb.append(" loyaltyProgramID: ").append(toIndentedString(loyaltyProgramID)).append("\n"); + sb.append(" loyaltyProgramName: ").append(toIndentedString(loyaltyProgramName)).append("\n"); sb.append(" subledgerID: ").append(toIndentedString(subledgerID)).append("\n"); sb.append(" sourceOfEvent: ").append(toIndentedString(sourceOfEvent)).append("\n"); + sb.append(" currentTier: ").append(toIndentedString(currentTier)).append("\n"); sb.append(" employeeName: ").append(toIndentedString(employeeName)).append("\n"); sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); sb.append(" currentPoints: ").append(toIndentedString(currentPoints)).append("\n"); sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append(" publishedAt: ").append(toIndentedString(publishedAt)).append("\n"); - sb.append(" currentTier: ").append(toIndentedString(currentTier)).append("\n"); sb.append(" oldTier: ").append(toIndentedString(oldTier)).append("\n"); sb.append(" tierExpirationDate: ").append(toIndentedString(tierExpirationDate)).append("\n"); sb.append(" timestampOfTierChange: ").append(toIndentedString(timestampOfTierChange)).append("\n"); @@ -532,10 +557,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -544,10 +566,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt", "CurrentTier", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PointsRequiredToTheNextTier", "NextTier")); + openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PointsRequiredToTheNextTier", "NextTier")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentPoints", "PublishedAt")); + openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "PublishedAt")); } /** @@ -573,12 +595,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("ProfileIntegrationID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ProfileIntegrationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileIntegrationID").toString())); } + if (!jsonObj.get("LoyaltyProgramName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `LoyaltyProgramName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoyaltyProgramName").toString())); + } if (!jsonObj.get("SubledgerID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SubledgerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SubledgerID").toString())); } if (!jsonObj.get("SourceOfEvent").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SourceOfEvent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceOfEvent").toString())); } + if (!jsonObj.get("CurrentTier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `CurrentTier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CurrentTier").toString())); + } if ((jsonObj.get("EmployeeName") != null && !jsonObj.get("EmployeeName").isJsonNull()) && !jsonObj.get("EmployeeName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `EmployeeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EmployeeName").toString())); } @@ -596,9 +624,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - if ((jsonObj.get("CurrentTier") != null && !jsonObj.get("CurrentTier").isJsonNull()) && !jsonObj.get("CurrentTier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `CurrentTier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CurrentTier").toString())); - } if ((jsonObj.get("OldTier") != null && !jsonObj.get("OldTier").isJsonNull()) && !jsonObj.get("OldTier").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `OldTier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OldTier").toString())); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.java index b36c267d..dfe50eb7 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -65,6 +64,11 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificat @javax.annotation.Nonnull private Long loyaltyProgramID; + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_NAME = "LoyaltyProgramName"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_NAME) + @javax.annotation.Nonnull + private String loyaltyProgramName; + public static final String SERIALIZED_NAME_SUBLEDGER_I_D = "SubledgerID"; @SerializedName(SERIALIZED_NAME_SUBLEDGER_I_D) @javax.annotation.Nonnull @@ -75,6 +79,11 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificat @javax.annotation.Nonnull private String sourceOfEvent; + public static final String SERIALIZED_NAME_CURRENT_TIER = "CurrentTier"; + @SerializedName(SERIALIZED_NAME_CURRENT_TIER) + @javax.annotation.Nonnull + private String currentTier; + public static final String SERIALIZED_NAME_EMPLOYEE_NAME = "EmployeeName"; @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME) @javax.annotation.Nullable @@ -141,6 +150,25 @@ public void setLoyaltyProgramID(@javax.annotation.Nonnull Long loyaltyProgramID) } + public IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification loyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + return this; + } + + /** + * The name of the loyalty program. + * @return loyaltyProgramName + */ + @javax.annotation.Nonnull + public String getLoyaltyProgramName() { + return loyaltyProgramName; + } + + public void setLoyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + } + + public IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification subledgerID(@javax.annotation.Nonnull String subledgerID) { this.subledgerID = subledgerID; return this; @@ -179,6 +207,25 @@ public void setSourceOfEvent(@javax.annotation.Nonnull String sourceOfEvent) { } + public IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification currentTier(@javax.annotation.Nonnull String currentTier) { + this.currentTier = currentTier; + return this; + } + + /** + * The name of the customer's current tier. + * @return currentTier + */ + @javax.annotation.Nonnull + public String getCurrentTier() { + return currentTier; + } + + public void setCurrentTier(@javax.annotation.Nonnull String currentTier) { + this.currentTier = currentTier; + } + + public IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification employeeName(@javax.annotation.Nullable String employeeName) { this.employeeName = employeeName; return this; @@ -338,8 +385,10 @@ public boolean equals(Object o) { IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification = (IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification) o; return Objects.equals(this.profileIntegrationID, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.profileIntegrationID) && Objects.equals(this.loyaltyProgramID, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.loyaltyProgramID) && + Objects.equals(this.loyaltyProgramName, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.loyaltyProgramName) && Objects.equals(this.subledgerID, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.subledgerID) && Objects.equals(this.sourceOfEvent, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.sourceOfEvent) && + Objects.equals(this.currentTier, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.currentTier) && Objects.equals(this.employeeName, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.employeeName) && Objects.equals(this.userID, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.userID) && Objects.equals(this.currentPoints, integrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification.currentPoints) && @@ -350,7 +399,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(profileIntegrationID, loyaltyProgramID, subledgerID, sourceOfEvent, employeeName, userID, currentPoints, actions, publishedAt, additionalProperties); + return Objects.hash(profileIntegrationID, loyaltyProgramID, loyaltyProgramName, subledgerID, sourceOfEvent, currentTier, employeeName, userID, currentPoints, actions, publishedAt, additionalProperties); } @Override @@ -359,8 +408,10 @@ public String toString() { sb.append("class IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotification {\n"); sb.append(" profileIntegrationID: ").append(toIndentedString(profileIntegrationID)).append("\n"); sb.append(" loyaltyProgramID: ").append(toIndentedString(loyaltyProgramID)).append("\n"); + sb.append(" loyaltyProgramName: ").append(toIndentedString(loyaltyProgramName)).append("\n"); sb.append(" subledgerID: ").append(toIndentedString(subledgerID)).append("\n"); sb.append(" sourceOfEvent: ").append(toIndentedString(sourceOfEvent)).append("\n"); + sb.append(" currentTier: ").append(toIndentedString(currentTier)).append("\n"); sb.append(" employeeName: ").append(toIndentedString(employeeName)).append("\n"); sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); sb.append(" currentPoints: ").append(toIndentedString(currentPoints)).append("\n"); @@ -376,10 +427,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -388,10 +436,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt")); + openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "EmployeeName", "UserID", "CurrentPoints", "Actions", "PublishedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentPoints", "PublishedAt")); + openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "PublishedAt")); } /** @@ -417,12 +465,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("ProfileIntegrationID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ProfileIntegrationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileIntegrationID").toString())); } + if (!jsonObj.get("LoyaltyProgramName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `LoyaltyProgramName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoyaltyProgramName").toString())); + } if (!jsonObj.get("SubledgerID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SubledgerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SubledgerID").toString())); } if (!jsonObj.get("SourceOfEvent").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SourceOfEvent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceOfEvent").toString())); } + if (!jsonObj.get("CurrentTier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `CurrentTier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CurrentTier").toString())); + } if ((jsonObj.get("EmployeeName") != null && !jsonObj.get("EmployeeName").isJsonNull()) && !jsonObj.get("EmployeeName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `EmployeeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EmployeeName").toString())); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.java index 3ac7cf79..cc42f952 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationAction.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -340,10 +339,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.java index 590f605a..91234fe4 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,6 +61,11 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotificat @javax.annotation.Nonnull private Long loyaltyProgramID; + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_NAME = "LoyaltyProgramName"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_NAME) + @javax.annotation.Nonnull + private String loyaltyProgramName; + public static final String SERIALIZED_NAME_SUBLEDGER_I_D = "SubledgerID"; @SerializedName(SERIALIZED_NAME_SUBLEDGER_I_D) @javax.annotation.Nonnull @@ -143,6 +147,25 @@ public void setLoyaltyProgramID(@javax.annotation.Nonnull Long loyaltyProgramID) } + public IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification loyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + return this; + } + + /** + * The name of the loyalty program. + * @return loyaltyProgramName + */ + @javax.annotation.Nonnull + public String getLoyaltyProgramName() { + return loyaltyProgramName; + } + + public void setLoyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + } + + public IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification subledgerID(@javax.annotation.Nonnull String subledgerID) { this.subledgerID = subledgerID; return this; @@ -187,7 +210,7 @@ public IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification cu } /** - * Get currentTier + * The name of the customer's current tier, or null if the customer was downgraded below all tiers. * @return currentTier */ @javax.annotation.Nullable @@ -351,6 +374,7 @@ public boolean equals(Object o) { IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification = (IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification) o; return Objects.equals(this.profileIntegrationID, integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.profileIntegrationID) && Objects.equals(this.loyaltyProgramID, integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.loyaltyProgramID) && + Objects.equals(this.loyaltyProgramName, integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.loyaltyProgramName) && Objects.equals(this.subledgerID, integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.subledgerID) && Objects.equals(this.sourceOfEvent, integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.sourceOfEvent) && Objects.equals(this.currentTier, integrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification.currentTier) && @@ -364,7 +388,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(profileIntegrationID, loyaltyProgramID, subledgerID, sourceOfEvent, currentTier, currentPoints, oldTier, tierExpirationDate, timestampOfTierChange, publishedAt, additionalProperties); + return Objects.hash(profileIntegrationID, loyaltyProgramID, loyaltyProgramName, subledgerID, sourceOfEvent, currentTier, currentPoints, oldTier, tierExpirationDate, timestampOfTierChange, publishedAt, additionalProperties); } @Override @@ -373,6 +397,7 @@ public String toString() { sb.append("class IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotification {\n"); sb.append(" profileIntegrationID: ").append(toIndentedString(profileIntegrationID)).append("\n"); sb.append(" loyaltyProgramID: ").append(toIndentedString(loyaltyProgramID)).append("\n"); + sb.append(" loyaltyProgramName: ").append(toIndentedString(loyaltyProgramName)).append("\n"); sb.append(" subledgerID: ").append(toIndentedString(subledgerID)).append("\n"); sb.append(" sourceOfEvent: ").append(toIndentedString(sourceOfEvent)).append("\n"); sb.append(" currentTier: ").append(toIndentedString(currentTier)).append("\n"); @@ -391,10 +416,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -403,10 +425,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt")); + openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentPoints", "PublishedAt")); + openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentPoints", "PublishedAt")); } /** @@ -432,6 +454,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("ProfileIntegrationID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ProfileIntegrationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileIntegrationID").toString())); } + if (!jsonObj.get("LoyaltyProgramName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `LoyaltyProgramName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoyaltyProgramName").toString())); + } if (!jsonObj.get("SubledgerID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SubledgerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SubledgerID").toString())); } diff --git a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.java b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.java index 10b9959b..39118f55 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.java +++ b/src/main/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,6 +61,11 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificatio @javax.annotation.Nonnull private Long loyaltyProgramID; + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_NAME = "LoyaltyProgramName"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_NAME) + @javax.annotation.Nonnull + private String loyaltyProgramName; + public static final String SERIALIZED_NAME_SUBLEDGER_I_D = "SubledgerID"; @SerializedName(SERIALIZED_NAME_SUBLEDGER_I_D) @javax.annotation.Nonnull @@ -74,7 +78,7 @@ public class IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificatio public static final String SERIALIZED_NAME_CURRENT_TIER = "CurrentTier"; @SerializedName(SERIALIZED_NAME_CURRENT_TIER) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String currentTier; public static final String SERIALIZED_NAME_CURRENT_POINTS = "CurrentPoints"; @@ -153,6 +157,25 @@ public void setLoyaltyProgramID(@javax.annotation.Nonnull Long loyaltyProgramID) } + public IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification loyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + return this; + } + + /** + * The name of the loyalty program. + * @return loyaltyProgramName + */ + @javax.annotation.Nonnull + public String getLoyaltyProgramName() { + return loyaltyProgramName; + } + + public void setLoyaltyProgramName(@javax.annotation.Nonnull String loyaltyProgramName) { + this.loyaltyProgramName = loyaltyProgramName; + } + + public IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification subledgerID(@javax.annotation.Nonnull String subledgerID) { this.subledgerID = subledgerID; return this; @@ -191,21 +214,21 @@ public void setSourceOfEvent(@javax.annotation.Nonnull String sourceOfEvent) { } - public IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification currentTier(@javax.annotation.Nullable String currentTier) { + public IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification currentTier(@javax.annotation.Nonnull String currentTier) { this.currentTier = currentTier; return this; } /** - * Get currentTier + * The name of the customer's current tier. * @return currentTier */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCurrentTier() { return currentTier; } - public void setCurrentTier(@javax.annotation.Nullable String currentTier) { + public void setCurrentTier(@javax.annotation.Nonnull String currentTier) { this.currentTier = currentTier; } @@ -399,6 +422,7 @@ public boolean equals(Object o) { IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification = (IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification) o; return Objects.equals(this.profileIntegrationID, integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.profileIntegrationID) && Objects.equals(this.loyaltyProgramID, integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.loyaltyProgramID) && + Objects.equals(this.loyaltyProgramName, integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.loyaltyProgramName) && Objects.equals(this.subledgerID, integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.subledgerID) && Objects.equals(this.sourceOfEvent, integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.sourceOfEvent) && Objects.equals(this.currentTier, integrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification.currentTier) && @@ -414,7 +438,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(profileIntegrationID, loyaltyProgramID, subledgerID, sourceOfEvent, currentTier, currentPoints, oldTier, pointsRequiredToTheNextTier, nextTier, tierExpirationDate, timestampOfTierChange, publishedAt, additionalProperties); + return Objects.hash(profileIntegrationID, loyaltyProgramID, loyaltyProgramName, subledgerID, sourceOfEvent, currentTier, currentPoints, oldTier, pointsRequiredToTheNextTier, nextTier, tierExpirationDate, timestampOfTierChange, publishedAt, additionalProperties); } @Override @@ -423,6 +447,7 @@ public String toString() { sb.append("class IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotification {\n"); sb.append(" profileIntegrationID: ").append(toIndentedString(profileIntegrationID)).append("\n"); sb.append(" loyaltyProgramID: ").append(toIndentedString(loyaltyProgramID)).append("\n"); + sb.append(" loyaltyProgramName: ").append(toIndentedString(loyaltyProgramName)).append("\n"); sb.append(" subledgerID: ").append(toIndentedString(subledgerID)).append("\n"); sb.append(" sourceOfEvent: ").append(toIndentedString(sourceOfEvent)).append("\n"); sb.append(" currentTier: ").append(toIndentedString(currentTier)).append("\n"); @@ -443,10 +468,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -455,10 +477,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "PointsRequiredToTheNextTier", "NextTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt")); + openapiFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "OldTier", "PointsRequiredToTheNextTier", "NextTier", "TierExpirationDate", "TimestampOfTierChange", "PublishedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "SubledgerID", "SourceOfEvent", "CurrentPoints", "PublishedAt")); + openapiRequiredFields = new HashSet(Arrays.asList("ProfileIntegrationID", "LoyaltyProgramID", "LoyaltyProgramName", "SubledgerID", "SourceOfEvent", "CurrentTier", "CurrentPoints", "PublishedAt")); } /** @@ -484,13 +506,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("ProfileIntegrationID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `ProfileIntegrationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileIntegrationID").toString())); } + if (!jsonObj.get("LoyaltyProgramName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `LoyaltyProgramName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoyaltyProgramName").toString())); + } if (!jsonObj.get("SubledgerID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SubledgerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SubledgerID").toString())); } if (!jsonObj.get("SourceOfEvent").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `SourceOfEvent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceOfEvent").toString())); } - if ((jsonObj.get("CurrentTier") != null && !jsonObj.get("CurrentTier").isJsonNull()) && !jsonObj.get("CurrentTier").isJsonPrimitive()) { + if (!jsonObj.get("CurrentTier").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `CurrentTier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CurrentTier").toString())); } if ((jsonObj.get("OldTier") != null && !jsonObj.get("OldTier").isJsonNull()) && !jsonObj.get("OldTier").isJsonPrimitive()) { diff --git a/src/main/java/one/talon/model/IntegrationHubEventRecord.java b/src/main/java/one/talon/model/IntegrationHubEventRecord.java index 97d2d601..92a5cc65 100644 --- a/src/main/java/one/talon/model/IntegrationHubEventRecord.java +++ b/src/main/java/one/talon/model/IntegrationHubEventRecord.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -82,6 +81,11 @@ public class IntegrationHubEventRecord { @javax.annotation.Nullable private OffsetDateTime processedAt; + public static final String SERIALIZED_NAME_DELIVERED_AT = "DeliveredAt"; + @SerializedName(SERIALIZED_NAME_DELIVERED_AT) + @javax.annotation.Nullable + private OffsetDateTime deliveredAt; + public static final String SERIALIZED_NAME_PROCESS_AFTER = "ProcessAfter"; @SerializedName(SERIALIZED_NAME_PROCESS_AFTER) @javax.annotation.Nonnull @@ -209,6 +213,25 @@ public void setProcessedAt(@javax.annotation.Nullable OffsetDateTime processedAt } + public IntegrationHubEventRecord deliveredAt(@javax.annotation.Nullable OffsetDateTime deliveredAt) { + this.deliveredAt = deliveredAt; + return this; + } + + /** + * Get deliveredAt + * @return deliveredAt + */ + @javax.annotation.Nullable + public OffsetDateTime getDeliveredAt() { + return deliveredAt; + } + + public void setDeliveredAt(@javax.annotation.Nullable OffsetDateTime deliveredAt) { + this.deliveredAt = deliveredAt; + } + + public IntegrationHubEventRecord processAfter(@javax.annotation.Nonnull OffsetDateTime processAfter) { this.processAfter = processAfter; return this; @@ -307,6 +330,7 @@ public boolean equals(Object o) { Objects.equals(this.eventData, integrationHubEventRecord.eventData) && Objects.equals(this.publishedAt, integrationHubEventRecord.publishedAt) && Objects.equals(this.processedAt, integrationHubEventRecord.processedAt) && + Objects.equals(this.deliveredAt, integrationHubEventRecord.deliveredAt) && Objects.equals(this.processAfter, integrationHubEventRecord.processAfter) && Objects.equals(this.retry, integrationHubEventRecord.retry)&& Objects.equals(this.additionalProperties, integrationHubEventRecord.additionalProperties); @@ -314,7 +338,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, flowId, eventType, eventData, publishedAt, processedAt, processAfter, retry, additionalProperties); + return Objects.hash(id, flowId, eventType, eventData, publishedAt, processedAt, deliveredAt, processAfter, retry, additionalProperties); } @Override @@ -327,6 +351,7 @@ public String toString() { sb.append(" eventData: ").append(toIndentedString(eventData)).append("\n"); sb.append(" publishedAt: ").append(toIndentedString(publishedAt)).append("\n"); sb.append(" processedAt: ").append(toIndentedString(processedAt)).append("\n"); + sb.append(" deliveredAt: ").append(toIndentedString(deliveredAt)).append("\n"); sb.append(" processAfter: ").append(toIndentedString(processAfter)).append("\n"); sb.append(" retry: ").append(toIndentedString(retry)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -339,10 +364,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -351,7 +373,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("Id", "FlowId", "EventType", "EventData", "PublishedAt", "ProcessedAt", "ProcessAfter", "Retry")); + openapiFields = new HashSet(Arrays.asList("Id", "FlowId", "EventType", "EventData", "PublishedAt", "ProcessedAt", "DeliveredAt", "ProcessAfter", "Retry")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("Id", "FlowId", "EventType", "EventData", "PublishedAt", "ProcessAfter", "Retry")); diff --git a/src/main/java/one/talon/model/IntegrationHubEventStatusUpdate.java b/src/main/java/one/talon/model/IntegrationHubEventStatusUpdate.java new file mode 100644 index 00000000..9cb9a0d5 --- /dev/null +++ b/src/main/java/one/talon/model/IntegrationHubEventStatusUpdate.java @@ -0,0 +1,370 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * IntegrationHubEventStatusUpdate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class IntegrationHubEventStatusUpdate { + public static final String SERIALIZED_NAME_EVENT_ID = "EventId"; + @SerializedName(SERIALIZED_NAME_EVENT_ID) + @javax.annotation.Nonnull + private Long eventId; + + /** + * The delivery outcome for the event. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DELIVERED("delivered"), + + FAILED("failed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "Status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public IntegrationHubEventStatusUpdate() { + } + + public IntegrationHubEventStatusUpdate eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * The ID of the integration hub event. + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public IntegrationHubEventStatusUpdate status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * The delivery outcome for the event. + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IntegrationHubEventStatusUpdate instance itself + */ + public IntegrationHubEventStatusUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationHubEventStatusUpdate integrationHubEventStatusUpdate = (IntegrationHubEventStatusUpdate) o; + return Objects.equals(this.eventId, integrationHubEventStatusUpdate.eventId) && + Objects.equals(this.status, integrationHubEventStatusUpdate.status)&& + Objects.equals(this.additionalProperties, integrationHubEventStatusUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationHubEventStatusUpdate {\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("EventId", "Status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("EventId", "Status")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationHubEventStatusUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IntegrationHubEventStatusUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in IntegrationHubEventStatusUpdate is not found in the empty JSON string", IntegrationHubEventStatusUpdate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationHubEventStatusUpdate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("Status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `Status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Status").toString())); + } + // validate the required field `Status` + StatusEnum.validateJsonElement(jsonObj.get("Status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationHubEventStatusUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationHubEventStatusUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IntegrationHubEventStatusUpdate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationHubEventStatusUpdate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IntegrationHubEventStatusUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IntegrationHubEventStatusUpdate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IntegrationHubEventStatusUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationHubEventStatusUpdate + * @throws IOException if the JSON string is invalid with respect to IntegrationHubEventStatusUpdate + */ + public static IntegrationHubEventStatusUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationHubEventStatusUpdate.class); + } + + /** + * Convert an instance of IntegrationHubEventStatusUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/IntegrationHubFlow.java b/src/main/java/one/talon/model/IntegrationHubFlow.java index 728d1f58..2c4e5a12 100644 --- a/src/main/java/one/talon/model/IntegrationHubFlow.java +++ b/src/main/java/one/talon/model/IntegrationHubFlow.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubFlowConfig.java b/src/main/java/one/talon/model/IntegrationHubFlowConfig.java index 584532c0..652b1775 100644 --- a/src/main/java/one/talon/model/IntegrationHubFlowConfig.java +++ b/src/main/java/one/talon/model/IntegrationHubFlowConfig.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -238,10 +237,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubFlowConfigResponse.java b/src/main/java/one/talon/model/IntegrationHubFlowConfigResponse.java index 18a1880d..5bad8721 100644 --- a/src/main/java/one/talon/model/IntegrationHubFlowConfigResponse.java +++ b/src/main/java/one/talon/model/IntegrationHubFlowConfigResponse.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -212,10 +211,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubFlowResponse.java b/src/main/java/one/talon/model/IntegrationHubFlowResponse.java index cf71b2ac..227829f0 100644 --- a/src/main/java/one/talon/model/IntegrationHubFlowResponse.java +++ b/src/main/java/one/talon/model/IntegrationHubFlowResponse.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.IntegrationHubFlowConfigResponse; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubFlowWithConfig.java b/src/main/java/one/talon/model/IntegrationHubFlowWithConfig.java index 4e309bcb..437f7119 100644 --- a/src/main/java/one/talon/model/IntegrationHubFlowWithConfig.java +++ b/src/main/java/one/talon/model/IntegrationHubFlowWithConfig.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.IntegrationHubFlowConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationHubPaginatedEventPayload.java b/src/main/java/one/talon/model/IntegrationHubPaginatedEventPayload.java index 42361275..886924ed 100644 --- a/src/main/java/one/talon/model/IntegrationHubPaginatedEventPayload.java +++ b/src/main/java/one/talon/model/IntegrationHubPaginatedEventPayload.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -305,10 +304,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationProfileEntity.java b/src/main/java/one/talon/model/IntegrationProfileEntity.java index 67be2f67..9cdff473 100644 --- a/src/main/java/one/talon/model/IntegrationProfileEntity.java +++ b/src/main/java/one/talon/model/IntegrationProfileEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationProfileEntityV3.java b/src/main/java/one/talon/model/IntegrationProfileEntityV3.java index 59e5fb25..f395eab5 100644 --- a/src/main/java/one/talon/model/IntegrationProfileEntityV3.java +++ b/src/main/java/one/talon/model/IntegrationProfileEntityV3.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationRequest.java b/src/main/java/one/talon/model/IntegrationRequest.java index 7449b383..0277ea2f 100644 --- a/src/main/java/one/talon/model/IntegrationRequest.java +++ b/src/main/java/one/talon/model/IntegrationRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewCustomerSessionV2; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -263,10 +262,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationResponse.java b/src/main/java/one/talon/model/IntegrationResponse.java index ea79e06f..d5d714d5 100644 --- a/src/main/java/one/talon/model/IntegrationResponse.java +++ b/src/main/java/one/talon/model/IntegrationResponse.java @@ -32,7 +32,6 @@ import one.talon.model.Loyalty; import one.talon.model.Referral; import one.talon.model.RuleFailureReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -431,10 +430,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationState.java b/src/main/java/one/talon/model/IntegrationState.java index 6ef32b35..536e4ed7 100644 --- a/src/main/java/one/talon/model/IntegrationState.java +++ b/src/main/java/one/talon/model/IntegrationState.java @@ -26,7 +26,6 @@ import one.talon.model.CustomerSession; import one.talon.model.Event; import one.talon.model.Loyalty; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -265,10 +264,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationStateV2.java b/src/main/java/one/talon/model/IntegrationStateV2.java index dae32ecb..040d36ac 100644 --- a/src/main/java/one/talon/model/IntegrationStateV2.java +++ b/src/main/java/one/talon/model/IntegrationStateV2.java @@ -38,7 +38,6 @@ import one.talon.model.ModelReturn; import one.talon.model.Referral; import one.talon.model.RuleFailureReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -635,10 +634,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/IntegrationStoreEntity.java b/src/main/java/one/talon/model/IntegrationStoreEntity.java index 9fb49c2e..410a4da0 100644 --- a/src/main/java/one/talon/model/IntegrationStoreEntity.java +++ b/src/main/java/one/talon/model/IntegrationStoreEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/InventoryCoupon.java b/src/main/java/one/talon/model/InventoryCoupon.java index 3b553a7b..6e505056 100644 --- a/src/main/java/one/talon/model/InventoryCoupon.java +++ b/src/main/java/one/talon/model/InventoryCoupon.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -773,10 +772,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/InventoryReferral.java b/src/main/java/one/talon/model/InventoryReferral.java index 756f1690..91d78684 100644 --- a/src/main/java/one/talon/model/InventoryReferral.java +++ b/src/main/java/one/talon/model/InventoryReferral.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -507,10 +506,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ItemAttribute.java b/src/main/java/one/talon/model/ItemAttribute.java index 99da05f8..68e86a3c 100644 --- a/src/main/java/one/talon/model/ItemAttribute.java +++ b/src/main/java/one/talon/model/ItemAttribute.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LabelTargetAudience.java b/src/main/java/one/talon/model/LabelTargetAudience.java index e59e35b7..bd79896f 100644 --- a/src/main/java/one/talon/model/LabelTargetAudience.java +++ b/src/main/java/one/talon/model/LabelTargetAudience.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.AudienceReference; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -233,10 +232,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LabelTargetNone.java b/src/main/java/one/talon/model/LabelTargetNone.java index f3a67a73..70c3b690 100644 --- a/src/main/java/one/talon/model/LabelTargetNone.java +++ b/src/main/java/one/talon/model/LabelTargetNone.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -206,10 +205,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LedgerEntry.java b/src/main/java/one/talon/model/LedgerEntry.java index dbd95b88..a7262419 100644 --- a/src/main/java/one/talon/model/LedgerEntry.java +++ b/src/main/java/one/talon/model/LedgerEntry.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -391,10 +390,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LedgerInfo.java b/src/main/java/one/talon/model/LedgerInfo.java index b38e9950..3a16f08c 100644 --- a/src/main/java/one/talon/model/LedgerInfo.java +++ b/src/main/java/one/talon/model/LedgerInfo.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.util.Arrays; import one.talon.model.Tier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -418,10 +417,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LedgerPointsEntryIntegrationAPI.java b/src/main/java/one/talon/model/LedgerPointsEntryIntegrationAPI.java index aad17717..74f71271 100644 --- a/src/main/java/one/talon/model/LedgerPointsEntryIntegrationAPI.java +++ b/src/main/java/one/talon/model/LedgerPointsEntryIntegrationAPI.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -418,10 +417,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LedgerTransactionLogEntryIntegrationAPI.java b/src/main/java/one/talon/model/LedgerTransactionLogEntryIntegrationAPI.java index 2e64101f..16303acf 100644 --- a/src/main/java/one/talon/model/LedgerTransactionLogEntryIntegrationAPI.java +++ b/src/main/java/one/talon/model/LedgerTransactionLogEntryIntegrationAPI.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.LoyaltyLedgerEntryFlags; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -575,10 +574,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LibraryAttribute.java b/src/main/java/one/talon/model/LibraryAttribute.java index b22205cf..a96dc3fc 100644 --- a/src/main/java/one/talon/model/LibraryAttribute.java +++ b/src/main/java/one/talon/model/LibraryAttribute.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -448,10 +447,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LimitConfig.java b/src/main/java/one/talon/model/LimitConfig.java index 8a25c4c8..a79bfd98 100644 --- a/src/main/java/one/talon/model/LimitConfig.java +++ b/src/main/java/one/talon/model/LimitConfig.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -362,10 +361,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LimitCounter.java b/src/main/java/one/talon/model/LimitCounter.java index 168ca66d..5316d0ab 100644 --- a/src/main/java/one/talon/model/LimitCounter.java +++ b/src/main/java/one/talon/model/LimitCounter.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -521,10 +520,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListAccountCollections200Response.java b/src/main/java/one/talon/model/ListAccountCollections200Response.java index bdbd2094..d6fd2576 100644 --- a/src/main/java/one/talon/model/ListAccountCollections200Response.java +++ b/src/main/java/one/talon/model/ListAccountCollections200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CollectionWithoutPayload; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListAchievements200Response.java b/src/main/java/one/talon/model/ListAchievements200Response.java index 34a37627..27241c4b 100644 --- a/src/main/java/one/talon/model/ListAchievements200Response.java +++ b/src/main/java/one/talon/model/ListAchievements200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Achievement; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListAllRolesV2200Response.java b/src/main/java/one/talon/model/ListAllRolesV2200Response.java index c5ffd07a..fb493fe4 100644 --- a/src/main/java/one/talon/model/ListAllRolesV2200Response.java +++ b/src/main/java/one/talon/model/ListAllRolesV2200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.RoleV2; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListApplicationCartItemFilters200Response.java b/src/main/java/one/talon/model/ListApplicationCartItemFilters200Response.java index 02fb9ea9..4aaab2d8 100644 --- a/src/main/java/one/talon/model/ListApplicationCartItemFilters200Response.java +++ b/src/main/java/one/talon/model/ListApplicationCartItemFilters200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ApplicationCIF; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListCampaignStoreBudgetLimits200Response.java b/src/main/java/one/talon/model/ListCampaignStoreBudgetLimits200Response.java index 204e9f3b..34bee522 100644 --- a/src/main/java/one/talon/model/ListCampaignStoreBudgetLimits200Response.java +++ b/src/main/java/one/talon/model/ListCampaignStoreBudgetLimits200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ListCampaignStoreBudgets; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListCampaignStoreBudgets.java b/src/main/java/one/talon/model/ListCampaignStoreBudgets.java index 6e787d63..b0fb2454 100644 --- a/src/main/java/one/talon/model/ListCampaignStoreBudgets.java +++ b/src/main/java/one/talon/model/ListCampaignStoreBudgets.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ListCampaignStoreBudgetsStore; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListCampaignStoreBudgetsStore.java b/src/main/java/one/talon/model/ListCampaignStoreBudgetsStore.java index f7a66bcb..dd7cf823 100644 --- a/src/main/java/one/talon/model/ListCampaignStoreBudgetsStore.java +++ b/src/main/java/one/talon/model/ListCampaignStoreBudgetsStore.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListCatalogItems200Response.java b/src/main/java/one/talon/model/ListCatalogItems200Response.java index be25c825..332c71b1 100644 --- a/src/main/java/one/talon/model/ListCatalogItems200Response.java +++ b/src/main/java/one/talon/model/ListCatalogItems200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CatalogItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListExperiments200Response.java b/src/main/java/one/talon/model/ListExperiments200Response.java index a9aea8cf..a6598e5a 100644 --- a/src/main/java/one/talon/model/ListExperiments200Response.java +++ b/src/main/java/one/talon/model/ListExperiments200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Experiment; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ListStores200Response.java b/src/main/java/one/talon/model/ListStores200Response.java index b3698f15..b95d454b 100644 --- a/src/main/java/one/talon/model/ListStores200Response.java +++ b/src/main/java/one/talon/model/ListStores200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Store; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoginParams.java b/src/main/java/one/talon/model/LoginParams.java index 74aa727e..dc418baa 100644 --- a/src/main/java/one/talon/model/LoginParams.java +++ b/src/main/java/one/talon/model/LoginParams.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Loyalty.java b/src/main/java/one/talon/model/Loyalty.java index b428b34c..2276fda2 100644 --- a/src/main/java/one/talon/model/Loyalty.java +++ b/src/main/java/one/talon/model/Loyalty.java @@ -27,7 +27,6 @@ import java.util.Map; import one.talon.model.LoyaltyCard; import one.talon.model.LoyaltyProgramLedgers; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -204,10 +203,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyBalance.java b/src/main/java/one/talon/model/LoyaltyBalance.java index ed74fc82..06f2175e 100644 --- a/src/main/java/one/talon/model/LoyaltyBalance.java +++ b/src/main/java/one/talon/model/LoyaltyBalance.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyBalanceWithTier.java b/src/main/java/one/talon/model/LoyaltyBalanceWithTier.java index 6b81ac15..b0835554 100644 --- a/src/main/java/one/talon/model/LoyaltyBalanceWithTier.java +++ b/src/main/java/one/talon/model/LoyaltyBalanceWithTier.java @@ -24,7 +24,6 @@ import java.util.Arrays; import one.talon.model.ProjectedTier; import one.talon.model.Tier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -367,10 +366,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyBalances.java b/src/main/java/one/talon/model/LoyaltyBalances.java index 3a171994..7e2f6413 100644 --- a/src/main/java/one/talon/model/LoyaltyBalances.java +++ b/src/main/java/one/talon/model/LoyaltyBalances.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.Map; import one.talon.model.LoyaltyBalance; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyBalancesWithTiers.java b/src/main/java/one/talon/model/LoyaltyBalancesWithTiers.java index e9d1433c..7fe03603 100644 --- a/src/main/java/one/talon/model/LoyaltyBalancesWithTiers.java +++ b/src/main/java/one/talon/model/LoyaltyBalancesWithTiers.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.Map; import one.talon.model.LoyaltyBalanceWithTier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyCard.java b/src/main/java/one/talon/model/LoyaltyCard.java index 7f39cf33..207d00d5 100644 --- a/src/main/java/one/talon/model/LoyaltyCard.java +++ b/src/main/java/one/talon/model/LoyaltyCard.java @@ -28,7 +28,6 @@ import java.util.Map; import one.talon.model.LedgerInfo; import one.talon.model.LoyaltyCardProfileRegistration; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -570,10 +569,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyCardBalances.java b/src/main/java/one/talon/model/LoyaltyCardBalances.java index 06fde0b4..cd497b27 100644 --- a/src/main/java/one/talon/model/LoyaltyCardBalances.java +++ b/src/main/java/one/talon/model/LoyaltyCardBalances.java @@ -27,7 +27,6 @@ import java.util.Map; import one.talon.model.LoyaltyBalance; import one.talon.model.LoyaltyCardProfileRegistration; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -230,10 +229,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyCardBatch.java b/src/main/java/one/talon/model/LoyaltyCardBatch.java index b1ecd625..44135d27 100644 --- a/src/main/java/one/talon/model/LoyaltyCardBatch.java +++ b/src/main/java/one/talon/model/LoyaltyCardBatch.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CodeGeneratorSettings; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -287,10 +286,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyCardBatchResponse.java b/src/main/java/one/talon/model/LoyaltyCardBatchResponse.java index 21c4868c..118919f2 100644 --- a/src/main/java/one/talon/model/LoyaltyCardBatchResponse.java +++ b/src/main/java/one/talon/model/LoyaltyCardBatchResponse.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyCardProfileRegistration.java b/src/main/java/one/talon/model/LoyaltyCardProfileRegistration.java index 20e98cc3..63106c5c 100644 --- a/src/main/java/one/talon/model/LoyaltyCardProfileRegistration.java +++ b/src/main/java/one/talon/model/LoyaltyCardProfileRegistration.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyCardRegistration.java b/src/main/java/one/talon/model/LoyaltyCardRegistration.java index b54913d6..09422503 100644 --- a/src/main/java/one/talon/model/LoyaltyCardRegistration.java +++ b/src/main/java/one/talon/model/LoyaltyCardRegistration.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyDashboardData.java b/src/main/java/one/talon/model/LoyaltyDashboardData.java index 35fe744a..b0366af9 100644 --- a/src/main/java/one/talon/model/LoyaltyDashboardData.java +++ b/src/main/java/one/talon/model/LoyaltyDashboardData.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.LoyaltyDashboardPointsBreakdown; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -393,10 +392,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyDashboardPointsBreakdown.java b/src/main/java/one/talon/model/LoyaltyDashboardPointsBreakdown.java index 3cdd700e..45610597 100644 --- a/src/main/java/one/talon/model/LoyaltyDashboardPointsBreakdown.java +++ b/src/main/java/one/talon/model/LoyaltyDashboardPointsBreakdown.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyLedger.java b/src/main/java/one/talon/model/LoyaltyLedger.java index 54bc401d..d87513c6 100644 --- a/src/main/java/one/talon/model/LoyaltyLedger.java +++ b/src/main/java/one/talon/model/LoyaltyLedger.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.Map; import one.talon.model.LoyaltySubLedger; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyLedgerEntry.java b/src/main/java/one/talon/model/LoyaltyLedgerEntry.java index a9c9ecc7..9cc37303 100644 --- a/src/main/java/one/talon/model/LoyaltyLedgerEntry.java +++ b/src/main/java/one/talon/model/LoyaltyLedgerEntry.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.LoyaltyLedgerEntryFlags; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -549,10 +548,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyLedgerEntryExpiryDateChange.java b/src/main/java/one/talon/model/LoyaltyLedgerEntryExpiryDateChange.java index 7b3e68f6..51a1275e 100644 --- a/src/main/java/one/talon/model/LoyaltyLedgerEntryExpiryDateChange.java +++ b/src/main/java/one/talon/model/LoyaltyLedgerEntryExpiryDateChange.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyLedgerEntryFlags.java b/src/main/java/one/talon/model/LoyaltyLedgerEntryFlags.java index d2156953..26846902 100644 --- a/src/main/java/one/talon/model/LoyaltyLedgerEntryFlags.java +++ b/src/main/java/one/talon/model/LoyaltyLedgerEntryFlags.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyLedgerTransactions.java b/src/main/java/one/talon/model/LoyaltyLedgerTransactions.java index 96a7b8df..64673856 100644 --- a/src/main/java/one/talon/model/LoyaltyLedgerTransactions.java +++ b/src/main/java/one/talon/model/LoyaltyLedgerTransactions.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyLedgerEntry; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyMembership.java b/src/main/java/one/talon/model/LoyaltyMembership.java index 628983cb..006123ad 100644 --- a/src/main/java/one/talon/model/LoyaltyMembership.java +++ b/src/main/java/one/talon/model/LoyaltyMembership.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyProgram.java b/src/main/java/one/talon/model/LoyaltyProgram.java index fa3f303a..79378d76 100644 --- a/src/main/java/one/talon/model/LoyaltyProgram.java +++ b/src/main/java/one/talon/model/LoyaltyProgram.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.LoyaltyTier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -1044,10 +1043,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyProgramBalance.java b/src/main/java/one/talon/model/LoyaltyProgramBalance.java index a1517a74..bf515dcd 100644 --- a/src/main/java/one/talon/model/LoyaltyProgramBalance.java +++ b/src/main/java/one/talon/model/LoyaltyProgramBalance.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -339,10 +338,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyProgramEntity.java b/src/main/java/one/talon/model/LoyaltyProgramEntity.java index a1fc13da..8e19009b 100644 --- a/src/main/java/one/talon/model/LoyaltyProgramEntity.java +++ b/src/main/java/one/talon/model/LoyaltyProgramEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyProgramLedgers.java b/src/main/java/one/talon/model/LoyaltyProgramLedgers.java index cdf5a826..99e147e1 100644 --- a/src/main/java/one/talon/model/LoyaltyProgramLedgers.java +++ b/src/main/java/one/talon/model/LoyaltyProgramLedgers.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.Map; import one.talon.model.LedgerInfo; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -298,10 +297,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyProgramTransaction.java b/src/main/java/one/talon/model/LoyaltyProgramTransaction.java index a6f4d463..e2b9c639 100644 --- a/src/main/java/one/talon/model/LoyaltyProgramTransaction.java +++ b/src/main/java/one/talon/model/LoyaltyProgramTransaction.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.LoyaltyLedgerEntryFlags; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -731,10 +730,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltySubLedger.java b/src/main/java/one/talon/model/LoyaltySubLedger.java index f267d58c..49ddbc2f 100644 --- a/src/main/java/one/talon/model/LoyaltySubLedger.java +++ b/src/main/java/one/talon/model/LoyaltySubLedger.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.LoyaltyLedgerEntry; import one.talon.model.Tier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -487,10 +486,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/LoyaltyTier.java b/src/main/java/one/talon/model/LoyaltyTier.java index 3c02ce70..ebf19d7a 100644 --- a/src/main/java/one/talon/model/LoyaltyTier.java +++ b/src/main/java/one/talon/model/LoyaltyTier.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -316,10 +315,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MCPKey.java b/src/main/java/one/talon/model/MCPKey.java index e50c24c8..16e4ba8a 100644 --- a/src/main/java/one/talon/model/MCPKey.java +++ b/src/main/java/one/talon/model/MCPKey.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -339,10 +338,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ManagementKey.java b/src/main/java/one/talon/model/ManagementKey.java index 7c64e763..b3c1413e 100644 --- a/src/main/java/one/talon/model/ManagementKey.java +++ b/src/main/java/one/talon/model/ManagementKey.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Endpoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -410,10 +409,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ManagerConfig.java b/src/main/java/one/talon/model/ManagerConfig.java index c041349d..d2944134 100644 --- a/src/main/java/one/talon/model/ManagerConfig.java +++ b/src/main/java/one/talon/model/ManagerConfig.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MessageLogEntries.java b/src/main/java/one/talon/model/MessageLogEntries.java index de14c3fa..08fc1b29 100644 --- a/src/main/java/one/talon/model/MessageLogEntries.java +++ b/src/main/java/one/talon/model/MessageLogEntries.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.MessageLogEntry; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MessageLogEntry.java b/src/main/java/one/talon/model/MessageLogEntry.java index 505a83ed..0b5861ce 100644 --- a/src/main/java/one/talon/model/MessageLogEntry.java +++ b/src/main/java/one/talon/model/MessageLogEntry.java @@ -24,7 +24,6 @@ import java.util.Arrays; import one.talon.model.MessageLogRequest; import one.talon.model.MessageLogResponse; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -580,10 +579,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MessageLogRequest.java b/src/main/java/one/talon/model/MessageLogRequest.java index fe0ce6a9..4a0403b9 100644 --- a/src/main/java/one/talon/model/MessageLogRequest.java +++ b/src/main/java/one/talon/model/MessageLogRequest.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MessageLogResponse.java b/src/main/java/one/talon/model/MessageLogResponse.java index ecba53ba..0b112587 100644 --- a/src/main/java/one/talon/model/MessageLogResponse.java +++ b/src/main/java/one/talon/model/MessageLogResponse.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MessageTest.java b/src/main/java/one/talon/model/MessageTest.java index 23973e49..20d18580 100644 --- a/src/main/java/one/talon/model/MessageTest.java +++ b/src/main/java/one/talon/model/MessageTest.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Meta.java b/src/main/java/one/talon/model/Meta.java index c839dc5b..82a238dd 100644 --- a/src/main/java/one/talon/model/Meta.java +++ b/src/main/java/one/talon/model/Meta.java @@ -23,7 +23,6 @@ import java.util.Arrays; import one.talon.model.CouponRejectionReason; import one.talon.model.ReferralRejectionReason; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ModelImport.java b/src/main/java/one/talon/model/ModelImport.java index 658252d5..a7bce25f 100644 --- a/src/main/java/one/talon/model/ModelImport.java +++ b/src/main/java/one/talon/model/ModelImport.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -288,10 +287,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ModelReturn.java b/src/main/java/one/talon/model/ModelReturn.java index 3cdf9f7d..cb811064 100644 --- a/src/main/java/one/talon/model/ModelReturn.java +++ b/src/main/java/one/talon/model/ModelReturn.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ReturnedCartItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -428,10 +427,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultiApplicationEntity.java b/src/main/java/one/talon/model/MultiApplicationEntity.java index 02b46bb2..5dd7dec2 100644 --- a/src/main/java/one/talon/model/MultiApplicationEntity.java +++ b/src/main/java/one/talon/model/MultiApplicationEntity.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleAttribute.java b/src/main/java/one/talon/model/MultipleAttribute.java index b27dc2e6..b7377991 100644 --- a/src/main/java/one/talon/model/MultipleAttribute.java +++ b/src/main/java/one/talon/model/MultipleAttribute.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Attribute; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleAudiences.java b/src/main/java/one/talon/model/MultipleAudiences.java index 67e4fa2b..36888a9f 100644 --- a/src/main/java/one/talon/model/MultipleAudiences.java +++ b/src/main/java/one/talon/model/MultipleAudiences.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.MultipleAudiencesItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleAudiencesItem.java b/src/main/java/one/talon/model/MultipleAudiencesItem.java index a7c4fdbe..38173f06 100644 --- a/src/main/java/one/talon/model/MultipleAudiencesItem.java +++ b/src/main/java/one/talon/model/MultipleAudiencesItem.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -351,10 +350,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequest.java b/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequest.java index e16772fb..e8ebce9d 100644 --- a/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequest.java +++ b/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.MultipleCustomerProfileIntegrationRequestItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequestItem.java b/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequestItem.java index 15d94c10..dad67046 100644 --- a/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequestItem.java +++ b/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationRequestItem.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationResponseV2.java b/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationResponseV2.java index 85e35a22..bd1c8609 100644 --- a/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationResponseV2.java +++ b/src/main/java/one/talon/model/MultipleCustomerProfileIntegrationResponseV2.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CustomerProfileUpdateV2Response; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleNewAttribute.java b/src/main/java/one/talon/model/MultipleNewAttribute.java index 8ab54030..606a4bf1 100644 --- a/src/main/java/one/talon/model/MultipleNewAttribute.java +++ b/src/main/java/one/talon/model/MultipleNewAttribute.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewAttribute; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MultipleNewAudiences.java b/src/main/java/one/talon/model/MultipleNewAudiences.java index ac7751b5..688fb60a 100644 --- a/src/main/java/one/talon/model/MultipleNewAudiences.java +++ b/src/main/java/one/talon/model/MultipleNewAudiences.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewMultipleAudiencesItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/MutableEntity.java b/src/main/java/one/talon/model/MutableEntity.java index bc59a17e..0897bea4 100644 --- a/src/main/java/one/talon/model/MutableEntity.java +++ b/src/main/java/one/talon/model/MutableEntity.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewAccount.java b/src/main/java/one/talon/model/NewAccount.java index 5a505128..7deb7a98 100644 --- a/src/main/java/one/talon/model/NewAccount.java +++ b/src/main/java/one/talon/model/NewAccount.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewAccountSignUp.java b/src/main/java/one/talon/model/NewAccountSignUp.java index badfc727..a788ca7c 100644 --- a/src/main/java/one/talon/model/NewAccountSignUp.java +++ b/src/main/java/one/talon/model/NewAccountSignUp.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewAdditionalCost.java b/src/main/java/one/talon/model/NewAdditionalCost.java index 9539a8f4..36bb354a 100644 --- a/src/main/java/one/talon/model/NewAdditionalCost.java +++ b/src/main/java/one/talon/model/NewAdditionalCost.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -324,10 +323,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewAppWideCouponDeletionJob.java b/src/main/java/one/talon/model/NewAppWideCouponDeletionJob.java index 47e8803a..271f26d2 100644 --- a/src/main/java/one/talon/model/NewAppWideCouponDeletionJob.java +++ b/src/main/java/one/talon/model/NewAppWideCouponDeletionJob.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CouponDeletionFilters; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewApplication.java b/src/main/java/one/talon/model/NewApplication.java index 34f8fa93..ff3a236d 100644 --- a/src/main/java/one/talon/model/NewApplication.java +++ b/src/main/java/one/talon/model/NewApplication.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.AttributesSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -720,10 +719,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewApplicationAPIKey.java b/src/main/java/one/talon/model/NewApplicationAPIKey.java index 8e702942..9fae7cf5 100644 --- a/src/main/java/one/talon/model/NewApplicationAPIKey.java +++ b/src/main/java/one/talon/model/NewApplicationAPIKey.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -535,10 +534,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewApplicationCIF.java b/src/main/java/one/talon/model/NewApplicationCIF.java index 13caf359..b862a9ed 100644 --- a/src/main/java/one/talon/model/NewApplicationCIF.java +++ b/src/main/java/one/talon/model/NewApplicationCIF.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -287,10 +286,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewApplicationCIFExpression.java b/src/main/java/one/talon/model/NewApplicationCIFExpression.java index a3355a50..e5fb00c0 100644 --- a/src/main/java/one/talon/model/NewApplicationCIFExpression.java +++ b/src/main/java/one/talon/model/NewApplicationCIFExpression.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewAttribute.java b/src/main/java/one/talon/model/NewAttribute.java index b6a682b8..d74f52f8 100644 --- a/src/main/java/one/talon/model/NewAttribute.java +++ b/src/main/java/one/talon/model/NewAttribute.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -690,10 +689,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewAudience.java b/src/main/java/one/talon/model/NewAudience.java index 26b001eb..5556e043 100644 --- a/src/main/java/one/talon/model/NewAudience.java +++ b/src/main/java/one/talon/model/NewAudience.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -349,10 +348,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewBaseNotification.java b/src/main/java/one/talon/model/NewBaseNotification.java index 9b3dcd28..4ec65c4d 100644 --- a/src/main/java/one/talon/model/NewBaseNotification.java +++ b/src/main/java/one/talon/model/NewBaseNotification.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.NewNotificationWebhook; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewBlueprint.java b/src/main/java/one/talon/model/NewBlueprint.java index 3997888e..6489e031 100644 --- a/src/main/java/one/talon/model/NewBlueprint.java +++ b/src/main/java/one/talon/model/NewBlueprint.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.CartItemFilterTemplate; import one.talon.model.CatalogRule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -336,10 +335,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaign.java b/src/main/java/one/talon/model/NewCampaign.java index 71831cc5..5e33c739 100644 --- a/src/main/java/one/talon/model/NewCampaign.java +++ b/src/main/java/one/talon/model/NewCampaign.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -170,7 +169,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -809,10 +810,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignCollection.java b/src/main/java/one/talon/model/NewCampaignCollection.java index 9cc5f638..9cff280e 100644 --- a/src/main/java/one/talon/model/NewCampaignCollection.java +++ b/src/main/java/one/talon/model/NewCampaignCollection.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignEvaluationGroup.java b/src/main/java/one/talon/model/NewCampaignEvaluationGroup.java index c9b04473..f959b629 100644 --- a/src/main/java/one/talon/model/NewCampaignEvaluationGroup.java +++ b/src/main/java/one/talon/model/NewCampaignEvaluationGroup.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -395,10 +394,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignGroup.java b/src/main/java/one/talon/model/NewCampaignGroup.java index 9720fab4..75188e47 100644 --- a/src/main/java/one/talon/model/NewCampaignGroup.java +++ b/src/main/java/one/talon/model/NewCampaignGroup.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -252,10 +251,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignSet.java b/src/main/java/one/talon/model/NewCampaignSet.java index 5422fc5a..77b8b0e7 100644 --- a/src/main/java/one/talon/model/NewCampaignSet.java +++ b/src/main/java/one/talon/model/NewCampaignSet.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CampaignSetBranchNode; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -210,10 +209,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignStoreBudget.java b/src/main/java/one/talon/model/NewCampaignStoreBudget.java index 591db2a1..f2fdaad3 100644 --- a/src/main/java/one/talon/model/NewCampaignStoreBudget.java +++ b/src/main/java/one/talon/model/NewCampaignStoreBudget.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewCampaignStoreBudgetStoreLimit; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -325,10 +324,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignStoreBudgetStoreLimit.java b/src/main/java/one/talon/model/NewCampaignStoreBudgetStoreLimit.java index 2eae3053..fea5a1fd 100644 --- a/src/main/java/one/talon/model/NewCampaignStoreBudgetStoreLimit.java +++ b/src/main/java/one/talon/model/NewCampaignStoreBudgetStoreLimit.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCampaignTemplate.java b/src/main/java/one/talon/model/NewCampaignTemplate.java index 4a57314b..f6d0270e 100644 --- a/src/main/java/one/talon/model/NewCampaignTemplate.java +++ b/src/main/java/one/talon/model/NewCampaignTemplate.java @@ -28,7 +28,6 @@ import one.talon.model.CampaignTemplateParams; import one.talon.model.CodeGeneratorSettings; import one.talon.model.TemplateLimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,7 +166,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -785,10 +786,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCatalog.java b/src/main/java/one/talon/model/NewCatalog.java index d0209942..eddad639 100644 --- a/src/main/java/one/talon/model/NewCatalog.java +++ b/src/main/java/one/talon/model/NewCatalog.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCollection.java b/src/main/java/one/talon/model/NewCollection.java index 51363ab9..6a7945b2 100644 --- a/src/main/java/one/talon/model/NewCollection.java +++ b/src/main/java/one/talon/model/NewCollection.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCouponCreationJob.java b/src/main/java/one/talon/model/NewCouponCreationJob.java index b2b8ffa5..4a106718 100644 --- a/src/main/java/one/talon/model/NewCouponCreationJob.java +++ b/src/main/java/one/talon/model/NewCouponCreationJob.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.CodeGeneratorSettings; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -375,10 +374,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCouponDeletionJob.java b/src/main/java/one/talon/model/NewCouponDeletionJob.java index 214f4032..d6b41ebf 100644 --- a/src/main/java/one/talon/model/NewCouponDeletionJob.java +++ b/src/main/java/one/talon/model/NewCouponDeletionJob.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.CouponDeletionFilters; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCoupons.java b/src/main/java/one/talon/model/NewCoupons.java index 162d4067..c3766d47 100644 --- a/src/main/java/one/talon/model/NewCoupons.java +++ b/src/main/java/one/talon/model/NewCoupons.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -521,10 +520,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCouponsForMultipleRecipients.java b/src/main/java/one/talon/model/NewCouponsForMultipleRecipients.java index 49c16222..d783660d 100644 --- a/src/main/java/one/talon/model/NewCouponsForMultipleRecipients.java +++ b/src/main/java/one/talon/model/NewCouponsForMultipleRecipients.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -390,10 +389,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCustomEffect.java b/src/main/java/one/talon/model/NewCustomEffect.java index 6732260c..8ae32766 100644 --- a/src/main/java/one/talon/model/NewCustomEffect.java +++ b/src/main/java/one/talon/model/NewCustomEffect.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -357,10 +356,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCustomerProfile.java b/src/main/java/one/talon/model/NewCustomerProfile.java index f4bd8478..65dece14 100644 --- a/src/main/java/one/talon/model/NewCustomerProfile.java +++ b/src/main/java/one/talon/model/NewCustomerProfile.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCustomerSession.java b/src/main/java/one/talon/model/NewCustomerSession.java index 936c7773..067f5c85 100644 --- a/src/main/java/one/talon/model/NewCustomerSession.java +++ b/src/main/java/one/talon/model/NewCustomerSession.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CartItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -414,10 +413,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewCustomerSessionV2.java b/src/main/java/one/talon/model/NewCustomerSessionV2.java index c1b3d5b9..6291cbf0 100644 --- a/src/main/java/one/talon/model/NewCustomerSessionV2.java +++ b/src/main/java/one/talon/model/NewCustomerSessionV2.java @@ -28,7 +28,6 @@ import one.talon.model.AdditionalCost; import one.talon.model.CartItem; import one.talon.model.ExperimentVariantAllocation; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -569,10 +568,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewEvent.java b/src/main/java/one/talon/model/NewEvent.java index 3bafadf8..4440a45f 100644 --- a/src/main/java/one/talon/model/NewEvent.java +++ b/src/main/java/one/talon/model/NewEvent.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -123,7 +122,7 @@ public NewEvent type(@javax.annotation.Nonnull String type) { } /** - * A string representing the event. Must not be a reserved event name. + * The name of the event. Must be a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events), not a built-in event. * @return type */ @javax.annotation.Nonnull @@ -260,10 +259,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewEventType.java b/src/main/java/one/talon/model/NewEventType.java index 034b0ad5..106acf73 100644 --- a/src/main/java/one/talon/model/NewEventType.java +++ b/src/main/java/one/talon/model/NewEventType.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewEventV3Entity.java b/src/main/java/one/talon/model/NewEventV3Entity.java new file mode 100644 index 00000000..76830fcd --- /dev/null +++ b/src/main/java/one/talon/model/NewEventV3Entity.java @@ -0,0 +1,290 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * NewEventV3Entity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class NewEventV3Entity { + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + @javax.annotation.Nonnull + private String integrationId; + + public NewEventV3Entity() { + } + + public NewEventV3Entity integrationId(@javax.annotation.Nonnull String integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * The unique ID of the event. Only one event with this ID can be registered. + * @return integrationId + */ + @javax.annotation.Nonnull + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(@javax.annotation.Nonnull String integrationId) { + this.integrationId = integrationId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the NewEventV3Entity instance itself + */ + public NewEventV3Entity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEventV3Entity newEventV3Entity = (NewEventV3Entity) o; + return Objects.equals(this.integrationId, newEventV3Entity.integrationId)&& + Objects.equals(this.additionalProperties, newEventV3Entity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(integrationId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEventV3Entity {\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("integrationId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("integrationId")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEventV3Entity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEventV3Entity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in NewEventV3Entity is not found in the empty JSON string", NewEventV3Entity.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEventV3Entity.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `integrationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEventV3Entity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEventV3Entity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEventV3Entity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEventV3Entity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public NewEventV3Entity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NewEventV3Entity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEventV3Entity given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEventV3Entity + * @throws IOException if the JSON string is invalid with respect to NewEventV3Entity + */ + public static NewEventV3Entity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEventV3Entity.class); + } + + /** + * Convert an instance of NewEventV3Entity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/NewExperiment.java b/src/main/java/one/talon/model/NewExperiment.java index 1658f8aa..0f4dd26d 100644 --- a/src/main/java/one/talon/model/NewExperiment.java +++ b/src/main/java/one/talon/model/NewExperiment.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.NewCampaign; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,6 +61,72 @@ public class NewExperiment { @javax.annotation.Nonnull private NewCampaign campaign; + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. + */ + @JsonAdapter(GoalTypeEnum.Adapter.class) + public enum GoalTypeEnum { + OTHER("other"), + + MAXIMIZE_REVENUE("maximize_revenue"), + + MAXIMIZE_ITEMS_SOLD("maximize_items_sold"), + + OPTIMIZE_DISCOUNT_EFFICIENCY("optimize_discount_efficiency"); + + private String value; + + GoalTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GoalTypeEnum fromValue(String value) { + for (GoalTypeEnum b : GoalTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GoalTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GoalTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GoalTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GoalTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GOAL_TYPE = "goalType"; + @SerializedName(SERIALIZED_NAME_GOAL_TYPE) + @javax.annotation.Nonnull + private GoalTypeEnum goalType = GoalTypeEnum.OTHER; + + public static final String SERIALIZED_NAME_GOAL_DESCRIPTION = "goalDescription"; + @SerializedName(SERIALIZED_NAME_GOAL_DESCRIPTION) + @javax.annotation.Nullable + private String goalDescription; + public NewExperiment() { } @@ -102,6 +167,44 @@ public void setCampaign(@javax.annotation.Nonnull NewCampaign campaign) { this.campaign = campaign; } + + public NewExperiment goalType(@javax.annotation.Nonnull GoalTypeEnum goalType) { + this.goalType = goalType; + return this; + } + + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. + * @return goalType + */ + @javax.annotation.Nonnull + public GoalTypeEnum getGoalType() { + return goalType; + } + + public void setGoalType(@javax.annotation.Nonnull GoalTypeEnum goalType) { + this.goalType = goalType; + } + + + public NewExperiment goalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + return this; + } + + /** + * A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. + * @return goalDescription + */ + @javax.annotation.Nullable + public String getGoalDescription() { + return goalDescription; + } + + public void setGoalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -158,13 +261,15 @@ public boolean equals(Object o) { } NewExperiment newExperiment = (NewExperiment) o; return Objects.equals(this.isVariantAssignmentExternal, newExperiment.isVariantAssignmentExternal) && - Objects.equals(this.campaign, newExperiment.campaign)&& + Objects.equals(this.campaign, newExperiment.campaign) && + Objects.equals(this.goalType, newExperiment.goalType) && + Objects.equals(this.goalDescription, newExperiment.goalDescription)&& Objects.equals(this.additionalProperties, newExperiment.additionalProperties); } @Override public int hashCode() { - return Objects.hash(isVariantAssignmentExternal, campaign, additionalProperties); + return Objects.hash(isVariantAssignmentExternal, campaign, goalType, goalDescription, additionalProperties); } @Override @@ -173,6 +278,8 @@ public String toString() { sb.append("class NewExperiment {\n"); sb.append(" isVariantAssignmentExternal: ").append(toIndentedString(isVariantAssignmentExternal)).append("\n"); sb.append(" campaign: ").append(toIndentedString(campaign)).append("\n"); + sb.append(" goalType: ").append(toIndentedString(goalType)).append("\n"); + sb.append(" goalDescription: ").append(toIndentedString(goalDescription)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -183,10 +290,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -195,10 +299,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign")); + openapiFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign", "goalType", "goalDescription")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign")); + openapiRequiredFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign", "goalType")); } /** @@ -223,6 +327,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `campaign` NewCampaign.validateJsonElement(jsonObj.get("campaign")); + if (!jsonObj.get("goalType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalType").toString())); + } + // validate the required field `goalType` + GoalTypeEnum.validateJsonElement(jsonObj.get("goalType")); + if ((jsonObj.get("goalDescription") != null && !jsonObj.get("goalDescription").isJsonNull()) && !jsonObj.get("goalDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalDescription").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/NewExperimentVariant.java b/src/main/java/one/talon/model/NewExperimentVariant.java index b75ff5d4..61e39501 100644 --- a/src/main/java/one/talon/model/NewExperimentVariant.java +++ b/src/main/java/one/talon/model/NewExperimentVariant.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.NewRuleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -237,10 +236,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewExperimentVariantArray.java b/src/main/java/one/talon/model/NewExperimentVariantArray.java index 3ad0ff91..798d5afb 100644 --- a/src/main/java/one/talon/model/NewExperimentVariantArray.java +++ b/src/main/java/one/talon/model/NewExperimentVariantArray.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewExperimentVariant; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewExternalInvitation.java b/src/main/java/one/talon/model/NewExternalInvitation.java index 11138cda..c1ee5311 100644 --- a/src/main/java/one/talon/model/NewExternalInvitation.java +++ b/src/main/java/one/talon/model/NewExternalInvitation.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewGiveawaysPool.java b/src/main/java/one/talon/model/NewGiveawaysPool.java index 07088299..cc5073dc 100644 --- a/src/main/java/one/talon/model/NewGiveawaysPool.java +++ b/src/main/java/one/talon/model/NewGiveawaysPool.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewInternalAudience.java b/src/main/java/one/talon/model/NewInternalAudience.java index 57a2cb36..ed437cc4 100644 --- a/src/main/java/one/talon/model/NewInternalAudience.java +++ b/src/main/java/one/talon/model/NewInternalAudience.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewInvitation.java b/src/main/java/one/talon/model/NewInvitation.java index 4a713659..7c38abf4 100644 --- a/src/main/java/one/talon/model/NewInvitation.java +++ b/src/main/java/one/talon/model/NewInvitation.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -270,10 +269,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewInviteEmail.java b/src/main/java/one/talon/model/NewInviteEmail.java index b58adf1a..1c580d81 100644 --- a/src/main/java/one/talon/model/NewInviteEmail.java +++ b/src/main/java/one/talon/model/NewInviteEmail.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewLoyaltyProgram.java b/src/main/java/one/talon/model/NewLoyaltyProgram.java index 6e33b3aa..a952a4f6 100644 --- a/src/main/java/one/talon/model/NewLoyaltyProgram.java +++ b/src/main/java/one/talon/model/NewLoyaltyProgram.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.NewLoyaltyTier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -862,10 +861,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewLoyaltyTier.java b/src/main/java/one/talon/model/NewLoyaltyTier.java index 4791c3f1..f7ed5dd5 100644 --- a/src/main/java/one/talon/model/NewLoyaltyTier.java +++ b/src/main/java/one/talon/model/NewLoyaltyTier.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -185,10 +184,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewMCPKey.java b/src/main/java/one/talon/model/NewMCPKey.java index 8d8ba1a7..353751f1 100644 --- a/src/main/java/one/talon/model/NewMCPKey.java +++ b/src/main/java/one/talon/model/NewMCPKey.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -365,10 +364,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewManagementKey.java b/src/main/java/one/talon/model/NewManagementKey.java index 8ca89fa3..a5007802 100644 --- a/src/main/java/one/talon/model/NewManagementKey.java +++ b/src/main/java/one/talon/model/NewManagementKey.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Endpoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -436,10 +435,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewMessageTest.java b/src/main/java/one/talon/model/NewMessageTest.java index ec8f2fee..04072391 100644 --- a/src/main/java/one/talon/model/NewMessageTest.java +++ b/src/main/java/one/talon/model/NewMessageTest.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -399,10 +398,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewMultipleAudiencesItem.java b/src/main/java/one/talon/model/NewMultipleAudiencesItem.java index 71709f9c..5e10c5b5 100644 --- a/src/main/java/one/talon/model/NewMultipleAudiencesItem.java +++ b/src/main/java/one/talon/model/NewMultipleAudiencesItem.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewNotificationWebhook.java b/src/main/java/one/talon/model/NewNotificationWebhook.java index 6ab54432..a1a5689c 100644 --- a/src/main/java/one/talon/model/NewNotificationWebhook.java +++ b/src/main/java/one/talon/model/NewNotificationWebhook.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewOutgoingIntegrationWebhook.java b/src/main/java/one/talon/model/NewOutgoingIntegrationWebhook.java index 7e260a3d..997a46bd 100644 --- a/src/main/java/one/talon/model/NewOutgoingIntegrationWebhook.java +++ b/src/main/java/one/talon/model/NewOutgoingIntegrationWebhook.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewPassword.java b/src/main/java/one/talon/model/NewPassword.java index ffc8a154..356828cb 100644 --- a/src/main/java/one/talon/model/NewPassword.java +++ b/src/main/java/one/talon/model/NewPassword.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewPasswordEmail.java b/src/main/java/one/talon/model/NewPasswordEmail.java index dbc59ac1..6d4fb1ed 100644 --- a/src/main/java/one/talon/model/NewPasswordEmail.java +++ b/src/main/java/one/talon/model/NewPasswordEmail.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewPicklist.java b/src/main/java/one/talon/model/NewPicklist.java index 7e692b5c..57e5c401 100644 --- a/src/main/java/one/talon/model/NewPicklist.java +++ b/src/main/java/one/talon/model/NewPicklist.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -248,10 +247,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewPriceAdjustment.java b/src/main/java/one/talon/model/NewPriceAdjustment.java index e5cac1f1..90c729df 100644 --- a/src/main/java/one/talon/model/NewPriceAdjustment.java +++ b/src/main/java/one/talon/model/NewPriceAdjustment.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -326,10 +325,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewPriceType.java b/src/main/java/one/talon/model/NewPriceType.java index 5e62c633..9ddce784 100644 --- a/src/main/java/one/talon/model/NewPriceType.java +++ b/src/main/java/one/talon/model/NewPriceType.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewReferral.java b/src/main/java/one/talon/model/NewReferral.java index 2cf2d21f..2ab49d74 100644 --- a/src/main/java/one/talon/model/NewReferral.java +++ b/src/main/java/one/talon/model/NewReferral.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -315,10 +314,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewReferralsForMultipleAdvocates.java b/src/main/java/one/talon/model/NewReferralsForMultipleAdvocates.java index 6400600e..8b5b2422 100644 --- a/src/main/java/one/talon/model/NewReferralsForMultipleAdvocates.java +++ b/src/main/java/one/talon/model/NewReferralsForMultipleAdvocates.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -359,10 +358,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewReturn.java b/src/main/java/one/talon/model/NewReturn.java index 2ef69515..7914f7d7 100644 --- a/src/main/java/one/talon/model/NewReturn.java +++ b/src/main/java/one/talon/model/NewReturn.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ReturnedCartItem; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewRevisionVersion.java b/src/main/java/one/talon/model/NewRevisionVersion.java index 0ac1924a..c7314b83 100644 --- a/src/main/java/one/talon/model/NewRevisionVersion.java +++ b/src/main/java/one/talon/model/NewRevisionVersion.java @@ -27,7 +27,6 @@ import one.talon.model.CodeGeneratorSettings; import one.talon.model.LimitConfig; import org.openapitools.jackson.nullable.JsonNullable; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -127,7 +126,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -569,10 +570,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewReward.java b/src/main/java/one/talon/model/NewReward.java index 3ab5637c..7d40520d 100644 --- a/src/main/java/one/talon/model/NewReward.java +++ b/src/main/java/one/talon/model/NewReward.java @@ -23,9 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import one.talon.model.Binding; -import one.talon.model.Rule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -80,16 +77,6 @@ public class NewReward { @javax.annotation.Nonnull private Boolean sandbox; - public static final String SERIALIZED_NAME_RULE = "rule"; - @SerializedName(SERIALIZED_NAME_RULE) - @javax.annotation.Nullable - private List rule; - - public static final String SERIALIZED_NAME_BINDINGS = "bindings"; - @SerializedName(SERIALIZED_NAME_BINDINGS) - @javax.annotation.Nullable - private List bindings; - public NewReward() { } @@ -195,60 +182,6 @@ public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { this.sandbox = sandbox; } - - public NewReward rule(@javax.annotation.Nullable List rule) { - this.rule = rule; - return this; - } - - public NewReward addRuleItem(Rule ruleItem) { - if (this.rule == null) { - this.rule = new ArrayList<>(); - } - this.rule.add(ruleItem); - return this; - } - - /** - * Rule to apply. - * @return rule - */ - @javax.annotation.Nullable - public List getRule() { - return rule; - } - - public void setRule(@javax.annotation.Nullable List rule) { - this.rule = rule; - } - - - public NewReward bindings(@javax.annotation.Nullable List bindings) { - this.bindings = bindings; - return this; - } - - public NewReward addBindingsItem(Binding bindingsItem) { - if (this.bindings == null) { - this.bindings = new ArrayList<>(); - } - this.bindings.add(bindingsItem); - return this; - } - - /** - * A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. - * @return bindings - */ - @javax.annotation.Nullable - public List getBindings() { - return bindings; - } - - public void setBindings(@javax.annotation.Nullable List bindings) { - this.bindings = bindings; - } - /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -308,15 +241,13 @@ public boolean equals(Object o) { Objects.equals(this.apiName, newReward.apiName) && Objects.equals(this.description, newReward.description) && Objects.equals(this.applicationIds, newReward.applicationIds) && - Objects.equals(this.sandbox, newReward.sandbox) && - Objects.equals(this.rule, newReward.rule) && - Objects.equals(this.bindings, newReward.bindings)&& + Objects.equals(this.sandbox, newReward.sandbox)&& Objects.equals(this.additionalProperties, newReward.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, apiName, description, applicationIds, sandbox, rule, bindings, additionalProperties); + return Objects.hash(name, apiName, description, applicationIds, sandbox, additionalProperties); } @Override @@ -328,8 +259,6 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" applicationIds: ").append(toIndentedString(applicationIds)).append("\n"); sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); - sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); - sb.append(" bindings: ").append(toIndentedString(bindings)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -340,10 +269,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -352,7 +278,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "apiName", "description", "applicationIds", "sandbox", "rule", "bindings")); + openapiFields = new HashSet(Arrays.asList("name", "apiName", "description", "applicationIds", "sandbox")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name", "apiName", "applicationIds", "sandbox")); @@ -393,34 +319,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else if (!jsonObj.get("applicationIds").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `applicationIds` to be an array in the JSON string but got `%s`", jsonObj.get("applicationIds").toString())); } - if (jsonObj.get("rule") != null && !jsonObj.get("rule").isJsonNull()) { - JsonArray jsonArrayrule = jsonObj.getAsJsonArray("rule"); - if (jsonArrayrule != null) { - // ensure the json data is an array - if (!jsonObj.get("rule").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rule` to be an array in the JSON string but got `%s`", jsonObj.get("rule").toString())); - } - - // validate the optional field `rule` (array) - for (int i = 0; i < jsonArrayrule.size(); i++) { - Rule.validateJsonElement(jsonArrayrule.get(i)); - }; - } - } - if (jsonObj.get("bindings") != null && !jsonObj.get("bindings").isJsonNull()) { - JsonArray jsonArraybindings = jsonObj.getAsJsonArray("bindings"); - if (jsonArraybindings != null) { - // ensure the json data is an array - if (!jsonObj.get("bindings").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `bindings` to be an array in the JSON string but got `%s`", jsonObj.get("bindings").toString())); - } - - // validate the optional field `bindings` (array) - for (int i = 0; i < jsonArraybindings.size(); i++) { - Binding.validateJsonElement(jsonArraybindings.get(i)); - }; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/NewRiskNotification.java b/src/main/java/one/talon/model/NewRiskNotification.java new file mode 100644 index 00000000..2b87006a --- /dev/null +++ b/src/main/java/one/talon/model/NewRiskNotification.java @@ -0,0 +1,516 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * Data for creating a new risk notification. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class NewRiskNotification { + /** + * The entity type to analyze within the given time frame. + */ + @JsonAdapter(EntityEnum.Adapter.class) + public enum EntityEnum { + CUSTOMER_PROFILE("customer_profile"), + + CUSTOMER_SESSION("customer_session"); + + private String value; + + EntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EntityEnum fromValue(String value) { + for (EntityEnum b : EntityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EntityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EntityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EntityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EntityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENTITY = "entity"; + @SerializedName(SERIALIZED_NAME_ENTITY) + @javax.annotation.Nonnull + private EntityEnum entity; + + /** + * The activity metric to analyze within the given entity. + */ + @JsonAdapter(ActivityEnum.Adapter.class) + public enum ActivityEnum { + LOYALTY_POINTS_EARNED("loyalty_points_earned"), + + DISCOUNTED_AMOUNT("discounted_amount"), + + COMPLETED_ORDERS("completed_orders"), + + COUPON_ATTEMPTS("coupon_attempts"); + + private String value; + + ActivityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActivityEnum fromValue(String value) { + for (ActivityEnum b : ActivityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActivityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActivityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActivityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ActivityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ACTIVITY = "activity"; + @SerializedName(SERIALIZED_NAME_ACTIVITY) + @javax.annotation.Nonnull + private ActivityEnum activity; + + /** + * The rolling time window for risk evaluation. + */ + @JsonAdapter(TimeFrameEnum.Adapter.class) + public enum TimeFrameEnum { + _1_DAY("1_day"), + + _1_WEEK("1_week"), + + _1_MONTH("1_month"); + + private String value; + + TimeFrameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeFrameEnum fromValue(String value) { + for (TimeFrameEnum b : TimeFrameEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TimeFrameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeFrameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeFrameEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TimeFrameEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIME_FRAME = "timeFrame"; + @SerializedName(SERIALIZED_NAME_TIME_FRAME) + @javax.annotation.Nonnull + private TimeFrameEnum timeFrame; + + public NewRiskNotification() { + } + + public NewRiskNotification entity(@javax.annotation.Nonnull EntityEnum entity) { + this.entity = entity; + return this; + } + + /** + * The entity type to analyze within the given time frame. + * @return entity + */ + @javax.annotation.Nonnull + public EntityEnum getEntity() { + return entity; + } + + public void setEntity(@javax.annotation.Nonnull EntityEnum entity) { + this.entity = entity; + } + + + public NewRiskNotification activity(@javax.annotation.Nonnull ActivityEnum activity) { + this.activity = activity; + return this; + } + + /** + * The activity metric to analyze within the given entity. + * @return activity + */ + @javax.annotation.Nonnull + public ActivityEnum getActivity() { + return activity; + } + + public void setActivity(@javax.annotation.Nonnull ActivityEnum activity) { + this.activity = activity; + } + + + public NewRiskNotification timeFrame(@javax.annotation.Nonnull TimeFrameEnum timeFrame) { + this.timeFrame = timeFrame; + return this; + } + + /** + * The rolling time window for risk evaluation. + * @return timeFrame + */ + @javax.annotation.Nonnull + public TimeFrameEnum getTimeFrame() { + return timeFrame; + } + + public void setTimeFrame(@javax.annotation.Nonnull TimeFrameEnum timeFrame) { + this.timeFrame = timeFrame; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the NewRiskNotification instance itself + */ + public NewRiskNotification putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewRiskNotification newRiskNotification = (NewRiskNotification) o; + return Objects.equals(this.entity, newRiskNotification.entity) && + Objects.equals(this.activity, newRiskNotification.activity) && + Objects.equals(this.timeFrame, newRiskNotification.timeFrame)&& + Objects.equals(this.additionalProperties, newRiskNotification.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entity, activity, timeFrame, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewRiskNotification {\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" activity: ").append(toIndentedString(activity)).append("\n"); + sb.append(" timeFrame: ").append(toIndentedString(timeFrame)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("entity", "activity", "timeFrame")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("entity", "activity", "timeFrame")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewRiskNotification + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewRiskNotification.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in NewRiskNotification is not found in the empty JSON string", NewRiskNotification.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewRiskNotification.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("entity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + } + // validate the required field `entity` + EntityEnum.validateJsonElement(jsonObj.get("entity")); + if (!jsonObj.get("activity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `activity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + // validate the required field `activity` + ActivityEnum.validateJsonElement(jsonObj.get("activity")); + if (!jsonObj.get("timeFrame").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `timeFrame` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeFrame").toString())); + } + // validate the required field `timeFrame` + TimeFrameEnum.validateJsonElement(jsonObj.get("timeFrame")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewRiskNotification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewRiskNotification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewRiskNotification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewRiskNotification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public NewRiskNotification read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NewRiskNotification instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewRiskNotification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewRiskNotification + * @throws IOException if the JSON string is invalid with respect to NewRiskNotification + */ + public static NewRiskNotification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewRiskNotification.class); + } + + /** + * Convert an instance of NewRiskNotification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/NewRole.java b/src/main/java/one/talon/model/NewRole.java index 56157086..cc9e5dfe 100644 --- a/src/main/java/one/talon/model/NewRole.java +++ b/src/main/java/one/talon/model/NewRole.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewRoleV2.java b/src/main/java/one/talon/model/NewRoleV2.java index 5bfaa40d..18fe37ec 100644 --- a/src/main/java/one/talon/model/NewRoleV2.java +++ b/src/main/java/one/talon/model/NewRoleV2.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.RoleV2Permissions; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewRuleset.java b/src/main/java/one/talon/model/NewRuleset.java index ae1c7d27..d6727ca2 100644 --- a/src/main/java/one/talon/model/NewRuleset.java +++ b/src/main/java/one/talon/model/NewRuleset.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.Binding; import one.talon.model.Rule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -288,10 +287,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewSamlConnection.java b/src/main/java/one/talon/model/NewSamlConnection.java index e37187b2..8a5f33cb 100644 --- a/src/main/java/one/talon/model/NewSamlConnection.java +++ b/src/main/java/one/talon/model/NewSamlConnection.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -364,10 +363,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewSecondaryDeployment.java b/src/main/java/one/talon/model/NewSecondaryDeployment.java index 8fdab7b1..738a880f 100644 --- a/src/main/java/one/talon/model/NewSecondaryDeployment.java +++ b/src/main/java/one/talon/model/NewSecondaryDeployment.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewStore.java b/src/main/java/one/talon/model/NewStore.java index 0311e956..f2e7e75e 100644 --- a/src/main/java/one/talon/model/NewStore.java +++ b/src/main/java/one/talon/model/NewStore.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewTemplateDef.java b/src/main/java/one/talon/model/NewTemplateDef.java index 1a516e85..777cc119 100644 --- a/src/main/java/one/talon/model/NewTemplateDef.java +++ b/src/main/java/one/talon/model/NewTemplateDef.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -331,10 +330,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewUser.java b/src/main/java/one/talon/model/NewUser.java index 57076c59..e46fcd64 100644 --- a/src/main/java/one/talon/model/NewUser.java +++ b/src/main/java/one/talon/model/NewUser.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NewWebhook.java b/src/main/java/one/talon/model/NewWebhook.java index 53248513..01758c06 100644 --- a/src/main/java/one/talon/model/NewWebhook.java +++ b/src/main/java/one/talon/model/NewWebhook.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -501,10 +500,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Notification.java b/src/main/java/one/talon/model/Notification.java index 81fb9c01..e86a8a0e 100644 --- a/src/main/java/one/talon/model/Notification.java +++ b/src/main/java/one/talon/model/Notification.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NotificationActivation.java b/src/main/java/one/talon/model/NotificationActivation.java index b4f6daf5..0a311d24 100644 --- a/src/main/java/one/talon/model/NotificationActivation.java +++ b/src/main/java/one/talon/model/NotificationActivation.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/NotificationListItem.java b/src/main/java/one/talon/model/NotificationListItem.java index 06c9ac05..fd8f790c 100644 --- a/src/main/java/one/talon/model/NotificationListItem.java +++ b/src/main/java/one/talon/model/NotificationListItem.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OktaEvent.java b/src/main/java/one/talon/model/OktaEvent.java index c958668a..ba4bc3f1 100644 --- a/src/main/java/one/talon/model/OktaEvent.java +++ b/src/main/java/one/talon/model/OktaEvent.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.OktaEventTarget; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OktaEventPayload.java b/src/main/java/one/talon/model/OktaEventPayload.java index 8488ded6..dee18d33 100644 --- a/src/main/java/one/talon/model/OktaEventPayload.java +++ b/src/main/java/one/talon/model/OktaEventPayload.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.OktaEventPayloadData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OktaEventPayloadData.java b/src/main/java/one/talon/model/OktaEventPayloadData.java index 516c5bd3..6ce6a507 100644 --- a/src/main/java/one/talon/model/OktaEventPayloadData.java +++ b/src/main/java/one/talon/model/OktaEventPayloadData.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.OktaEvent; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OktaEventTarget.java b/src/main/java/one/talon/model/OktaEventTarget.java index 1b38b624..aeff4e64 100644 --- a/src/main/java/one/talon/model/OktaEventTarget.java +++ b/src/main/java/one/talon/model/OktaEventTarget.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OneTimeCode.java b/src/main/java/one/talon/model/OneTimeCode.java index 95845833..c366954f 100644 --- a/src/main/java/one/talon/model/OneTimeCode.java +++ b/src/main/java/one/talon/model/OneTimeCode.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationBrazePolicy.java b/src/main/java/one/talon/model/OutgoingIntegrationBrazePolicy.java index a9090408..97fb2491 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationBrazePolicy.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationBrazePolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationCleverTapPolicy.java b/src/main/java/one/talon/model/OutgoingIntegrationCleverTapPolicy.java index 8d11cd32..f97f1ce1 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationCleverTapPolicy.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationCleverTapPolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationConfiguration.java b/src/main/java/one/talon/model/OutgoingIntegrationConfiguration.java index ae013cfc..43fc61d3 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationConfiguration.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationConfiguration.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationIterablePolicy.java b/src/main/java/one/talon/model/OutgoingIntegrationIterablePolicy.java index 7e35d2e0..10c956c2 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationIterablePolicy.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationIterablePolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationMoEngagePolicy.java b/src/main/java/one/talon/model/OutgoingIntegrationMoEngagePolicy.java index 3542177e..4cbc2254 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationMoEngagePolicy.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationMoEngagePolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationTemplate.java b/src/main/java/one/talon/model/OutgoingIntegrationTemplate.java index f01cd9ca..a8af1deb 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationTemplate.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationTemplate.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -406,10 +405,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationTemplateWithConfigurationDetails.java b/src/main/java/one/talon/model/OutgoingIntegrationTemplateWithConfigurationDetails.java index aee28271..651d6c88 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationTemplateWithConfigurationDetails.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationTemplateWithConfigurationDetails.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -432,10 +431,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationTemplates.java b/src/main/java/one/talon/model/OutgoingIntegrationTemplates.java index e3c50565..c947b04b 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationTemplates.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationTemplates.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.OutgoingIntegrationTemplate; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationType.java b/src/main/java/one/talon/model/OutgoingIntegrationType.java index 73617fbc..013b18f5 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationType.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationType.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -260,10 +259,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/OutgoingIntegrationTypes.java b/src/main/java/one/talon/model/OutgoingIntegrationTypes.java index e8faf4ee..31795f37 100644 --- a/src/main/java/one/talon/model/OutgoingIntegrationTypes.java +++ b/src/main/java/one/talon/model/OutgoingIntegrationTypes.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.OutgoingIntegrationType; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PatchItemCatalogAction.java b/src/main/java/one/talon/model/PatchItemCatalogAction.java index 085c64f7..84ad5926 100644 --- a/src/main/java/one/talon/model/PatchItemCatalogAction.java +++ b/src/main/java/one/talon/model/PatchItemCatalogAction.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.util.Arrays; import one.talon.model.Product; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PatchManyItemsCatalogAction.java b/src/main/java/one/talon/model/PatchManyItemsCatalogAction.java index 7f9108ea..74252d8c 100644 --- a/src/main/java/one/talon/model/PatchManyItemsCatalogAction.java +++ b/src/main/java/one/talon/model/PatchManyItemsCatalogAction.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CatalogActionFilter; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -220,10 +219,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PendingActivePointsData.java b/src/main/java/one/talon/model/PendingActivePointsData.java index a228afaa..a206b17f 100644 --- a/src/main/java/one/talon/model/PendingActivePointsData.java +++ b/src/main/java/one/talon/model/PendingActivePointsData.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -315,10 +314,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PendingActivePointsNotification.java b/src/main/java/one/talon/model/PendingActivePointsNotification.java index fab81510..c78701b3 100644 --- a/src/main/java/one/talon/model/PendingActivePointsNotification.java +++ b/src/main/java/one/talon/model/PendingActivePointsNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.PendingActivePointsData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PendingPointsNotificationPolicy.java b/src/main/java/one/talon/model/PendingPointsNotificationPolicy.java index c86a849a..81cdb147 100644 --- a/src/main/java/one/talon/model/PendingPointsNotificationPolicy.java +++ b/src/main/java/one/talon/model/PendingPointsNotificationPolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Picklist.java b/src/main/java/one/talon/model/Picklist.java index 8faf703d..f681573d 100644 --- a/src/main/java/one/talon/model/Picklist.java +++ b/src/main/java/one/talon/model/Picklist.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -405,10 +404,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PlaceholderDetails.java b/src/main/java/one/talon/model/PlaceholderDetails.java index 60c8e40b..86bc6b29 100644 --- a/src/main/java/one/talon/model/PlaceholderDetails.java +++ b/src/main/java/one/talon/model/PlaceholderDetails.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PriceDetail.java b/src/main/java/one/talon/model/PriceDetail.java index ccda27b7..09430ec6 100644 --- a/src/main/java/one/talon/model/PriceDetail.java +++ b/src/main/java/one/talon/model/PriceDetail.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PriceHistoryRequest.java b/src/main/java/one/talon/model/PriceHistoryRequest.java index 64284181..3b536f86 100644 --- a/src/main/java/one/talon/model/PriceHistoryRequest.java +++ b/src/main/java/one/talon/model/PriceHistoryRequest.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PriceHistoryResponse.java b/src/main/java/one/talon/model/PriceHistoryResponse.java index 7538153d..f7b620cc 100644 --- a/src/main/java/one/talon/model/PriceHistoryResponse.java +++ b/src/main/java/one/talon/model/PriceHistoryResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.History; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PriceType.java b/src/main/java/one/talon/model/PriceType.java index 075b679b..9703101d 100644 --- a/src/main/java/one/talon/model/PriceType.java +++ b/src/main/java/one/talon/model/PriceType.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -383,10 +382,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PriceTypeReferenceDetail.java b/src/main/java/one/talon/model/PriceTypeReferenceDetail.java index 9a94a7d3..7e233aaf 100644 --- a/src/main/java/one/talon/model/PriceTypeReferenceDetail.java +++ b/src/main/java/one/talon/model/PriceTypeReferenceDetail.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -288,10 +287,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PriceTypeReferences.java b/src/main/java/one/talon/model/PriceTypeReferences.java index 029ba5db..28b98983 100644 --- a/src/main/java/one/talon/model/PriceTypeReferences.java +++ b/src/main/java/one/talon/model/PriceTypeReferences.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.PriceTypeReferenceDetail; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Product.java b/src/main/java/one/talon/model/Product.java index 7e02fa1e..991023fd 100644 --- a/src/main/java/one/talon/model/Product.java +++ b/src/main/java/one/talon/model/Product.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ProductSearchMatch.java b/src/main/java/one/talon/model/ProductSearchMatch.java index f8e43db7..1e38e505 100644 --- a/src/main/java/one/talon/model/ProductSearchMatch.java +++ b/src/main/java/one/talon/model/ProductSearchMatch.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ProductUnitAnalytics.java b/src/main/java/one/talon/model/ProductUnitAnalytics.java index ddea182e..1d0f16ca 100644 --- a/src/main/java/one/talon/model/ProductUnitAnalytics.java +++ b/src/main/java/one/talon/model/ProductUnitAnalytics.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.ProductUnitAnalyticsDataPoint; import one.talon.model.ProductUnitAnalyticsTotals; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ProductUnitAnalyticsDataPoint.java b/src/main/java/one/talon/model/ProductUnitAnalyticsDataPoint.java index 8a906388..6fcb3295 100644 --- a/src/main/java/one/talon/model/ProductUnitAnalyticsDataPoint.java +++ b/src/main/java/one/talon/model/ProductUnitAnalyticsDataPoint.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.AnalyticsDataPointWithTrend; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ProductUnitAnalyticsTotals.java b/src/main/java/one/talon/model/ProductUnitAnalyticsTotals.java index 18c7e1cc..046846fe 100644 --- a/src/main/java/one/talon/model/ProductUnitAnalyticsTotals.java +++ b/src/main/java/one/talon/model/ProductUnitAnalyticsTotals.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.AnalyticsDataPointWithTrend; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ProfileAudiencesChanges.java b/src/main/java/one/talon/model/ProfileAudiencesChanges.java index 08e10d42..e6d43c0e 100644 --- a/src/main/java/one/talon/model/ProfileAudiencesChanges.java +++ b/src/main/java/one/talon/model/ProfileAudiencesChanges.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -200,10 +199,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ProjectedTier.java b/src/main/java/one/talon/model/ProjectedTier.java index f5e8022f..695f334d 100644 --- a/src/main/java/one/talon/model/ProjectedTier.java +++ b/src/main/java/one/talon/model/ProjectedTier.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/PromoteExperiment.java b/src/main/java/one/talon/model/PromoteExperiment.java index 568c2843..687cf7ac 100644 --- a/src/main/java/one/talon/model/PromoteExperiment.java +++ b/src/main/java/one/talon/model/PromoteExperiment.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ExperimentCampaignCopy; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RedeemReferralEffectProps.java b/src/main/java/one/talon/model/RedeemReferralEffectProps.java index cf8345f6..060eb387 100644 --- a/src/main/java/one/talon/model/RedeemReferralEffectProps.java +++ b/src/main/java/one/talon/model/RedeemReferralEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Referral.java b/src/main/java/one/talon/model/Referral.java index 3b901b10..05444e85 100644 --- a/src/main/java/one/talon/model/Referral.java +++ b/src/main/java/one/talon/model/Referral.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -471,10 +470,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReferralConstraints.java b/src/main/java/one/talon/model/ReferralConstraints.java index 86547983..41bba22d 100644 --- a/src/main/java/one/talon/model/ReferralConstraints.java +++ b/src/main/java/one/talon/model/ReferralConstraints.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -211,10 +210,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReferralCreatedEffectProps.java b/src/main/java/one/talon/model/ReferralCreatedEffectProps.java index 9fc0d1be..27786d80 100644 --- a/src/main/java/one/talon/model/ReferralCreatedEffectProps.java +++ b/src/main/java/one/talon/model/ReferralCreatedEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReferralRejectionReason.java b/src/main/java/one/talon/model/ReferralRejectionReason.java index 0439fb37..12979393 100644 --- a/src/main/java/one/talon/model/ReferralRejectionReason.java +++ b/src/main/java/one/talon/model/ReferralRejectionReason.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -280,10 +279,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RejectCouponEffectProps.java b/src/main/java/one/talon/model/RejectCouponEffectProps.java index 1c1528ba..dffee1ac 100644 --- a/src/main/java/one/talon/model/RejectCouponEffectProps.java +++ b/src/main/java/one/talon/model/RejectCouponEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -286,10 +285,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RejectReferralEffectProps.java b/src/main/java/one/talon/model/RejectReferralEffectProps.java index 1975ae61..5bdb1600 100644 --- a/src/main/java/one/talon/model/RejectReferralEffectProps.java +++ b/src/main/java/one/talon/model/RejectReferralEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -286,10 +285,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RemoveFromAudienceEffectProps.java b/src/main/java/one/talon/model/RemoveFromAudienceEffectProps.java index 83e1436a..6f19094d 100644 --- a/src/main/java/one/talon/model/RemoveFromAudienceEffectProps.java +++ b/src/main/java/one/talon/model/RemoveFromAudienceEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RemoveItemCatalogAction.java b/src/main/java/one/talon/model/RemoveItemCatalogAction.java index 697ea3a9..5600781f 100644 --- a/src/main/java/one/talon/model/RemoveItemCatalogAction.java +++ b/src/main/java/one/talon/model/RemoveItemCatalogAction.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RemoveManyItemsCatalogAction.java b/src/main/java/one/talon/model/RemoveManyItemsCatalogAction.java index 99e2a32b..03595c9e 100644 --- a/src/main/java/one/talon/model/RemoveManyItemsCatalogAction.java +++ b/src/main/java/one/talon/model/RemoveManyItemsCatalogAction.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CatalogActionFilter; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReopenSessionResponse.java b/src/main/java/one/talon/model/ReopenSessionResponse.java index e2d23408..5f45a3fa 100644 --- a/src/main/java/one/talon/model/ReopenSessionResponse.java +++ b/src/main/java/one/talon/model/ReopenSessionResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Effect; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReserveCouponEffectProps.java b/src/main/java/one/talon/model/ReserveCouponEffectProps.java index 03c0290b..75aea390 100644 --- a/src/main/java/one/talon/model/ReserveCouponEffectProps.java +++ b/src/main/java/one/talon/model/ReserveCouponEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ResponseContentObject.java b/src/main/java/one/talon/model/ResponseContentObject.java index 83c8a102..46497e93 100644 --- a/src/main/java/one/talon/model/ResponseContentObject.java +++ b/src/main/java/one/talon/model/ResponseContentObject.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -228,10 +227,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReturnIntegrationRequest.java b/src/main/java/one/talon/model/ReturnIntegrationRequest.java index 59037a80..7dda3514 100644 --- a/src/main/java/one/talon/model/ReturnIntegrationRequest.java +++ b/src/main/java/one/talon/model/ReturnIntegrationRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.NewReturn; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -257,10 +256,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ReturnedCartItem.java b/src/main/java/one/talon/model/ReturnedCartItem.java index a5082087..dbf046ca 100644 --- a/src/main/java/one/talon/model/ReturnedCartItem.java +++ b/src/main/java/one/talon/model/ReturnedCartItem.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Revision.java b/src/main/java/one/talon/model/Revision.java index 67b34a03..a4ba7d49 100644 --- a/src/main/java/one/talon/model/Revision.java +++ b/src/main/java/one/talon/model/Revision.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.RevisionVersion; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -392,10 +391,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RevisionActivation.java b/src/main/java/one/talon/model/RevisionActivation.java index 09166b01..0a9d9b49 100644 --- a/src/main/java/one/talon/model/RevisionActivation.java +++ b/src/main/java/one/talon/model/RevisionActivation.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -157,10 +156,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RevisionActivationRequest.java b/src/main/java/one/talon/model/RevisionActivationRequest.java index 86c3e82f..9a0efe09 100644 --- a/src/main/java/one/talon/model/RevisionActivationRequest.java +++ b/src/main/java/one/talon/model/RevisionActivationRequest.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RevisionVersion.java b/src/main/java/one/talon/model/RevisionVersion.java index 6606acf7..258594ef 100644 --- a/src/main/java/one/talon/model/RevisionVersion.java +++ b/src/main/java/one/talon/model/RevisionVersion.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -131,7 +130,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -765,10 +766,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Reward.java b/src/main/java/one/talon/model/Reward.java index 407470ec..c60adc45 100644 --- a/src/main/java/one/talon/model/Reward.java +++ b/src/main/java/one/talon/model/Reward.java @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Binding; +import one.talon.model.RewardPointsRequired; import one.talon.model.Rule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -96,16 +96,26 @@ public class Reward { @javax.annotation.Nonnull private Boolean sandbox; + public static final String SERIALIZED_NAME_VISIBILITY_CONDITIONS = "visibilityConditions"; + @SerializedName(SERIALIZED_NAME_VISIBILITY_CONDITIONS) + @javax.annotation.Nullable + private Rule visibilityConditions; + public static final String SERIALIZED_NAME_RULE = "rule"; @SerializedName(SERIALIZED_NAME_RULE) @javax.annotation.Nullable - private List rule; + private Rule rule; public static final String SERIALIZED_NAME_BINDINGS = "bindings"; @SerializedName(SERIALIZED_NAME_BINDINGS) @javax.annotation.Nullable private List bindings; + public static final String SERIALIZED_NAME_MODIFIED = "modified"; + @SerializedName(SERIALIZED_NAME_MODIFIED) + @javax.annotation.Nullable + private OffsetDateTime modified; + /** * The status of the reward. */ @@ -163,6 +173,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private StatusEnum status; + public static final String SERIALIZED_NAME_POINTS_REQUIRED = "pointsRequired"; + @SerializedName(SERIALIZED_NAME_POINTS_REQUIRED) + @javax.annotation.Nullable + private List pointsRequired; + public Reward() { } @@ -326,29 +341,40 @@ public void setSandbox(@javax.annotation.Nonnull Boolean sandbox) { } - public Reward rule(@javax.annotation.Nullable List rule) { - this.rule = rule; + public Reward visibilityConditions(@javax.annotation.Nullable Rule visibilityConditions) { + this.visibilityConditions = visibilityConditions; return this; } - public Reward addRuleItem(Rule ruleItem) { - if (this.rule == null) { - this.rule = new ArrayList<>(); - } - this.rule.add(ruleItem); + /** + * An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. + * @return visibilityConditions + */ + @javax.annotation.Nullable + public Rule getVisibilityConditions() { + return visibilityConditions; + } + + public void setVisibilityConditions(@javax.annotation.Nullable Rule visibilityConditions) { + this.visibilityConditions = visibilityConditions; + } + + + public Reward rule(@javax.annotation.Nullable Rule rule) { + this.rule = rule; return this; } /** - * Rule to apply. + * Rule to apply. **Note**: The `bindings` field inside the rule must not be used in this endpoint. All bindings should be defined at the reward level via the top-level `bindings` field. * @return rule */ @javax.annotation.Nullable - public List getRule() { + public Rule getRule() { return rule; } - public void setRule(@javax.annotation.Nullable List rule) { + public void setRule(@javax.annotation.Nullable Rule rule) { this.rule = rule; } @@ -380,6 +406,25 @@ public void setBindings(@javax.annotation.Nullable List bindings) { } + public Reward modified(@javax.annotation.Nullable OffsetDateTime modified) { + this.modified = modified; + return this; + } + + /** + * The timestamp when the reward was last updated in RFC3339 format. + * @return modified + */ + @javax.annotation.Nullable + public OffsetDateTime getModified() { + return modified; + } + + public void setModified(@javax.annotation.Nullable OffsetDateTime modified) { + this.modified = modified; + } + + public Reward status(@javax.annotation.Nonnull StatusEnum status) { this.status = status; return this; @@ -398,6 +443,33 @@ public void setStatus(@javax.annotation.Nonnull StatusEnum status) { this.status = status; } + + public Reward pointsRequired(@javax.annotation.Nullable List pointsRequired) { + this.pointsRequired = pointsRequired; + return this; + } + + public Reward addPointsRequiredItem(RewardPointsRequired pointsRequiredItem) { + if (this.pointsRequired == null) { + this.pointsRequired = new ArrayList<>(); + } + this.pointsRequired.add(pointsRequiredItem); + return this; + } + + /** + * The loyalty points required to activate a reward. + * @return pointsRequired + */ + @javax.annotation.Nullable + public List getPointsRequired() { + return pointsRequired; + } + + public void setPointsRequired(@javax.annotation.Nullable List pointsRequired) { + this.pointsRequired = pointsRequired; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -461,15 +533,18 @@ public boolean equals(Object o) { Objects.equals(this.description, reward.description) && Objects.equals(this.applicationIds, reward.applicationIds) && Objects.equals(this.sandbox, reward.sandbox) && + Objects.equals(this.visibilityConditions, reward.visibilityConditions) && Objects.equals(this.rule, reward.rule) && Objects.equals(this.bindings, reward.bindings) && - Objects.equals(this.status, reward.status)&& + Objects.equals(this.modified, reward.modified) && + Objects.equals(this.status, reward.status) && + Objects.equals(this.pointsRequired, reward.pointsRequired)&& Objects.equals(this.additionalProperties, reward.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, created, accountId, name, apiName, description, applicationIds, sandbox, rule, bindings, status, additionalProperties); + return Objects.hash(id, created, accountId, name, apiName, description, applicationIds, sandbox, visibilityConditions, rule, bindings, modified, status, pointsRequired, additionalProperties); } @Override @@ -484,9 +559,12 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" applicationIds: ").append(toIndentedString(applicationIds)).append("\n"); sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); + sb.append(" visibilityConditions: ").append(toIndentedString(visibilityConditions)).append("\n"); sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); sb.append(" bindings: ").append(toIndentedString(bindings)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" pointsRequired: ").append(toIndentedString(pointsRequired)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -497,10 +575,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -509,7 +584,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "rule", "bindings", "status")); + openapiFields = new HashSet(Arrays.asList("id", "created", "accountId", "name", "apiName", "description", "applicationIds", "sandbox", "visibilityConditions", "rule", "bindings", "modified", "status", "pointsRequired")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "accountId", "name", "apiName", "applicationIds", "sandbox", "status")); @@ -550,19 +625,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else if (!jsonObj.get("applicationIds").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `applicationIds` to be an array in the JSON string but got `%s`", jsonObj.get("applicationIds").toString())); } + // validate the optional field `visibilityConditions` + if (jsonObj.get("visibilityConditions") != null && !jsonObj.get("visibilityConditions").isJsonNull()) { + Rule.validateJsonElement(jsonObj.get("visibilityConditions")); + } + // validate the optional field `rule` if (jsonObj.get("rule") != null && !jsonObj.get("rule").isJsonNull()) { - JsonArray jsonArrayrule = jsonObj.getAsJsonArray("rule"); - if (jsonArrayrule != null) { - // ensure the json data is an array - if (!jsonObj.get("rule").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rule` to be an array in the JSON string but got `%s`", jsonObj.get("rule").toString())); - } - - // validate the optional field `rule` (array) - for (int i = 0; i < jsonArrayrule.size(); i++) { - Rule.validateJsonElement(jsonArrayrule.get(i)); - }; - } + Rule.validateJsonElement(jsonObj.get("rule")); } if (jsonObj.get("bindings") != null && !jsonObj.get("bindings").isJsonNull()) { JsonArray jsonArraybindings = jsonObj.getAsJsonArray("bindings"); @@ -583,6 +652,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `status` StatusEnum.validateJsonElement(jsonObj.get("status")); + if (jsonObj.get("pointsRequired") != null && !jsonObj.get("pointsRequired").isJsonNull()) { + JsonArray jsonArraypointsRequired = jsonObj.getAsJsonArray("pointsRequired"); + if (jsonArraypointsRequired != null) { + // ensure the json data is an array + if (!jsonObj.get("pointsRequired").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `pointsRequired` to be an array in the JSON string but got `%s`", jsonObj.get("pointsRequired").toString())); + } + + // validate the optional field `pointsRequired` (array) + for (int i = 0; i < jsonArraypointsRequired.size(); i++) { + RewardPointsRequired.validateJsonElement(jsonArraypointsRequired.get(i)); + }; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/RewardPointsRequired.java b/src/main/java/one/talon/model/RewardPointsRequired.java new file mode 100644 index 00000000..e18feecb --- /dev/null +++ b/src/main/java/one/talon/model/RewardPointsRequired.java @@ -0,0 +1,370 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * The loyalty points required to activate a reward. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class RewardPointsRequired { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private Long id; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + @javax.annotation.Nonnull + private BigDecimal amount; + + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_ID = "loyaltyProgramId"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_ID) + @javax.annotation.Nonnull + private Long loyaltyProgramId; + + public static final String SERIALIZED_NAME_SUBLEDGER_ID = "subledgerId"; + @SerializedName(SERIALIZED_NAME_SUBLEDGER_ID) + @javax.annotation.Nonnull + private String subledgerId; + + public RewardPointsRequired() { + } + + public RewardPointsRequired id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * The ID of the `pointsRequired` entry. When updating a reward, include this property to update an existing entry. Omit it to create a new one. + * @return id + */ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + public RewardPointsRequired amount(@javax.annotation.Nonnull BigDecimal amount) { + this.amount = amount; + return this; + } + + /** + * The number of loyalty points required to activate the reward. + * minimum: 0 + * @return amount + */ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(@javax.annotation.Nonnull BigDecimal amount) { + this.amount = amount; + } + + + public RewardPointsRequired loyaltyProgramId(@javax.annotation.Nonnull Long loyaltyProgramId) { + this.loyaltyProgramId = loyaltyProgramId; + return this; + } + + /** + * The ID of the associated loyalty program. + * @return loyaltyProgramId + */ + @javax.annotation.Nonnull + public Long getLoyaltyProgramId() { + return loyaltyProgramId; + } + + public void setLoyaltyProgramId(@javax.annotation.Nonnull Long loyaltyProgramId) { + this.loyaltyProgramId = loyaltyProgramId; + } + + + public RewardPointsRequired subledgerId(@javax.annotation.Nonnull String subledgerId) { + this.subledgerId = subledgerId; + return this; + } + + /** + * The ID of the subledger within the loyalty program from which points are deducted when activating the reward. To specify the main ledger, provide an empty string (\"\"). + * @return subledgerId + */ + @javax.annotation.Nonnull + public String getSubledgerId() { + return subledgerId; + } + + public void setSubledgerId(@javax.annotation.Nonnull String subledgerId) { + this.subledgerId = subledgerId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RewardPointsRequired instance itself + */ + public RewardPointsRequired putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RewardPointsRequired rewardPointsRequired = (RewardPointsRequired) o; + return Objects.equals(this.id, rewardPointsRequired.id) && + Objects.equals(this.amount, rewardPointsRequired.amount) && + Objects.equals(this.loyaltyProgramId, rewardPointsRequired.loyaltyProgramId) && + Objects.equals(this.subledgerId, rewardPointsRequired.subledgerId)&& + Objects.equals(this.additionalProperties, rewardPointsRequired.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, amount, loyaltyProgramId, subledgerId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RewardPointsRequired {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" loyaltyProgramId: ").append(toIndentedString(loyaltyProgramId)).append("\n"); + sb.append(" subledgerId: ").append(toIndentedString(subledgerId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "amount", "loyaltyProgramId", "subledgerId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("amount", "loyaltyProgramId", "subledgerId")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RewardPointsRequired + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RewardPointsRequired.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RewardPointsRequired is not found in the empty JSON string", RewardPointsRequired.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RewardPointsRequired.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subledgerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subledgerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subledgerId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RewardPointsRequired.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RewardPointsRequired' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RewardPointsRequired.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RewardPointsRequired value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RewardPointsRequired read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RewardPointsRequired instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RewardPointsRequired given an JSON string + * + * @param jsonString JSON string + * @return An instance of RewardPointsRequired + * @throws IOException if the JSON string is invalid with respect to RewardPointsRequired + */ + public static RewardPointsRequired fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RewardPointsRequired.class); + } + + /** + * Convert an instance of RewardPointsRequired to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/RiskNotification.java b/src/main/java/one/talon/model/RiskNotification.java new file mode 100644 index 00000000..1c2cc9e0 --- /dev/null +++ b/src/main/java/one/talon/model/RiskNotification.java @@ -0,0 +1,621 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * A risk notification configuration rule. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class RiskNotification { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nonnull + private OffsetDateTime created; + + /** + * The entity type to analyze within the given time frame. + */ + @JsonAdapter(EntityEnum.Adapter.class) + public enum EntityEnum { + CUSTOMER_PROFILE("customer_profile"), + + CUSTOMER_SESSION("customer_session"); + + private String value; + + EntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EntityEnum fromValue(String value) { + for (EntityEnum b : EntityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EntityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EntityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EntityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EntityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENTITY = "entity"; + @SerializedName(SERIALIZED_NAME_ENTITY) + @javax.annotation.Nonnull + private EntityEnum entity; + + /** + * The activity metric to analyze within the given entity. + */ + @JsonAdapter(ActivityEnum.Adapter.class) + public enum ActivityEnum { + LOYALTY_POINTS_EARNED("loyalty_points_earned"), + + DISCOUNTED_AMOUNT("discounted_amount"), + + COMPLETED_ORDERS("completed_orders"), + + COUPON_ATTEMPTS("coupon_attempts"); + + private String value; + + ActivityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActivityEnum fromValue(String value) { + for (ActivityEnum b : ActivityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActivityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActivityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActivityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ActivityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ACTIVITY = "activity"; + @SerializedName(SERIALIZED_NAME_ACTIVITY) + @javax.annotation.Nonnull + private ActivityEnum activity; + + /** + * The rolling time window for risk evaluation. + */ + @JsonAdapter(TimeFrameEnum.Adapter.class) + public enum TimeFrameEnum { + _1_DAY("1_day"), + + _1_WEEK("1_week"), + + _1_MONTH("1_month"); + + private String value; + + TimeFrameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeFrameEnum fromValue(String value) { + for (TimeFrameEnum b : TimeFrameEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TimeFrameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeFrameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeFrameEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TimeFrameEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIME_FRAME = "timeFrame"; + @SerializedName(SERIALIZED_NAME_TIME_FRAME) + @javax.annotation.Nonnull + private TimeFrameEnum timeFrame; + + public static final String SERIALIZED_NAME_ACTIVE = "active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nonnull + private Boolean active; + + public static final String SERIALIZED_NAME_MODIFIED = "modified"; + @SerializedName(SERIALIZED_NAME_MODIFIED) + @javax.annotation.Nonnull + private OffsetDateTime modified; + + public RiskNotification() { + } + + public RiskNotification id(@javax.annotation.Nonnull Long id) { + this.id = id; + return this; + } + + /** + * The internal ID of this entity. + * @return id + */ + @javax.annotation.Nonnull + public Long getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; + } + + + public RiskNotification created(@javax.annotation.Nonnull OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * The time this entity was created. + * @return created + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nonnull OffsetDateTime created) { + this.created = created; + } + + + public RiskNotification entity(@javax.annotation.Nonnull EntityEnum entity) { + this.entity = entity; + return this; + } + + /** + * The entity type to analyze within the given time frame. + * @return entity + */ + @javax.annotation.Nonnull + public EntityEnum getEntity() { + return entity; + } + + public void setEntity(@javax.annotation.Nonnull EntityEnum entity) { + this.entity = entity; + } + + + public RiskNotification activity(@javax.annotation.Nonnull ActivityEnum activity) { + this.activity = activity; + return this; + } + + /** + * The activity metric to analyze within the given entity. + * @return activity + */ + @javax.annotation.Nonnull + public ActivityEnum getActivity() { + return activity; + } + + public void setActivity(@javax.annotation.Nonnull ActivityEnum activity) { + this.activity = activity; + } + + + public RiskNotification timeFrame(@javax.annotation.Nonnull TimeFrameEnum timeFrame) { + this.timeFrame = timeFrame; + return this; + } + + /** + * The rolling time window for risk evaluation. + * @return timeFrame + */ + @javax.annotation.Nonnull + public TimeFrameEnum getTimeFrame() { + return timeFrame; + } + + public void setTimeFrame(@javax.annotation.Nonnull TimeFrameEnum timeFrame) { + this.timeFrame = timeFrame; + } + + + public RiskNotification active(@javax.annotation.Nonnull Boolean active) { + this.active = active; + return this; + } + + /** + * Indicates whether this risk notification is active. + * @return active + */ + @javax.annotation.Nonnull + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nonnull Boolean active) { + this.active = active; + } + + + public RiskNotification modified(@javax.annotation.Nonnull OffsetDateTime modified) { + this.modified = modified; + return this; + } + + /** + * Timestamp of the most recent update. + * @return modified + */ + @javax.annotation.Nonnull + public OffsetDateTime getModified() { + return modified; + } + + public void setModified(@javax.annotation.Nonnull OffsetDateTime modified) { + this.modified = modified; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RiskNotification instance itself + */ + public RiskNotification putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RiskNotification riskNotification = (RiskNotification) o; + return Objects.equals(this.id, riskNotification.id) && + Objects.equals(this.created, riskNotification.created) && + Objects.equals(this.entity, riskNotification.entity) && + Objects.equals(this.activity, riskNotification.activity) && + Objects.equals(this.timeFrame, riskNotification.timeFrame) && + Objects.equals(this.active, riskNotification.active) && + Objects.equals(this.modified, riskNotification.modified)&& + Objects.equals(this.additionalProperties, riskNotification.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, created, entity, activity, timeFrame, active, modified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RiskNotification {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" activity: ").append(toIndentedString(activity)).append("\n"); + sb.append(" timeFrame: ").append(toIndentedString(timeFrame)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "created", "entity", "activity", "timeFrame", "active", "modified")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "entity", "activity", "timeFrame", "active", "modified")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RiskNotification + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RiskNotification.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RiskNotification is not found in the empty JSON string", RiskNotification.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RiskNotification.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("entity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + } + // validate the required field `entity` + EntityEnum.validateJsonElement(jsonObj.get("entity")); + if (!jsonObj.get("activity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `activity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + // validate the required field `activity` + ActivityEnum.validateJsonElement(jsonObj.get("activity")); + if (!jsonObj.get("timeFrame").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `timeFrame` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeFrame").toString())); + } + // validate the required field `timeFrame` + TimeFrameEnum.validateJsonElement(jsonObj.get("timeFrame")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RiskNotification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RiskNotification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RiskNotification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RiskNotification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RiskNotification read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RiskNotification instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RiskNotification given an JSON string + * + * @param jsonString JSON string + * @return An instance of RiskNotification + * @throws IOException if the JSON string is invalid with respect to RiskNotification + */ + public static RiskNotification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RiskNotification.class); + } + + /** + * Convert an instance of RiskNotification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/Role.java b/src/main/java/one/talon/model/Role.java index 683181e8..3201036c 100644 --- a/src/main/java/one/talon/model/Role.java +++ b/src/main/java/one/talon/model/Role.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -375,10 +374,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleAssign.java b/src/main/java/one/talon/model/RoleAssign.java index 7418bc4e..2f477caa 100644 --- a/src/main/java/one/talon/model/RoleAssign.java +++ b/src/main/java/one/talon/model/RoleAssign.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -200,10 +199,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleMembership.java b/src/main/java/one/talon/model/RoleMembership.java index ceb3b524..bfa7f86c 100644 --- a/src/main/java/one/talon/model/RoleMembership.java +++ b/src/main/java/one/talon/model/RoleMembership.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2.java b/src/main/java/one/talon/model/RoleV2.java index 203fd99b..3707a199 100644 --- a/src/main/java/one/talon/model/RoleV2.java +++ b/src/main/java/one/talon/model/RoleV2.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.RoleV2Permissions; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -376,10 +375,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2ApplicationDetails.java b/src/main/java/one/talon/model/RoleV2ApplicationDetails.java index dfed7168..f2dce4d1 100644 --- a/src/main/java/one/talon/model/RoleV2ApplicationDetails.java +++ b/src/main/java/one/talon/model/RoleV2ApplicationDetails.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.RolesV2Thresholds; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2Base.java b/src/main/java/one/talon/model/RoleV2Base.java index a61295c7..d9192196 100644 --- a/src/main/java/one/talon/model/RoleV2Base.java +++ b/src/main/java/one/talon/model/RoleV2Base.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.RoleV2Permissions; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2PermissionSet.java b/src/main/java/one/talon/model/RoleV2PermissionSet.java index 9e73832e..5bb1383f 100644 --- a/src/main/java/one/talon/model/RoleV2PermissionSet.java +++ b/src/main/java/one/talon/model/RoleV2PermissionSet.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2Permissions.java b/src/main/java/one/talon/model/RoleV2Permissions.java index 4e62d652..4f722580 100644 --- a/src/main/java/one/talon/model/RoleV2Permissions.java +++ b/src/main/java/one/talon/model/RoleV2Permissions.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.RoleV2PermissionSet; import one.talon.model.RoleV2RolesGroup; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2Readonly.java b/src/main/java/one/talon/model/RoleV2Readonly.java index 9da337bd..e9580300 100644 --- a/src/main/java/one/talon/model/RoleV2Readonly.java +++ b/src/main/java/one/talon/model/RoleV2Readonly.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RoleV2RolesGroup.java b/src/main/java/one/talon/model/RoleV2RolesGroup.java index 0c26bc27..09fdb554 100644 --- a/src/main/java/one/talon/model/RoleV2RolesGroup.java +++ b/src/main/java/one/talon/model/RoleV2RolesGroup.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.Map; import one.talon.model.RoleV2ApplicationDetails; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RolesV2Thresholds.java b/src/main/java/one/talon/model/RolesV2Thresholds.java index 40e10475..c4921dd0 100644 --- a/src/main/java/one/talon/model/RolesV2Thresholds.java +++ b/src/main/java/one/talon/model/RolesV2Thresholds.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RollbackAddedLoyaltyPointsEffectProps.java b/src/main/java/one/talon/model/RollbackAddedLoyaltyPointsEffectProps.java index d68a1ab2..86940768 100644 --- a/src/main/java/one/talon/model/RollbackAddedLoyaltyPointsEffectProps.java +++ b/src/main/java/one/talon/model/RollbackAddedLoyaltyPointsEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -339,10 +338,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RollbackCouponEffectProps.java b/src/main/java/one/talon/model/RollbackCouponEffectProps.java index c0c6bd82..5235e7dc 100644 --- a/src/main/java/one/talon/model/RollbackCouponEffectProps.java +++ b/src/main/java/one/talon/model/RollbackCouponEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RollbackDeductedLoyaltyPointsEffectProps.java b/src/main/java/one/talon/model/RollbackDeductedLoyaltyPointsEffectProps.java index c5fcd45a..3b2b315d 100644 --- a/src/main/java/one/talon/model/RollbackDeductedLoyaltyPointsEffectProps.java +++ b/src/main/java/one/talon/model/RollbackDeductedLoyaltyPointsEffectProps.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -340,10 +339,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RollbackDiscountEffectProps.java b/src/main/java/one/talon/model/RollbackDiscountEffectProps.java index 6a7d4d18..f24b8b05 100644 --- a/src/main/java/one/talon/model/RollbackDiscountEffectProps.java +++ b/src/main/java/one/talon/model/RollbackDiscountEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RollbackIncreasedAchievementProgressEffectProps.java b/src/main/java/one/talon/model/RollbackIncreasedAchievementProgressEffectProps.java index 65d6b827..61c3ce3f 100644 --- a/src/main/java/one/talon/model/RollbackIncreasedAchievementProgressEffectProps.java +++ b/src/main/java/one/talon/model/RollbackIncreasedAchievementProgressEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -287,10 +286,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RollbackReferralEffectProps.java b/src/main/java/one/talon/model/RollbackReferralEffectProps.java index c65f3838..e289a763 100644 --- a/src/main/java/one/talon/model/RollbackReferralEffectProps.java +++ b/src/main/java/one/talon/model/RollbackReferralEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Rule.java b/src/main/java/one/talon/model/Rule.java index 005e6a7e..2cd94efc 100644 --- a/src/main/java/one/talon/model/Rule.java +++ b/src/main/java/one/talon/model/Rule.java @@ -25,7 +25,6 @@ import java.util.List; import java.util.UUID; import one.talon.model.Binding; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -340,10 +339,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RuleEligibility.java b/src/main/java/one/talon/model/RuleEligibility.java index 120bb0a7..f954d866 100644 --- a/src/main/java/one/talon/model/RuleEligibility.java +++ b/src/main/java/one/talon/model/RuleEligibility.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.RuleEligibilityFailureDetails; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RuleEligibilityFailureDetails.java b/src/main/java/one/talon/model/RuleEligibilityFailureDetails.java index bb1cad2e..57a4205f 100644 --- a/src/main/java/one/talon/model/RuleEligibilityFailureDetails.java +++ b/src/main/java/one/talon/model/RuleEligibilityFailureDetails.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -390,10 +389,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RuleFailureReason.java b/src/main/java/one/talon/model/RuleFailureReason.java index cb375bb4..406c7915 100644 --- a/src/main/java/one/talon/model/RuleFailureReason.java +++ b/src/main/java/one/talon/model/RuleFailureReason.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -494,10 +493,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/RuleMetadata.java b/src/main/java/one/talon/model/RuleMetadata.java index b8bb2559..a9ab3be7 100644 --- a/src/main/java/one/talon/model/RuleMetadata.java +++ b/src/main/java/one/talon/model/RuleMetadata.java @@ -20,11 +20,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; -import one.talon.model.RuleEligibility; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -74,11 +70,6 @@ public class RuleMetadata { @javax.annotation.Nullable private String relatedData; - public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; - @SerializedName(SERIALIZED_NAME_ELIGIBILITY) - @javax.annotation.Nullable - private List eligibility; - public RuleMetadata() { } @@ -157,33 +148,6 @@ public void setRelatedData(@javax.annotation.Nullable String relatedData) { this.relatedData = relatedData; } - - public RuleMetadata eligibility(@javax.annotation.Nullable List eligibility) { - this.eligibility = eligibility; - return this; - } - - public RuleMetadata addEligibilityItem(RuleEligibility eligibilityItem) { - if (this.eligibility == null) { - this.eligibility = new ArrayList<>(); - } - this.eligibility.add(eligibilityItem); - return this; - } - - /** - * Get eligibility - * @return eligibility - */ - @javax.annotation.Nullable - public List getEligibility() { - return eligibility; - } - - public void setEligibility(@javax.annotation.Nullable List eligibility) { - this.eligibility = eligibility; - } - /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -242,14 +206,13 @@ public boolean equals(Object o) { return Objects.equals(this.title, ruleMetadata.title) && Objects.equals(this.displayName, ruleMetadata.displayName) && Objects.equals(this.displayDescription, ruleMetadata.displayDescription) && - Objects.equals(this.relatedData, ruleMetadata.relatedData) && - Objects.equals(this.eligibility, ruleMetadata.eligibility)&& + Objects.equals(this.relatedData, ruleMetadata.relatedData)&& Objects.equals(this.additionalProperties, ruleMetadata.additionalProperties); } @Override public int hashCode() { - return Objects.hash(title, displayName, displayDescription, relatedData, eligibility, additionalProperties); + return Objects.hash(title, displayName, displayDescription, relatedData, additionalProperties); } @Override @@ -260,7 +223,6 @@ public String toString() { sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" displayDescription: ").append(toIndentedString(displayDescription)).append("\n"); sb.append(" relatedData: ").append(toIndentedString(relatedData)).append("\n"); - sb.append(" eligibility: ").append(toIndentedString(eligibility)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -271,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -283,7 +242,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("title", "displayName", "displayDescription", "relatedData", "eligibility")); + openapiFields = new HashSet(Arrays.asList("title", "displayName", "displayDescription", "relatedData")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("title")); @@ -321,20 +280,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("relatedData") != null && !jsonObj.get("relatedData").isJsonNull()) && !jsonObj.get("relatedData").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `relatedData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relatedData").toString())); } - if (jsonObj.get("eligibility") != null && !jsonObj.get("eligibility").isJsonNull()) { - JsonArray jsonArrayeligibility = jsonObj.getAsJsonArray("eligibility"); - if (jsonArrayeligibility != null) { - // ensure the json data is an array - if (!jsonObj.get("eligibility").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `eligibility` to be an array in the JSON string but got `%s`", jsonObj.get("eligibility").toString())); - } - - // validate the optional field `eligibility` (array) - for (int i = 0; i < jsonArrayeligibility.size(); i++) { - RuleEligibility.validateJsonElement(jsonArrayeligibility.get(i)); - }; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/RuleMetadataEligibility.java b/src/main/java/one/talon/model/RuleMetadataEligibility.java new file mode 100644 index 00000000..e3538392 --- /dev/null +++ b/src/main/java/one/talon/model/RuleMetadataEligibility.java @@ -0,0 +1,424 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import one.talon.model.RuleEligibility; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * RuleMetadataEligibility + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class RuleMetadataEligibility { + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nonnull + private String title; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nullable + private String displayName; + + public static final String SERIALIZED_NAME_DISPLAY_DESCRIPTION = "displayDescription"; + @SerializedName(SERIALIZED_NAME_DISPLAY_DESCRIPTION) + @javax.annotation.Nullable + private String displayDescription; + + public static final String SERIALIZED_NAME_RELATED_DATA = "relatedData"; + @SerializedName(SERIALIZED_NAME_RELATED_DATA) + @javax.annotation.Nullable + private String relatedData; + + public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; + @SerializedName(SERIALIZED_NAME_ELIGIBILITY) + @javax.annotation.Nonnull + private List eligibility = new ArrayList<>(); + + public RuleMetadataEligibility() { + } + + public RuleMetadataEligibility title(@javax.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * A short description of the rule. + * @return title + */ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + + public RuleMetadataEligibility displayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + return this; + } + + /** + * A customer-facing name for the rule. + * @return displayName + */ + @javax.annotation.Nullable + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + } + + + public RuleMetadataEligibility displayDescription(@javax.annotation.Nullable String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. + * @return displayDescription + */ + @javax.annotation.Nullable + public String getDisplayDescription() { + return displayDescription; + } + + public void setDisplayDescription(@javax.annotation.Nullable String displayDescription) { + this.displayDescription = displayDescription; + } + + + public RuleMetadataEligibility relatedData(@javax.annotation.Nullable String relatedData) { + this.relatedData = relatedData; + return this; + } + + /** + * Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. + * @return relatedData + */ + @javax.annotation.Nullable + public String getRelatedData() { + return relatedData; + } + + public void setRelatedData(@javax.annotation.Nullable String relatedData) { + this.relatedData = relatedData; + } + + + public RuleMetadataEligibility eligibility(@javax.annotation.Nonnull List eligibility) { + this.eligibility = eligibility; + return this; + } + + public RuleMetadataEligibility addEligibilityItem(RuleEligibility eligibilityItem) { + if (this.eligibility == null) { + this.eligibility = new ArrayList<>(); + } + this.eligibility.add(eligibilityItem); + return this; + } + + /** + * Get eligibility + * @return eligibility + */ + @javax.annotation.Nonnull + public List getEligibility() { + return eligibility; + } + + public void setEligibility(@javax.annotation.Nonnull List eligibility) { + this.eligibility = eligibility; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RuleMetadataEligibility instance itself + */ + public RuleMetadataEligibility putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RuleMetadataEligibility ruleMetadataEligibility = (RuleMetadataEligibility) o; + return Objects.equals(this.title, ruleMetadataEligibility.title) && + Objects.equals(this.displayName, ruleMetadataEligibility.displayName) && + Objects.equals(this.displayDescription, ruleMetadataEligibility.displayDescription) && + Objects.equals(this.relatedData, ruleMetadataEligibility.relatedData) && + Objects.equals(this.eligibility, ruleMetadataEligibility.eligibility)&& + Objects.equals(this.additionalProperties, ruleMetadataEligibility.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, displayName, displayDescription, relatedData, eligibility, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RuleMetadataEligibility {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" displayDescription: ").append(toIndentedString(displayDescription)).append("\n"); + sb.append(" relatedData: ").append(toIndentedString(relatedData)).append("\n"); + sb.append(" eligibility: ").append(toIndentedString(eligibility)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("title", "displayName", "displayDescription", "relatedData", "eligibility")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("title", "eligibility")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RuleMetadataEligibility + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RuleMetadataEligibility.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RuleMetadataEligibility is not found in the empty JSON string", RuleMetadataEligibility.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RuleMetadataEligibility.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) && !jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("displayDescription") != null && !jsonObj.get("displayDescription").isJsonNull()) && !jsonObj.get("displayDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `displayDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayDescription").toString())); + } + if ((jsonObj.get("relatedData") != null && !jsonObj.get("relatedData").isJsonNull()) && !jsonObj.get("relatedData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `relatedData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("relatedData").toString())); + } + if (jsonObj.get("eligibility") != null) { + if (!jsonObj.get("eligibility").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `eligibility` to be an array in the JSON string but got `%s`", jsonObj.get("eligibility").toString())); + } + JsonArray jsonArrayeligibility = jsonObj.getAsJsonArray("eligibility"); + // validate the required field `eligibility` (array) + for (int i = 0; i < jsonArrayeligibility.size(); i++) { + RuleEligibility.validateJsonElement(jsonArrayeligibility.get(i)); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RuleMetadataEligibility.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RuleMetadataEligibility' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RuleMetadataEligibility.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RuleMetadataEligibility value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RuleMetadataEligibility read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RuleMetadataEligibility instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RuleMetadataEligibility given an JSON string + * + * @param jsonString JSON string + * @return An instance of RuleMetadataEligibility + * @throws IOException if the JSON string is invalid with respect to RuleMetadataEligibility + */ + public static RuleMetadataEligibility fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RuleMetadataEligibility.class); + } + + /** + * Convert an instance of RuleMetadataEligibility to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/Ruleset.java b/src/main/java/one/talon/model/Ruleset.java index 2cf53284..1c4af503 100644 --- a/src/main/java/one/talon/model/Ruleset.java +++ b/src/main/java/one/talon/model/Ruleset.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.Binding; import one.talon.model.Rule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -445,10 +444,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SSOConfig.java b/src/main/java/one/talon/model/SSOConfig.java index 09b40c83..a489f92e 100644 --- a/src/main/java/one/talon/model/SSOConfig.java +++ b/src/main/java/one/talon/model/SSOConfig.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SamlConnection.java b/src/main/java/one/talon/model/SamlConnection.java index fe6d7ec4..19dd676b 100644 --- a/src/main/java/one/talon/model/SamlConnection.java +++ b/src/main/java/one/talon/model/SamlConnection.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -417,10 +416,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SamlConnectionInternal.java b/src/main/java/one/talon/model/SamlConnectionInternal.java index c53d06fd..01d5fe43 100644 --- a/src/main/java/one/talon/model/SamlConnectionInternal.java +++ b/src/main/java/one/talon/model/SamlConnectionInternal.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SamlConnectionMetadata.java b/src/main/java/one/talon/model/SamlConnectionMetadata.java index e2fdb8d7..4d51ad65 100644 --- a/src/main/java/one/talon/model/SamlConnectionMetadata.java +++ b/src/main/java/one/talon/model/SamlConnectionMetadata.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SamlLoginEndpoint.java b/src/main/java/one/talon/model/SamlLoginEndpoint.java index b1ba583f..37477445 100644 --- a/src/main/java/one/talon/model/SamlLoginEndpoint.java +++ b/src/main/java/one/talon/model/SamlLoginEndpoint.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimBaseGroup.java b/src/main/java/one/talon/model/ScimBaseGroup.java index bf503421..2e0badb1 100644 --- a/src/main/java/one/talon/model/ScimBaseGroup.java +++ b/src/main/java/one/talon/model/ScimBaseGroup.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimGroupMember; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -193,10 +192,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimBaseUser.java b/src/main/java/one/talon/model/ScimBaseUser.java index c3bccb0a..449b5df9 100644 --- a/src/main/java/one/talon/model/ScimBaseUser.java +++ b/src/main/java/one/talon/model/ScimBaseUser.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ScimBaseUserName; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimBaseUserName.java b/src/main/java/one/talon/model/ScimBaseUserName.java index 6e229a2a..799eb568 100644 --- a/src/main/java/one/talon/model/ScimBaseUserName.java +++ b/src/main/java/one/talon/model/ScimBaseUserName.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimGroup.java b/src/main/java/one/talon/model/ScimGroup.java index 65974fdf..eb442a83 100644 --- a/src/main/java/one/talon/model/ScimGroup.java +++ b/src/main/java/one/talon/model/ScimGroup.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimGroupMember; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -219,10 +218,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimGroupMember.java b/src/main/java/one/talon/model/ScimGroupMember.java index a8ddefc4..26d994af 100644 --- a/src/main/java/one/talon/model/ScimGroupMember.java +++ b/src/main/java/one/talon/model/ScimGroupMember.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimGroupsListResponse.java b/src/main/java/one/talon/model/ScimGroupsListResponse.java index 376f9a28..0fe1ee2d 100644 --- a/src/main/java/one/talon/model/ScimGroupsListResponse.java +++ b/src/main/java/one/talon/model/ScimGroupsListResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimGroup; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -227,10 +226,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimNewUser.java b/src/main/java/one/talon/model/ScimNewUser.java index 073e727d..ad007773 100644 --- a/src/main/java/one/talon/model/ScimNewUser.java +++ b/src/main/java/one/talon/model/ScimNewUser.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ScimBaseUserName; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimPatchOperation.java b/src/main/java/one/talon/model/ScimPatchOperation.java index cb4c5e41..da0b1c78 100644 --- a/src/main/java/one/talon/model/ScimPatchOperation.java +++ b/src/main/java/one/talon/model/ScimPatchOperation.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -262,10 +261,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimPatchRequest.java b/src/main/java/one/talon/model/ScimPatchRequest.java index d6fb3c48..60131cc1 100644 --- a/src/main/java/one/talon/model/ScimPatchRequest.java +++ b/src/main/java/one/talon/model/ScimPatchRequest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimPatchOperation; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -201,10 +200,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimResource.java b/src/main/java/one/talon/model/ScimResource.java index 29f124e6..9889dea5 100644 --- a/src/main/java/one/talon/model/ScimResource.java +++ b/src/main/java/one/talon/model/ScimResource.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimResourceTypesListResponse.java b/src/main/java/one/talon/model/ScimResourceTypesListResponse.java index 6c63eca2..53126abe 100644 --- a/src/main/java/one/talon/model/ScimResourceTypesListResponse.java +++ b/src/main/java/one/talon/model/ScimResourceTypesListResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimResource; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimSchemaResource.java b/src/main/java/one/talon/model/ScimSchemaResource.java index 8bcfb91b..76bd5b95 100644 --- a/src/main/java/one/talon/model/ScimSchemaResource.java +++ b/src/main/java/one/talon/model/ScimSchemaResource.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimSchemasListResponse.java b/src/main/java/one/talon/model/ScimSchemasListResponse.java index 8cd8eb00..9ec61395 100644 --- a/src/main/java/one/talon/model/ScimSchemasListResponse.java +++ b/src/main/java/one/talon/model/ScimSchemasListResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimSchemaResource; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -227,10 +226,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimServiceProviderConfigResponse.java b/src/main/java/one/talon/model/ScimServiceProviderConfigResponse.java index aef3fc67..a8b3c8d1 100644 --- a/src/main/java/one/talon/model/ScimServiceProviderConfigResponse.java +++ b/src/main/java/one/talon/model/ScimServiceProviderConfigResponse.java @@ -28,7 +28,6 @@ import one.talon.model.ScimServiceProviderConfigResponseFilter; import one.talon.model.ScimServiceProviderConfigResponsePatch; import one.talon.model.ScimServiceProviderConfigResponseSort; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -327,10 +326,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseBulk.java b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseBulk.java index 71421f53..1bba2d83 100644 --- a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseBulk.java +++ b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseBulk.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseChangePassword.java b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseChangePassword.java index 236b8aa2..c33d27f0 100644 --- a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseChangePassword.java +++ b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseChangePassword.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseFilter.java b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseFilter.java index efb77127..a1e1609d 100644 --- a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseFilter.java +++ b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseFilter.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimServiceProviderConfigResponsePatch.java b/src/main/java/one/talon/model/ScimServiceProviderConfigResponsePatch.java index 3309a4ee..fe999959 100644 --- a/src/main/java/one/talon/model/ScimServiceProviderConfigResponsePatch.java +++ b/src/main/java/one/talon/model/ScimServiceProviderConfigResponsePatch.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseSort.java b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseSort.java index f2ed43fc..760f2d61 100644 --- a/src/main/java/one/talon/model/ScimServiceProviderConfigResponseSort.java +++ b/src/main/java/one/talon/model/ScimServiceProviderConfigResponseSort.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimUser.java b/src/main/java/one/talon/model/ScimUser.java index 8c3cca48..180fb0b5 100644 --- a/src/main/java/one/talon/model/ScimUser.java +++ b/src/main/java/one/talon/model/ScimUser.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.ScimBaseUserName; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ScimUsersListResponse.java b/src/main/java/one/talon/model/ScimUsersListResponse.java index 1c120c70..09e90d74 100644 --- a/src/main/java/one/talon/model/ScimUsersListResponse.java +++ b/src/main/java/one/talon/model/ScimUsersListResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.ScimUser; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -227,10 +226,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SecondaryDeployment.java b/src/main/java/one/talon/model/SecondaryDeployment.java index d1d0519d..f650e7a2 100644 --- a/src/main/java/one/talon/model/SecondaryDeployment.java +++ b/src/main/java/one/talon/model/SecondaryDeployment.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -395,10 +394,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Session.java b/src/main/java/one/talon/model/Session.java index 6dda6845..a42774b0 100644 --- a/src/main/java/one/talon/model/Session.java +++ b/src/main/java/one/talon/model/Session.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -209,10 +208,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SetDiscountEffectProps.java b/src/main/java/one/talon/model/SetDiscountEffectProps.java index 8ca8b7da..bcc03fcf 100644 --- a/src/main/java/one/talon/model/SetDiscountEffectProps.java +++ b/src/main/java/one/talon/model/SetDiscountEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SetDiscountPerAdditionalCostEffectProps.java b/src/main/java/one/talon/model/SetDiscountPerAdditionalCostEffectProps.java index b381d7bf..1ad8d8ad 100644 --- a/src/main/java/one/talon/model/SetDiscountPerAdditionalCostEffectProps.java +++ b/src/main/java/one/talon/model/SetDiscountPerAdditionalCostEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SetDiscountPerAdditionalCostPerItemEffectProps.java b/src/main/java/one/talon/model/SetDiscountPerAdditionalCostPerItemEffectProps.java index 77ca5f94..6e7f2ad1 100644 --- a/src/main/java/one/talon/model/SetDiscountPerAdditionalCostPerItemEffectProps.java +++ b/src/main/java/one/talon/model/SetDiscountPerAdditionalCostPerItemEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SetDiscountPerItemEffectProps.java b/src/main/java/one/talon/model/SetDiscountPerItemEffectProps.java index a7047989..c6e8edfc 100644 --- a/src/main/java/one/talon/model/SetDiscountPerItemEffectProps.java +++ b/src/main/java/one/talon/model/SetDiscountPerItemEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -469,10 +468,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SetLoyaltyPointsExpiryDateEffectProps.java b/src/main/java/one/talon/model/SetLoyaltyPointsExpiryDateEffectProps.java index 53a7f5c8..f84ddbd9 100644 --- a/src/main/java/one/talon/model/SetLoyaltyPointsExpiryDateEffectProps.java +++ b/src/main/java/one/talon/model/SetLoyaltyPointsExpiryDateEffectProps.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LoyaltyLedgerEntryExpiryDateChange; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -246,10 +245,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ShowBundleMetadataEffectProps.java b/src/main/java/one/talon/model/ShowBundleMetadataEffectProps.java index 0bac5925..1c418692 100644 --- a/src/main/java/one/talon/model/ShowBundleMetadataEffectProps.java +++ b/src/main/java/one/talon/model/ShowBundleMetadataEffectProps.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -227,10 +226,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ShowNotificationEffectProps.java b/src/main/java/one/talon/model/ShowNotificationEffectProps.java index cd39284f..52421173 100644 --- a/src/main/java/one/talon/model/ShowNotificationEffectProps.java +++ b/src/main/java/one/talon/model/ShowNotificationEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SkuUnitAnalytics.java b/src/main/java/one/talon/model/SkuUnitAnalytics.java index 2b9fbc12..32f3271b 100644 --- a/src/main/java/one/talon/model/SkuUnitAnalytics.java +++ b/src/main/java/one/talon/model/SkuUnitAnalytics.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.ProductUnitAnalyticsTotals; import one.talon.model.SkuUnitAnalyticsDataPoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -194,10 +193,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SkuUnitAnalyticsDataPoint.java b/src/main/java/one/talon/model/SkuUnitAnalyticsDataPoint.java index 6931be08..2f0dccf0 100644 --- a/src/main/java/one/talon/model/SkuUnitAnalyticsDataPoint.java +++ b/src/main/java/one/talon/model/SkuUnitAnalyticsDataPoint.java @@ -23,7 +23,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.AnalyticsDataPointWithTrend; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -236,10 +235,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SlotDef.java b/src/main/java/one/talon/model/SlotDef.java index 40a47a7a..ec18301c 100644 --- a/src/main/java/one/talon/model/SlotDef.java +++ b/src/main/java/one/talon/model/SlotDef.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -286,10 +285,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Store.java b/src/main/java/one/talon/model/Store.java index b38a5bf7..5f7c9618 100644 --- a/src/main/java/one/talon/model/Store.java +++ b/src/main/java/one/talon/model/Store.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -375,10 +374,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughChangedItem.java b/src/main/java/one/talon/model/StrikethroughChangedItem.java index a2388504..14602d28 100644 --- a/src/main/java/one/talon/model/StrikethroughChangedItem.java +++ b/src/main/java/one/talon/model/StrikethroughChangedItem.java @@ -29,7 +29,6 @@ import java.util.Map; import one.talon.model.PriceDetail; import one.talon.model.StrikethroughEffect; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -363,10 +362,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughCustomEffectPerItemProps.java b/src/main/java/one/talon/model/StrikethroughCustomEffectPerItemProps.java index a91a3401..2224df21 100644 --- a/src/main/java/one/talon/model/StrikethroughCustomEffectPerItemProps.java +++ b/src/main/java/one/talon/model/StrikethroughCustomEffectPerItemProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughDebugResponse.java b/src/main/java/one/talon/model/StrikethroughDebugResponse.java index c09e880d..ee5d4578 100644 --- a/src/main/java/one/talon/model/StrikethroughDebugResponse.java +++ b/src/main/java/one/talon/model/StrikethroughDebugResponse.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.StrikethroughEffect; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -201,10 +200,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughEffect.java b/src/main/java/one/talon/model/StrikethroughEffect.java index 07ac0dea..8eefed8f 100644 --- a/src/main/java/one/talon/model/StrikethroughEffect.java +++ b/src/main/java/one/talon/model/StrikethroughEffect.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -454,10 +453,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughLabelingNotification.java b/src/main/java/one/talon/model/StrikethroughLabelingNotification.java index 5e5d1f83..5699fadc 100644 --- a/src/main/java/one/talon/model/StrikethroughLabelingNotification.java +++ b/src/main/java/one/talon/model/StrikethroughLabelingNotification.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.StrikethroughChangedItem; import one.talon.model.StrikethroughTrigger; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -57,7 +56,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") public class StrikethroughLabelingNotification { /** - * The version of the strikethrough pricing notification. + * The version of the strikethrough pricing notification. Set for **scheduled** strikethrough pricing updates only. */ @JsonAdapter(VersionEnum.Adapter.class) public enum VersionEnum { @@ -210,7 +209,7 @@ public StrikethroughLabelingNotification version(@javax.annotation.Nullable Vers } /** - * The version of the strikethrough pricing notification. + * The version of the strikethrough pricing notification. Set for **scheduled** strikethrough pricing updates only. * @return version */ @javax.annotation.Nullable @@ -477,10 +476,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java index 4c97a82c..7668b9e6 100644 --- a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java +++ b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -75,7 +74,7 @@ public StrikethroughSetDiscountPerItemEffectProps name(@javax.annotation.Nonnull } /** - * effect name. + * The effect name. * @return name */ @javax.annotation.Nonnull @@ -113,7 +112,7 @@ public StrikethroughSetDiscountPerItemEffectProps excludedFromPriceHistory(@java } /** - * Get excludedFromPriceHistory + * When set to `true`, the applied discount is excluded from the item's price history. * @return excludedFromPriceHistory */ @javax.annotation.Nullable @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java index ff9fe0b6..e06da416 100644 --- a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java +++ b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -70,7 +69,7 @@ public StrikethroughSetDiscountPerItemMemberEffectProps name(@javax.annotation.N } /** - * effect name. + * The effect name. * @return name */ @javax.annotation.Nonnull @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/StrikethroughTrigger.java b/src/main/java/one/talon/model/StrikethroughTrigger.java index 85526baa..e6b0b623 100644 --- a/src/main/java/one/talon/model/StrikethroughTrigger.java +++ b/src/main/java/one/talon/model/StrikethroughTrigger.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -261,10 +260,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SummarizeCampaignStoreBudget200Response.java b/src/main/java/one/talon/model/SummarizeCampaignStoreBudget200Response.java index 759d5142..9d9ed846 100644 --- a/src/main/java/one/talon/model/SummarizeCampaignStoreBudget200Response.java +++ b/src/main/java/one/talon/model/SummarizeCampaignStoreBudget200Response.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.SummaryCampaignStoreBudget; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SummaryCampaignStoreBudget.java b/src/main/java/one/talon/model/SummaryCampaignStoreBudget.java index f925b99f..5adad0ae 100644 --- a/src/main/java/one/talon/model/SummaryCampaignStoreBudget.java +++ b/src/main/java/one/talon/model/SummaryCampaignStoreBudget.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -370,10 +369,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/SupportRequest.java b/src/main/java/one/talon/model/SupportRequest.java new file mode 100644 index 00000000..35a86dc7 --- /dev/null +++ b/src/main/java/one/talon/model/SupportRequest.java @@ -0,0 +1,788 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * Summary of a support request created by a customer support agent. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class SupportRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private Long id; + + public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; + @SerializedName(SERIALIZED_NAME_APPLICATION_ID) + @javax.annotation.Nonnull + private Long applicationId; + + public static final String SERIALIZED_NAME_CAMPAIGN_ID = "campaignId"; + @SerializedName(SERIALIZED_NAME_CAMPAIGN_ID) + @javax.annotation.Nullable + private Long campaignId; + + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_ID = "loyaltyProgramId"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_ID) + @javax.annotation.Nullable + private Long loyaltyProgramId; + + public static final String SERIALIZED_NAME_SUBLEDGER_ID = "subledgerId"; + @SerializedName(SERIALIZED_NAME_SUBLEDGER_ID) + @javax.annotation.Nullable + private Long subledgerId; + + public static final String SERIALIZED_NAME_CREATED_BY_USER = "createdByUser"; + @SerializedName(SERIALIZED_NAME_CREATED_BY_USER) + @javax.annotation.Nonnull + private String createdByUser; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_CUSTOMER_PROFILE_ID = "customerProfileId"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_PROFILE_ID) + @javax.annotation.Nonnull + private String customerProfileId; + + /** + * Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. + */ + @JsonAdapter(RequestTypeEnum.Adapter.class) + public enum RequestTypeEnum { + GIFT_CARD("gift_card"), + + PERSONAL_COUPON("personal_coupon"), + + LOYALTY_POINTS_ADDED("loyalty_points_added"), + + LOYALTY_POINTS_DEDUCTED("loyalty_points_deducted"); + + private String value; + + RequestTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestTypeEnum fromValue(String value) { + for (RequestTypeEnum b : RequestTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RequestTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_REQUEST_TYPE = "requestType"; + @SerializedName(SERIALIZED_NAME_REQUEST_TYPE) + @javax.annotation.Nonnull + private RequestTypeEnum requestType; + + public static final String SERIALIZED_NAME_REQUEST_VALUE = "requestValue"; + @SerializedName(SERIALIZED_NAME_REQUEST_VALUE) + @javax.annotation.Nullable + private Float requestValue; + + public static final String SERIALIZED_NAME_REQUEST_NOTE = "requestNote"; + @SerializedName(SERIALIZED_NAME_REQUEST_NOTE) + @javax.annotation.Nonnull + private String requestNote; + + /** + * Current status of the support request. + */ + @JsonAdapter(RequestStatusEnum.Adapter.class) + public enum RequestStatusEnum { + PENDING_APPROVAL("pending_approval"), + + APPROVED("approved"), + + REJECTED("rejected"); + + private String value; + + RequestStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestStatusEnum fromValue(String value) { + for (RequestStatusEnum b : RequestStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RequestStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_REQUEST_STATUS = "requestStatus"; + @SerializedName(SERIALIZED_NAME_REQUEST_STATUS) + @javax.annotation.Nonnull + private RequestStatusEnum requestStatus; + + public static final String SERIALIZED_NAME_PROCESSED_AT = "processedAt"; + @SerializedName(SERIALIZED_NAME_PROCESSED_AT) + @javax.annotation.Nullable + private OffsetDateTime processedAt; + + public static final String SERIALIZED_NAME_PROCESSING_NOTE = "processingNote"; + @SerializedName(SERIALIZED_NAME_PROCESSING_NOTE) + @javax.annotation.Nullable + private String processingNote; + + public static final String SERIALIZED_NAME_PROCESSED_BY_USER = "processedByUser"; + @SerializedName(SERIALIZED_NAME_PROCESSED_BY_USER) + @javax.annotation.Nullable + private String processedByUser; + + public SupportRequest() { + } + + public SupportRequest id(@javax.annotation.Nonnull Long id) { + this.id = id; + return this; + } + + /** + * Identifier of the support request. + * @return id + */ + @javax.annotation.Nonnull + public Long getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull Long id) { + this.id = id; + } + + + public SupportRequest applicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL. + * @return applicationId + */ + @javax.annotation.Nonnull + public Long getApplicationId() { + return applicationId; + } + + public void setApplicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + } + + + public SupportRequest campaignId(@javax.annotation.Nullable Long campaignId) { + this.campaignId = campaignId; + return this; + } + + /** + * Identifier of the campaign where the coupon or gift card is created. + * @return campaignId + */ + @javax.annotation.Nullable + public Long getCampaignId() { + return campaignId; + } + + public void setCampaignId(@javax.annotation.Nullable Long campaignId) { + this.campaignId = campaignId; + } + + + public SupportRequest loyaltyProgramId(@javax.annotation.Nullable Long loyaltyProgramId) { + this.loyaltyProgramId = loyaltyProgramId; + return this; + } + + /** + * Identifier of the loyalty program where the points are added or deducted. + * @return loyaltyProgramId + */ + @javax.annotation.Nullable + public Long getLoyaltyProgramId() { + return loyaltyProgramId; + } + + public void setLoyaltyProgramId(@javax.annotation.Nullable Long loyaltyProgramId) { + this.loyaltyProgramId = loyaltyProgramId; + } + + + public SupportRequest subledgerId(@javax.annotation.Nullable Long subledgerId) { + this.subledgerId = subledgerId; + return this; + } + + /** + * Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically. + * @return subledgerId + */ + @javax.annotation.Nullable + public Long getSubledgerId() { + return subledgerId; + } + + public void setSubledgerId(@javax.annotation.Nullable Long subledgerId) { + this.subledgerId = subledgerId; + } + + + public SupportRequest createdByUser(@javax.annotation.Nonnull String createdByUser) { + this.createdByUser = createdByUser; + return this; + } + + /** + * Email address of the customer support agent who created the support request. + * @return createdByUser + */ + @javax.annotation.Nonnull + public String getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(@javax.annotation.Nonnull String createdByUser) { + this.createdByUser = createdByUser; + } + + + public SupportRequest createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the request was made. + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public SupportRequest customerProfileId(@javax.annotation.Nonnull String customerProfileId) { + this.customerProfileId = customerProfileId; + return this; + } + + /** + * Integration ID of the customer profile linked to the support request. + * @return customerProfileId + */ + @javax.annotation.Nonnull + public String getCustomerProfileId() { + return customerProfileId; + } + + public void setCustomerProfileId(@javax.annotation.Nonnull String customerProfileId) { + this.customerProfileId = customerProfileId; + } + + + public SupportRequest requestType(@javax.annotation.Nonnull RequestTypeEnum requestType) { + this.requestType = requestType; + return this; + } + + /** + * Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. + * @return requestType + */ + @javax.annotation.Nonnull + public RequestTypeEnum getRequestType() { + return requestType; + } + + public void setRequestType(@javax.annotation.Nonnull RequestTypeEnum requestType) { + this.requestType = requestType; + } + + + public SupportRequest requestValue(@javax.annotation.Nullable Float requestValue) { + this.requestValue = requestValue; + return this; + } + + /** + * Requested monetary balance of the gift card or the number of loyalty points to be added or deducted. + * minimum: 0 + * @return requestValue + */ + @javax.annotation.Nullable + public Float getRequestValue() { + return requestValue; + } + + public void setRequestValue(@javax.annotation.Nullable Float requestValue) { + this.requestValue = requestValue; + } + + + public SupportRequest requestNote(@javax.annotation.Nonnull String requestNote) { + this.requestNote = requestNote; + return this; + } + + /** + * Notes attached to the support request. + * @return requestNote + */ + @javax.annotation.Nonnull + public String getRequestNote() { + return requestNote; + } + + public void setRequestNote(@javax.annotation.Nonnull String requestNote) { + this.requestNote = requestNote; + } + + + public SupportRequest requestStatus(@javax.annotation.Nonnull RequestStatusEnum requestStatus) { + this.requestStatus = requestStatus; + return this; + } + + /** + * Current status of the support request. + * @return requestStatus + */ + @javax.annotation.Nonnull + public RequestStatusEnum getRequestStatus() { + return requestStatus; + } + + public void setRequestStatus(@javax.annotation.Nonnull RequestStatusEnum requestStatus) { + this.requestStatus = requestStatus; + } + + + public SupportRequest processedAt(@javax.annotation.Nullable OffsetDateTime processedAt) { + this.processedAt = processedAt; + return this; + } + + /** + * Timestamp when the request was approved or rejected. + * @return processedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getProcessedAt() { + return processedAt; + } + + public void setProcessedAt(@javax.annotation.Nullable OffsetDateTime processedAt) { + this.processedAt = processedAt; + } + + + public SupportRequest processingNote(@javax.annotation.Nullable String processingNote) { + this.processingNote = processingNote; + return this; + } + + /** + * Notes attached by the admin when rejecting or approving a request. + * @return processingNote + */ + @javax.annotation.Nullable + public String getProcessingNote() { + return processingNote; + } + + public void setProcessingNote(@javax.annotation.Nullable String processingNote) { + this.processingNote = processingNote; + } + + + public SupportRequest processedByUser(@javax.annotation.Nullable String processedByUser) { + this.processedByUser = processedByUser; + return this; + } + + /** + * Email address of the admin who approved or rejected the support request. + * @return processedByUser + */ + @javax.annotation.Nullable + public String getProcessedByUser() { + return processedByUser; + } + + public void setProcessedByUser(@javax.annotation.Nullable String processedByUser) { + this.processedByUser = processedByUser; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SupportRequest instance itself + */ + public SupportRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SupportRequest supportRequest = (SupportRequest) o; + return Objects.equals(this.id, supportRequest.id) && + Objects.equals(this.applicationId, supportRequest.applicationId) && + Objects.equals(this.campaignId, supportRequest.campaignId) && + Objects.equals(this.loyaltyProgramId, supportRequest.loyaltyProgramId) && + Objects.equals(this.subledgerId, supportRequest.subledgerId) && + Objects.equals(this.createdByUser, supportRequest.createdByUser) && + Objects.equals(this.createdAt, supportRequest.createdAt) && + Objects.equals(this.customerProfileId, supportRequest.customerProfileId) && + Objects.equals(this.requestType, supportRequest.requestType) && + Objects.equals(this.requestValue, supportRequest.requestValue) && + Objects.equals(this.requestNote, supportRequest.requestNote) && + Objects.equals(this.requestStatus, supportRequest.requestStatus) && + Objects.equals(this.processedAt, supportRequest.processedAt) && + Objects.equals(this.processingNote, supportRequest.processingNote) && + Objects.equals(this.processedByUser, supportRequest.processedByUser)&& + Objects.equals(this.additionalProperties, supportRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, applicationId, campaignId, loyaltyProgramId, subledgerId, createdByUser, createdAt, customerProfileId, requestType, requestValue, requestNote, requestStatus, processedAt, processingNote, processedByUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SupportRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" loyaltyProgramId: ").append(toIndentedString(loyaltyProgramId)).append("\n"); + sb.append(" subledgerId: ").append(toIndentedString(subledgerId)).append("\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" customerProfileId: ").append(toIndentedString(customerProfileId)).append("\n"); + sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); + sb.append(" requestValue: ").append(toIndentedString(requestValue)).append("\n"); + sb.append(" requestNote: ").append(toIndentedString(requestNote)).append("\n"); + sb.append(" requestStatus: ").append(toIndentedString(requestStatus)).append("\n"); + sb.append(" processedAt: ").append(toIndentedString(processedAt)).append("\n"); + sb.append(" processingNote: ").append(toIndentedString(processingNote)).append("\n"); + sb.append(" processedByUser: ").append(toIndentedString(processedByUser)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "createdByUser", "createdAt", "customerProfileId", "requestType", "requestValue", "requestNote", "requestStatus", "processedAt", "processingNote", "processedByUser")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "applicationId", "createdByUser", "createdAt", "customerProfileId", "requestType", "requestNote", "requestStatus")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SupportRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SupportRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SupportRequest is not found in the empty JSON string", SupportRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SupportRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("createdByUser").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `createdByUser` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdByUser").toString())); + } + if (!jsonObj.get("customerProfileId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `customerProfileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerProfileId").toString())); + } + if (!jsonObj.get("requestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `requestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestType").toString())); + } + // validate the required field `requestType` + RequestTypeEnum.validateJsonElement(jsonObj.get("requestType")); + if (!jsonObj.get("requestNote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `requestNote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestNote").toString())); + } + if (!jsonObj.get("requestStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `requestStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestStatus").toString())); + } + // validate the required field `requestStatus` + RequestStatusEnum.validateJsonElement(jsonObj.get("requestStatus")); + if ((jsonObj.get("processingNote") != null && !jsonObj.get("processingNote").isJsonNull()) && !jsonObj.get("processingNote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `processingNote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processingNote").toString())); + } + if ((jsonObj.get("processedByUser") != null && !jsonObj.get("processedByUser").isJsonNull()) && !jsonObj.get("processedByUser").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `processedByUser` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processedByUser").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SupportRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SupportRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SupportRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SupportRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SupportRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SupportRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SupportRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SupportRequest + * @throws IOException if the JSON string is invalid with respect to SupportRequest + */ + public static SupportRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SupportRequest.class); + } + + /** + * Convert an instance of SupportRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/SupportRequestInput.java b/src/main/java/one/talon/model/SupportRequestInput.java new file mode 100644 index 00000000..059acf97 --- /dev/null +++ b/src/main/java/one/talon/model/SupportRequestInput.java @@ -0,0 +1,537 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * SupportRequestInput + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class SupportRequestInput { + public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; + @SerializedName(SERIALIZED_NAME_APPLICATION_ID) + @javax.annotation.Nonnull + private Long applicationId; + + public static final String SERIALIZED_NAME_CAMPAIGN_ID = "campaignId"; + @SerializedName(SERIALIZED_NAME_CAMPAIGN_ID) + @javax.annotation.Nullable + private Long campaignId; + + public static final String SERIALIZED_NAME_LOYALTY_PROGRAM_ID = "loyaltyProgramId"; + @SerializedName(SERIALIZED_NAME_LOYALTY_PROGRAM_ID) + @javax.annotation.Nullable + private Long loyaltyProgramId; + + public static final String SERIALIZED_NAME_SUBLEDGER_ID = "subledgerId"; + @SerializedName(SERIALIZED_NAME_SUBLEDGER_ID) + @javax.annotation.Nullable + private Long subledgerId; + + public static final String SERIALIZED_NAME_CUSTOMER_PROFILE_ID = "customerProfileId"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_PROFILE_ID) + @javax.annotation.Nonnull + private String customerProfileId; + + /** + * Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. + */ + @JsonAdapter(RequestTypeEnum.Adapter.class) + public enum RequestTypeEnum { + GIFT_CARD("gift_card"), + + PERSONAL_COUPON("personal_coupon"), + + LOYALTY_POINTS_ADDED("loyalty_points_added"), + + LOYALTY_POINTS_DEDUCTED("loyalty_points_deducted"); + + private String value; + + RequestTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestTypeEnum fromValue(String value) { + for (RequestTypeEnum b : RequestTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RequestTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_REQUEST_TYPE = "requestType"; + @SerializedName(SERIALIZED_NAME_REQUEST_TYPE) + @javax.annotation.Nonnull + private RequestTypeEnum requestType; + + public static final String SERIALIZED_NAME_REQUEST_VALUE = "requestValue"; + @SerializedName(SERIALIZED_NAME_REQUEST_VALUE) + @javax.annotation.Nullable + private Float requestValue; + + public static final String SERIALIZED_NAME_REQUEST_NOTE = "requestNote"; + @SerializedName(SERIALIZED_NAME_REQUEST_NOTE) + @javax.annotation.Nonnull + private String requestNote; + + public SupportRequestInput() { + } + + public SupportRequestInput applicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Identifier of the Application connected to the loyalty program or the campaign. It is displayed in your Talon.One deployment URL. + * @return applicationId + */ + @javax.annotation.Nonnull + public Long getApplicationId() { + return applicationId; + } + + public void setApplicationId(@javax.annotation.Nonnull Long applicationId) { + this.applicationId = applicationId; + } + + + public SupportRequestInput campaignId(@javax.annotation.Nullable Long campaignId) { + this.campaignId = campaignId; + return this; + } + + /** + * Identifier of the campaign where the coupon or gift card is created. + * @return campaignId + */ + @javax.annotation.Nullable + public Long getCampaignId() { + return campaignId; + } + + public void setCampaignId(@javax.annotation.Nullable Long campaignId) { + this.campaignId = campaignId; + } + + + public SupportRequestInput loyaltyProgramId(@javax.annotation.Nullable Long loyaltyProgramId) { + this.loyaltyProgramId = loyaltyProgramId; + return this; + } + + /** + * Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + * @return loyaltyProgramId + */ + @javax.annotation.Nullable + public Long getLoyaltyProgramId() { + return loyaltyProgramId; + } + + public void setLoyaltyProgramId(@javax.annotation.Nullable Long loyaltyProgramId) { + this.loyaltyProgramId = loyaltyProgramId; + } + + + public SupportRequestInput subledgerId(@javax.annotation.Nullable Long subledgerId) { + this.subledgerId = subledgerId; + return this; + } + + /** + * Identifier of the subledger the points are added to or deducted from. If there is no existing subledger with this ID, the subledger is created automatically. + * @return subledgerId + */ + @javax.annotation.Nullable + public Long getSubledgerId() { + return subledgerId; + } + + public void setSubledgerId(@javax.annotation.Nullable Long subledgerId) { + this.subledgerId = subledgerId; + } + + + public SupportRequestInput customerProfileId(@javax.annotation.Nonnull String customerProfileId) { + this.customerProfileId = customerProfileId; + return this; + } + + /** + * Integration ID of the customer profile linked to the support request. + * @return customerProfileId + */ + @javax.annotation.Nonnull + public String getCustomerProfileId() { + return customerProfileId; + } + + public void setCustomerProfileId(@javax.annotation.Nonnull String customerProfileId) { + this.customerProfileId = customerProfileId; + } + + + public SupportRequestInput requestType(@javax.annotation.Nonnull RequestTypeEnum requestType) { + this.requestType = requestType; + return this; + } + + /** + * Type of reward requested, including gift cards, personal coupons, and loyalty point additions or deductions. + * @return requestType + */ + @javax.annotation.Nonnull + public RequestTypeEnum getRequestType() { + return requestType; + } + + public void setRequestType(@javax.annotation.Nonnull RequestTypeEnum requestType) { + this.requestType = requestType; + } + + + public SupportRequestInput requestValue(@javax.annotation.Nullable Float requestValue) { + this.requestValue = requestValue; + return this; + } + + /** + * Requested monetary balance of the gift card or the number of loyalty points to be added or deducted. + * minimum: 0 + * @return requestValue + */ + @javax.annotation.Nullable + public Float getRequestValue() { + return requestValue; + } + + public void setRequestValue(@javax.annotation.Nullable Float requestValue) { + this.requestValue = requestValue; + } + + + public SupportRequestInput requestNote(@javax.annotation.Nonnull String requestNote) { + this.requestNote = requestNote; + return this; + } + + /** + * Notes attached to the support request. + * @return requestNote + */ + @javax.annotation.Nonnull + public String getRequestNote() { + return requestNote; + } + + public void setRequestNote(@javax.annotation.Nonnull String requestNote) { + this.requestNote = requestNote; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SupportRequestInput instance itself + */ + public SupportRequestInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SupportRequestInput supportRequestInput = (SupportRequestInput) o; + return Objects.equals(this.applicationId, supportRequestInput.applicationId) && + Objects.equals(this.campaignId, supportRequestInput.campaignId) && + Objects.equals(this.loyaltyProgramId, supportRequestInput.loyaltyProgramId) && + Objects.equals(this.subledgerId, supportRequestInput.subledgerId) && + Objects.equals(this.customerProfileId, supportRequestInput.customerProfileId) && + Objects.equals(this.requestType, supportRequestInput.requestType) && + Objects.equals(this.requestValue, supportRequestInput.requestValue) && + Objects.equals(this.requestNote, supportRequestInput.requestNote)&& + Objects.equals(this.additionalProperties, supportRequestInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(applicationId, campaignId, loyaltyProgramId, subledgerId, customerProfileId, requestType, requestValue, requestNote, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SupportRequestInput {\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" campaignId: ").append(toIndentedString(campaignId)).append("\n"); + sb.append(" loyaltyProgramId: ").append(toIndentedString(loyaltyProgramId)).append("\n"); + sb.append(" subledgerId: ").append(toIndentedString(subledgerId)).append("\n"); + sb.append(" customerProfileId: ").append(toIndentedString(customerProfileId)).append("\n"); + sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); + sb.append(" requestValue: ").append(toIndentedString(requestValue)).append("\n"); + sb.append(" requestNote: ").append(toIndentedString(requestNote)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("applicationId", "campaignId", "loyaltyProgramId", "subledgerId", "customerProfileId", "requestType", "requestValue", "requestNote")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("applicationId", "customerProfileId", "requestType", "requestNote")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SupportRequestInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SupportRequestInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SupportRequestInput is not found in the empty JSON string", SupportRequestInput.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SupportRequestInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("customerProfileId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `customerProfileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerProfileId").toString())); + } + if (!jsonObj.get("requestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `requestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestType").toString())); + } + // validate the required field `requestType` + RequestTypeEnum.validateJsonElement(jsonObj.get("requestType")); + if (!jsonObj.get("requestNote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `requestNote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestNote").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SupportRequestInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SupportRequestInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SupportRequestInput.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SupportRequestInput value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SupportRequestInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SupportRequestInput instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SupportRequestInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of SupportRequestInput + * @throws IOException if the JSON string is invalid with respect to SupportRequestInput + */ + public static SupportRequestInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SupportRequestInput.class); + } + + /** + * Convert an instance of SupportRequestInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/TalangAttribute.java b/src/main/java/one/talon/model/TalangAttribute.java index aaa3ad81..e90a5bf8 100644 --- a/src/main/java/one/talon/model/TalangAttribute.java +++ b/src/main/java/one/talon/model/TalangAttribute.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -96,7 +95,11 @@ public enum EntityEnum { STORE("Store"), - ACHIEVEMENTS("Achievements"); + ACHIEVEMENTS("Achievements"), + + ADVANCED_EVENT("AdvancedEvent"), + + ADVANCED_EVENT_CONNECTED_SESSION("AdvancedEventConnectedSession"); private String value; @@ -514,10 +517,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TalangAttributeVisibility.java b/src/main/java/one/talon/model/TalangAttributeVisibility.java index d64498c3..853569be 100644 --- a/src/main/java/one/talon/model/TalangAttributeVisibility.java +++ b/src/main/java/one/talon/model/TalangAttributeVisibility.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -200,10 +199,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TemplateArgDef.java b/src/main/java/one/talon/model/TemplateArgDef.java index a2fc2415..44f60069 100644 --- a/src/main/java/one/talon/model/TemplateArgDef.java +++ b/src/main/java/one/talon/model/TemplateArgDef.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -372,10 +371,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TemplateDef.java b/src/main/java/one/talon/model/TemplateDef.java index 95c172ba..d3d88b23 100644 --- a/src/main/java/one/talon/model/TemplateDef.java +++ b/src/main/java/one/talon/model/TemplateDef.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -436,10 +435,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TemplateLimitConfig.java b/src/main/java/one/talon/model/TemplateLimitConfig.java index 0655265f..15db5069 100644 --- a/src/main/java/one/talon/model/TemplateLimitConfig.java +++ b/src/main/java/one/talon/model/TemplateLimitConfig.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -362,10 +361,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Tier.java b/src/main/java/one/talon/model/Tier.java index d4d7a84a..f03b1f7e 100644 --- a/src/main/java/one/talon/model/Tier.java +++ b/src/main/java/one/talon/model/Tier.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierDowngradeData.java b/src/main/java/one/talon/model/TierDowngradeData.java index ee0f526b..5f6f3d88 100644 --- a/src/main/java/one/talon/model/TierDowngradeData.java +++ b/src/main/java/one/talon/model/TierDowngradeData.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -341,10 +340,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierDowngradeNotification.java b/src/main/java/one/talon/model/TierDowngradeNotification.java index a485cd53..58bedf9b 100644 --- a/src/main/java/one/talon/model/TierDowngradeNotification.java +++ b/src/main/java/one/talon/model/TierDowngradeNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TierDowngradeData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierDowngradeNotificationPolicy.java b/src/main/java/one/talon/model/TierDowngradeNotificationPolicy.java index 96eb8437..2052a802 100644 --- a/src/main/java/one/talon/model/TierDowngradeNotificationPolicy.java +++ b/src/main/java/one/talon/model/TierDowngradeNotificationPolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierUpgradeData.java b/src/main/java/one/talon/model/TierUpgradeData.java index 6bf2db41..94e07c77 100644 --- a/src/main/java/one/talon/model/TierUpgradeData.java +++ b/src/main/java/one/talon/model/TierUpgradeData.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -393,10 +392,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierUpgradeNotification.java b/src/main/java/one/talon/model/TierUpgradeNotification.java index 22a2b15e..bb4b53f3 100644 --- a/src/main/java/one/talon/model/TierUpgradeNotification.java +++ b/src/main/java/one/talon/model/TierUpgradeNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TierUpgradeData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierUpgradeNotificationPolicy.java b/src/main/java/one/talon/model/TierUpgradeNotificationPolicy.java index 647d7e74..fc03e8f1 100644 --- a/src/main/java/one/talon/model/TierUpgradeNotificationPolicy.java +++ b/src/main/java/one/talon/model/TierUpgradeNotificationPolicy.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierWillDowngradeData.java b/src/main/java/one/talon/model/TierWillDowngradeData.java index 4b65021d..dea3375a 100644 --- a/src/main/java/one/talon/model/TierWillDowngradeData.java +++ b/src/main/java/one/talon/model/TierWillDowngradeData.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -341,10 +340,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierWillDowngradeNotification.java b/src/main/java/one/talon/model/TierWillDowngradeNotification.java index c5353b51..141c19d8 100644 --- a/src/main/java/one/talon/model/TierWillDowngradeNotification.java +++ b/src/main/java/one/talon/model/TierWillDowngradeNotification.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TierWillDowngradeData; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -269,10 +268,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierWillDowngradeNotificationPolicy.java b/src/main/java/one/talon/model/TierWillDowngradeNotificationPolicy.java index 89ef8d38..dd0a4a6b 100644 --- a/src/main/java/one/talon/model/TierWillDowngradeNotificationPolicy.java +++ b/src/main/java/one/talon/model/TierWillDowngradeNotificationPolicy.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TierWillDowngradeNotificationTrigger; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -245,10 +244,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TierWillDowngradeNotificationTrigger.java b/src/main/java/one/talon/model/TierWillDowngradeNotificationTrigger.java index 7c163d1c..6adf3d45 100644 --- a/src/main/java/one/talon/model/TierWillDowngradeNotificationTrigger.java +++ b/src/main/java/one/talon/model/TierWillDowngradeNotificationTrigger.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -234,10 +233,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TimePoint.java b/src/main/java/one/talon/model/TimePoint.java index 09f7c734..1def14bd 100644 --- a/src/main/java/one/talon/model/TimePoint.java +++ b/src/main/java/one/talon/model/TimePoint.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -292,10 +291,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TransferLoyaltyCard.java b/src/main/java/one/talon/model/TransferLoyaltyCard.java index 37c749c0..9ddae4b0 100644 --- a/src/main/java/one/talon/model/TransferLoyaltyCard.java +++ b/src/main/java/one/talon/model/TransferLoyaltyCard.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TriggerWebhookEffectProps.java b/src/main/java/one/talon/model/TriggerWebhookEffectProps.java index d1398129..426a29d0 100644 --- a/src/main/java/one/talon/model/TriggerWebhookEffectProps.java +++ b/src/main/java/one/talon/model/TriggerWebhookEffectProps.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -183,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/TwoFAConfig.java b/src/main/java/one/talon/model/TwoFAConfig.java index 839e0a76..3750514a 100644 --- a/src/main/java/one/talon/model/TwoFAConfig.java +++ b/src/main/java/one/talon/model/TwoFAConfig.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateAccount.java b/src/main/java/one/talon/model/UpdateAccount.java index 2bcfde5e..40b03a97 100644 --- a/src/main/java/one/talon/model/UpdateAccount.java +++ b/src/main/java/one/talon/model/UpdateAccount.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -313,10 +312,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateAchievement.java b/src/main/java/one/talon/model/UpdateAchievement.java index 485d1c53..3f9227c1 100644 --- a/src/main/java/one/talon/model/UpdateAchievement.java +++ b/src/main/java/one/talon/model/UpdateAchievement.java @@ -24,7 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import one.talon.model.TimePoint; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -530,10 +529,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateAchievementV2.java b/src/main/java/one/talon/model/UpdateAchievementV2.java index a86e04b6..3a94a461 100644 --- a/src/main/java/one/talon/model/UpdateAchievementV2.java +++ b/src/main/java/one/talon/model/UpdateAchievementV2.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -57,22 +56,22 @@ public class UpdateAchievementV2 { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String name; public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String title; public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nullable + @javax.annotation.Nonnull private String description; public static final String SERIALIZED_NAME_TARGET = "target"; @SerializedName(SERIALIZED_NAME_TARGET) - @javax.annotation.Nullable + @javax.annotation.Nonnull private BigDecimal target; public static final String SERIALIZED_NAME_PERIOD = "period"; @@ -211,25 +210,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nullable private Boolean allowRollbackAfterCompletion; - public static final String SERIALIZED_NAME_SANDBOX = "sandbox"; - @SerializedName(SERIALIZED_NAME_SANDBOX) - @javax.annotation.Nullable - private Boolean sandbox; - public static final String SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS = "subscribedApplications"; @SerializedName(SERIALIZED_NAME_SUBSCRIBED_APPLICATIONS) - @javax.annotation.Nullable - private List subscribedApplications; - - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - @SerializedName(SERIALIZED_NAME_TIMEZONE) - @javax.annotation.Nullable - private String timezone; + @javax.annotation.Nonnull + private List subscribedApplications = new ArrayList<>(); public UpdateAchievementV2() { } - public UpdateAchievementV2 name(@javax.annotation.Nullable String name) { + public UpdateAchievementV2 name(@javax.annotation.Nonnull String name) { this.name = name; return this; } @@ -238,17 +227,17 @@ public UpdateAchievementV2 name(@javax.annotation.Nullable String name) { * The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. * @return name */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getName() { return name; } - public void setName(@javax.annotation.Nullable String name) { + public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public UpdateAchievementV2 title(@javax.annotation.Nullable String title) { + public UpdateAchievementV2 title(@javax.annotation.Nonnull String title) { this.title = title; return this; } @@ -257,17 +246,17 @@ public UpdateAchievementV2 title(@javax.annotation.Nullable String title) { * The display name for the achievement in the Campaign Manager. * @return title */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getTitle() { return title; } - public void setTitle(@javax.annotation.Nullable String title) { + public void setTitle(@javax.annotation.Nonnull String title) { this.title = title; } - public UpdateAchievementV2 description(@javax.annotation.Nullable String description) { + public UpdateAchievementV2 description(@javax.annotation.Nonnull String description) { this.description = description; return this; } @@ -276,17 +265,17 @@ public UpdateAchievementV2 description(@javax.annotation.Nullable String descrip * A description of the achievement. * @return description */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getDescription() { return description; } - public void setDescription(@javax.annotation.Nullable String description) { + public void setDescription(@javax.annotation.Nonnull String description) { this.description = description; } - public UpdateAchievementV2 target(@javax.annotation.Nullable BigDecimal target) { + public UpdateAchievementV2 target(@javax.annotation.Nonnull BigDecimal target) { this.target = target; return this; } @@ -295,12 +284,12 @@ public UpdateAchievementV2 target(@javax.annotation.Nullable BigDecimal target) * The required number of actions or the transactional milestone to complete the achievement. * @return target */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public BigDecimal getTarget() { return target; } - public void setTarget(@javax.annotation.Nullable BigDecimal target) { + public void setTarget(@javax.annotation.Nonnull BigDecimal target) { this.target = target; } @@ -419,26 +408,7 @@ public void setAllowRollbackAfterCompletion(@javax.annotation.Nullable Boolean a } - public UpdateAchievementV2 sandbox(@javax.annotation.Nullable Boolean sandbox) { - this.sandbox = sandbox; - return this; - } - - /** - * Indicates if this achievement is a live or sandbox achievement. Achievements of a given type can only be connected to Applications of the same type. - * @return sandbox - */ - @javax.annotation.Nullable - public Boolean getSandbox() { - return sandbox; - } - - public void setSandbox(@javax.annotation.Nullable Boolean sandbox) { - this.sandbox = sandbox; - } - - - public UpdateAchievementV2 subscribedApplications(@javax.annotation.Nullable List subscribedApplications) { + public UpdateAchievementV2 subscribedApplications(@javax.annotation.Nonnull List subscribedApplications) { this.subscribedApplications = subscribedApplications; return this; } @@ -455,34 +425,15 @@ public UpdateAchievementV2 addSubscribedApplicationsItem(Long subscribedApplicat * A list containing the IDs of all applications that are subscribed to A list containing the IDs of all Applications that are connected to this achievement. * @return subscribedApplications */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public List getSubscribedApplications() { return subscribedApplications; } - public void setSubscribedApplications(@javax.annotation.Nullable List subscribedApplications) { + public void setSubscribedApplications(@javax.annotation.Nonnull List subscribedApplications) { this.subscribedApplications = subscribedApplications; } - - public UpdateAchievementV2 timezone(@javax.annotation.Nullable String timezone) { - this.timezone = timezone; - return this; - } - - /** - * A string containing an IANA timezone descriptor. - * @return timezone - */ - @javax.annotation.Nullable - public String getTimezone() { - return timezone; - } - - public void setTimezone(@javax.annotation.Nullable String timezone) { - this.timezone = timezone; - } - /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -548,15 +499,13 @@ public boolean equals(Object o) { Objects.equals(this.fixedStartDate, updateAchievementV2.fixedStartDate) && Objects.equals(this.endDate, updateAchievementV2.endDate) && Objects.equals(this.allowRollbackAfterCompletion, updateAchievementV2.allowRollbackAfterCompletion) && - Objects.equals(this.sandbox, updateAchievementV2.sandbox) && - Objects.equals(this.subscribedApplications, updateAchievementV2.subscribedApplications) && - Objects.equals(this.timezone, updateAchievementV2.timezone)&& + Objects.equals(this.subscribedApplications, updateAchievementV2.subscribedApplications)&& Objects.equals(this.additionalProperties, updateAchievementV2.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, sandbox, subscribedApplications, timezone, additionalProperties); + return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, subscribedApplications, additionalProperties); } @Override @@ -573,9 +522,7 @@ public String toString() { sb.append(" fixedStartDate: ").append(toIndentedString(fixedStartDate)).append("\n"); sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); sb.append(" allowRollbackAfterCompletion: ").append(toIndentedString(allowRollbackAfterCompletion)).append("\n"); - sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n"); sb.append(" subscribedApplications: ").append(toIndentedString(subscribedApplications)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -586,10 +533,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -598,10 +542,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "sandbox", "subscribedApplications", "timezone")); + openapiFields = new HashSet(Arrays.asList("name", "title", "description", "target", "period", "recurrencePolicy", "activationPolicy", "fixedStartDate", "endDate", "allowRollbackAfterCompletion", "subscribedApplications")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); + openapiRequiredFields = new HashSet(Arrays.asList("name", "title", "description", "target", "subscribedApplications")); } /** @@ -616,14 +560,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateAchievementV2 is not found in the empty JSON string", UpdateAchievementV2.openapiRequiredFields.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateAchievementV2.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + if (!jsonObj.get("title").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + if (!jsonObj.get("description").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } if ((jsonObj.get("period") != null && !jsonObj.get("period").isJsonNull()) && !jsonObj.get("period").isJsonPrimitive()) { @@ -643,13 +594,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("activationPolicy") != null && !jsonObj.get("activationPolicy").isJsonNull()) { ActivationPolicyEnum.validateJsonElement(jsonObj.get("activationPolicy")); } - // ensure the optional json data is an array if present - if (jsonObj.get("subscribedApplications") != null && !jsonObj.get("subscribedApplications").isJsonNull() && !jsonObj.get("subscribedApplications").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("subscribedApplications") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("subscribedApplications").isJsonArray()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `subscribedApplications` to be an array in the JSON string but got `%s`", jsonObj.get("subscribedApplications").toString())); } - if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) && !jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/UpdateApplication.java b/src/main/java/one/talon/model/UpdateApplication.java index 8c7590d0..0493623a 100644 --- a/src/main/java/one/talon/model/UpdateApplication.java +++ b/src/main/java/one/talon/model/UpdateApplication.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.AttributesSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -746,10 +745,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateApplicationAPIKey.java b/src/main/java/one/talon/model/UpdateApplicationAPIKey.java index 54670ef7..8f2019a1 100644 --- a/src/main/java/one/talon/model/UpdateApplicationAPIKey.java +++ b/src/main/java/one/talon/model/UpdateApplicationAPIKey.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateApplicationCIF.java b/src/main/java/one/talon/model/UpdateApplicationCIF.java index cf00338e..7b6ba565 100644 --- a/src/main/java/one/talon/model/UpdateApplicationCIF.java +++ b/src/main/java/one/talon/model/UpdateApplicationCIF.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateAttributeEffectProps.java b/src/main/java/one/talon/model/UpdateAttributeEffectProps.java index ce92348b..6e8b4fcc 100644 --- a/src/main/java/one/talon/model/UpdateAttributeEffectProps.java +++ b/src/main/java/one/talon/model/UpdateAttributeEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateAudience.java b/src/main/java/one/talon/model/UpdateAudience.java index 2a01baec..4d2cbcc6 100644 --- a/src/main/java/one/talon/model/UpdateAudience.java +++ b/src/main/java/one/talon/model/UpdateAudience.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateBlueprint.java b/src/main/java/one/talon/model/UpdateBlueprint.java index 20f61041..a0f030a6 100644 --- a/src/main/java/one/talon/model/UpdateBlueprint.java +++ b/src/main/java/one/talon/model/UpdateBlueprint.java @@ -25,7 +25,6 @@ import java.util.List; import one.talon.model.CartItemFilterTemplate; import one.talon.model.CatalogRule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -336,10 +335,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCampaign.java b/src/main/java/one/talon/model/UpdateCampaign.java index 3d50101e..808171cb 100644 --- a/src/main/java/one/talon/model/UpdateCampaign.java +++ b/src/main/java/one/talon/model/UpdateCampaign.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -170,7 +169,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -809,10 +810,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCampaignCollection.java b/src/main/java/one/talon/model/UpdateCampaignCollection.java index 735e07b4..5e65be0d 100644 --- a/src/main/java/one/talon/model/UpdateCampaignCollection.java +++ b/src/main/java/one/talon/model/UpdateCampaignCollection.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCampaignEvaluationGroup.java b/src/main/java/one/talon/model/UpdateCampaignEvaluationGroup.java index cfb35492..6e291212 100644 --- a/src/main/java/one/talon/model/UpdateCampaignEvaluationGroup.java +++ b/src/main/java/one/talon/model/UpdateCampaignEvaluationGroup.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -395,10 +394,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCampaignGroup.java b/src/main/java/one/talon/model/UpdateCampaignGroup.java index 13b8fc7a..eeeef0b5 100644 --- a/src/main/java/one/talon/model/UpdateCampaignGroup.java +++ b/src/main/java/one/talon/model/UpdateCampaignGroup.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -252,10 +251,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCampaignTemplate.java b/src/main/java/one/talon/model/UpdateCampaignTemplate.java index 865c9b3e..84af8d30 100644 --- a/src/main/java/one/talon/model/UpdateCampaignTemplate.java +++ b/src/main/java/one/talon/model/UpdateCampaignTemplate.java @@ -28,7 +28,6 @@ import one.talon.model.CampaignTemplateParams; import one.talon.model.CodeGeneratorSettings; import one.talon.model.TemplateLimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -172,7 +171,9 @@ public enum FeaturesEnum { STRIKETHROUGH("strikethrough"), - ACHIEVEMENTS("achievements"); + ACHIEVEMENTS("achievements"), + + ADVANCED_EVENTS("advancedEvents"); private String value; @@ -845,10 +846,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCatalog.java b/src/main/java/one/talon/model/UpdateCatalog.java index 03cb9ea5..a3a638a9 100644 --- a/src/main/java/one/talon/model/UpdateCatalog.java +++ b/src/main/java/one/talon/model/UpdateCatalog.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCollection.java b/src/main/java/one/talon/model/UpdateCollection.java index 9b17ef80..555ce5e3 100644 --- a/src/main/java/one/talon/model/UpdateCollection.java +++ b/src/main/java/one/talon/model/UpdateCollection.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -192,10 +191,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCoupon.java b/src/main/java/one/talon/model/UpdateCoupon.java index c773d274..30d8f7f8 100644 --- a/src/main/java/one/talon/model/UpdateCoupon.java +++ b/src/main/java/one/talon/model/UpdateCoupon.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.LimitConfig; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -409,10 +408,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCouponBatch.java b/src/main/java/one/talon/model/UpdateCouponBatch.java index feb3a6cd..8c7faf20 100644 --- a/src/main/java/one/talon/model/UpdateCouponBatch.java +++ b/src/main/java/one/talon/model/UpdateCouponBatch.java @@ -23,7 +23,6 @@ import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -320,10 +319,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCouponsData.java b/src/main/java/one/talon/model/UpdateCouponsData.java index 20e3009c..eb5727b8 100644 --- a/src/main/java/one/talon/model/UpdateCouponsData.java +++ b/src/main/java/one/talon/model/UpdateCouponsData.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -362,10 +361,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCustomEffect.java b/src/main/java/one/talon/model/UpdateCustomEffect.java index a6f8f2c2..a0f317d2 100644 --- a/src/main/java/one/talon/model/UpdateCustomEffect.java +++ b/src/main/java/one/talon/model/UpdateCustomEffect.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -357,10 +356,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCustomerProfileV2409Response.java b/src/main/java/one/talon/model/UpdateCustomerProfileV2409Response.java index 84c52d11..050c7fdb 100644 --- a/src/main/java/one/talon/model/UpdateCustomerProfileV2409Response.java +++ b/src/main/java/one/talon/model/UpdateCustomerProfileV2409Response.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateCustomerSessionV2409Response.java b/src/main/java/one/talon/model/UpdateCustomerSessionV2409Response.java index 0bbc0fed..bafeacc3 100644 --- a/src/main/java/one/talon/model/UpdateCustomerSessionV2409Response.java +++ b/src/main/java/one/talon/model/UpdateCustomerSessionV2409Response.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateExperiment.java b/src/main/java/one/talon/model/UpdateExperiment.java index f80975e4..182fe2c6 100644 --- a/src/main/java/one/talon/model/UpdateExperiment.java +++ b/src/main/java/one/talon/model/UpdateExperiment.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.UpdateCampaign; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,6 +61,72 @@ public class UpdateExperiment { @javax.annotation.Nonnull private UpdateCampaign campaign; + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. + */ + @JsonAdapter(GoalTypeEnum.Adapter.class) + public enum GoalTypeEnum { + OTHER("other"), + + MAXIMIZE_REVENUE("maximize_revenue"), + + MAXIMIZE_ITEMS_SOLD("maximize_items_sold"), + + OPTIMIZE_DISCOUNT_EFFICIENCY("optimize_discount_efficiency"); + + private String value; + + GoalTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GoalTypeEnum fromValue(String value) { + for (GoalTypeEnum b : GoalTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GoalTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GoalTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GoalTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GoalTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GOAL_TYPE = "goalType"; + @SerializedName(SERIALIZED_NAME_GOAL_TYPE) + @javax.annotation.Nullable + private GoalTypeEnum goalType; + + public static final String SERIALIZED_NAME_GOAL_DESCRIPTION = "goalDescription"; + @SerializedName(SERIALIZED_NAME_GOAL_DESCRIPTION) + @javax.annotation.Nullable + private String goalDescription; + public UpdateExperiment() { } @@ -102,6 +167,44 @@ public void setCampaign(@javax.annotation.Nonnull UpdateCampaign campaign) { this.campaign = campaign; } + + public UpdateExperiment goalType(@javax.annotation.Nullable GoalTypeEnum goalType) { + this.goalType = goalType; + return this; + } + + /** + * The goal of the experiment. Determines which single metric is used to decide the winning variant. When set to `other`, multiple metrics are used. If omitted, the current value is preserved. + * @return goalType + */ + @javax.annotation.Nullable + public GoalTypeEnum getGoalType() { + return goalType; + } + + public void setGoalType(@javax.annotation.Nullable GoalTypeEnum goalType) { + this.goalType = goalType; + } + + + public UpdateExperiment goalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + return this; + } + + /** + * A description of the experiment goal. Provides context for the AI summary and helps it interpret the outcome of the experiment against the stated goal. If omitted, the current value is preserved. + * @return goalDescription + */ + @javax.annotation.Nullable + public String getGoalDescription() { + return goalDescription; + } + + public void setGoalDescription(@javax.annotation.Nullable String goalDescription) { + this.goalDescription = goalDescription; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -158,13 +261,15 @@ public boolean equals(Object o) { } UpdateExperiment updateExperiment = (UpdateExperiment) o; return Objects.equals(this.isVariantAssignmentExternal, updateExperiment.isVariantAssignmentExternal) && - Objects.equals(this.campaign, updateExperiment.campaign)&& + Objects.equals(this.campaign, updateExperiment.campaign) && + Objects.equals(this.goalType, updateExperiment.goalType) && + Objects.equals(this.goalDescription, updateExperiment.goalDescription)&& Objects.equals(this.additionalProperties, updateExperiment.additionalProperties); } @Override public int hashCode() { - return Objects.hash(isVariantAssignmentExternal, campaign, additionalProperties); + return Objects.hash(isVariantAssignmentExternal, campaign, goalType, goalDescription, additionalProperties); } @Override @@ -173,6 +278,8 @@ public String toString() { sb.append("class UpdateExperiment {\n"); sb.append(" isVariantAssignmentExternal: ").append(toIndentedString(isVariantAssignmentExternal)).append("\n"); sb.append(" campaign: ").append(toIndentedString(campaign)).append("\n"); + sb.append(" goalType: ").append(toIndentedString(goalType)).append("\n"); + sb.append(" goalDescription: ").append(toIndentedString(goalDescription)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -183,10 +290,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -195,7 +299,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign")); + openapiFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign", "goalType", "goalDescription")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("isVariantAssignmentExternal", "campaign")); @@ -223,6 +327,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `campaign` UpdateCampaign.validateJsonElement(jsonObj.get("campaign")); + if ((jsonObj.get("goalType") != null && !jsonObj.get("goalType").isJsonNull()) && !jsonObj.get("goalType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalType").toString())); + } + // validate the optional field `goalType` + if (jsonObj.get("goalType") != null && !jsonObj.get("goalType").isJsonNull()) { + GoalTypeEnum.validateJsonElement(jsonObj.get("goalType")); + } + if ((jsonObj.get("goalDescription") != null && !jsonObj.get("goalDescription").isJsonNull()) && !jsonObj.get("goalDescription").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `goalDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("goalDescription").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/UpdateExperimentVariant.java b/src/main/java/one/talon/model/UpdateExperimentVariant.java index 78b1581c..31621ee3 100644 --- a/src/main/java/one/talon/model/UpdateExperimentVariant.java +++ b/src/main/java/one/talon/model/UpdateExperimentVariant.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; import one.talon.model.NewRuleset; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -237,10 +236,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateExperimentVariantArray.java b/src/main/java/one/talon/model/UpdateExperimentVariantArray.java index 436160f2..2df48d63 100644 --- a/src/main/java/one/talon/model/UpdateExperimentVariantArray.java +++ b/src/main/java/one/talon/model/UpdateExperimentVariantArray.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.UpdateExperimentVariant; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -167,10 +166,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateExperimentVariantName.java b/src/main/java/one/talon/model/UpdateExperimentVariantName.java index d8338e30..2f07aa48 100644 --- a/src/main/java/one/talon/model/UpdateExperimentVariantName.java +++ b/src/main/java/one/talon/model/UpdateExperimentVariantName.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateLoyaltyCard.java b/src/main/java/one/talon/model/UpdateLoyaltyCard.java index a7a78c62..dd170983 100644 --- a/src/main/java/one/talon/model/UpdateLoyaltyCard.java +++ b/src/main/java/one/talon/model/UpdateLoyaltyCard.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateLoyaltyCardRequest.java b/src/main/java/one/talon/model/UpdateLoyaltyCardRequest.java index 27286c59..261c2174 100644 --- a/src/main/java/one/talon/model/UpdateLoyaltyCardRequest.java +++ b/src/main/java/one/talon/model/UpdateLoyaltyCardRequest.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateLoyaltyProgram.java b/src/main/java/one/talon/model/UpdateLoyaltyProgram.java index 35f8bda7..2fbbe414 100644 --- a/src/main/java/one/talon/model/UpdateLoyaltyProgram.java +++ b/src/main/java/one/talon/model/UpdateLoyaltyProgram.java @@ -26,7 +26,6 @@ import java.util.List; import one.talon.model.CodeGeneratorSettings; import one.talon.model.NewLoyaltyTier; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -784,10 +783,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateLoyaltyProgramTier.java b/src/main/java/one/talon/model/UpdateLoyaltyProgramTier.java index 6c337177..04b47d08 100644 --- a/src/main/java/one/talon/model/UpdateLoyaltyProgramTier.java +++ b/src/main/java/one/talon/model/UpdateLoyaltyProgramTier.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -211,10 +210,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdatePicklist.java b/src/main/java/one/talon/model/UpdatePicklist.java index b3e9659b..4c9d7148 100644 --- a/src/main/java/one/talon/model/UpdatePicklist.java +++ b/src/main/java/one/talon/model/UpdatePicklist.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -248,10 +247,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdatePriceType.java b/src/main/java/one/talon/model/UpdatePriceType.java index 1df3b2a5..f85b7163 100644 --- a/src/main/java/one/talon/model/UpdatePriceType.java +++ b/src/main/java/one/talon/model/UpdatePriceType.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -218,10 +217,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateReferral.java b/src/main/java/one/talon/model/UpdateReferral.java index 7d2889ad..64b03b3b 100644 --- a/src/main/java/one/talon/model/UpdateReferral.java +++ b/src/main/java/one/talon/model/UpdateReferral.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -263,10 +262,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateReferralBatch.java b/src/main/java/one/talon/model/UpdateReferralBatch.java index 3856b781..a79def19 100644 --- a/src/main/java/one/talon/model/UpdateReferralBatch.java +++ b/src/main/java/one/talon/model/UpdateReferralBatch.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -263,10 +262,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateReward.java b/src/main/java/one/talon/model/UpdateReward.java index 81acc356..90a93ea9 100644 --- a/src/main/java/one/talon/model/UpdateReward.java +++ b/src/main/java/one/talon/model/UpdateReward.java @@ -24,8 +24,8 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Binding; +import one.talon.model.RewardPointsRequired; import one.talon.model.Rule; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -122,16 +122,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @javax.annotation.Nonnull private StatusEnum status; + public static final String SERIALIZED_NAME_VISIBILITY_CONDITIONS = "visibilityConditions"; + @SerializedName(SERIALIZED_NAME_VISIBILITY_CONDITIONS) + @javax.annotation.Nullable + private Rule visibilityConditions; + public static final String SERIALIZED_NAME_RULE = "rule"; @SerializedName(SERIALIZED_NAME_RULE) @javax.annotation.Nullable - private List rule; + private Rule rule; public static final String SERIALIZED_NAME_BINDINGS = "bindings"; @SerializedName(SERIALIZED_NAME_BINDINGS) @javax.annotation.Nullable private List bindings; + public static final String SERIALIZED_NAME_POINTS_REQUIRED = "pointsRequired"; + @SerializedName(SERIALIZED_NAME_POINTS_REQUIRED) + @javax.annotation.Nullable + private List pointsRequired; + public UpdateReward() { } @@ -192,16 +202,27 @@ public void setStatus(@javax.annotation.Nonnull StatusEnum status) { } - public UpdateReward rule(@javax.annotation.Nullable List rule) { - this.rule = rule; + public UpdateReward visibilityConditions(@javax.annotation.Nullable Rule visibilityConditions) { + this.visibilityConditions = visibilityConditions; return this; } - public UpdateReward addRuleItem(Rule ruleItem) { - if (this.rule == null) { - this.rule = new ArrayList<>(); - } - this.rule.add(ruleItem); + /** + * An optional rule that manages who can see this reward. If not specified, the reward is visible to all customers. **Note:** Only the `condition` field is evaluated within this rule. The `effects` field must be an empty array, and `bindings` are not supported. + * @return visibilityConditions + */ + @javax.annotation.Nullable + public Rule getVisibilityConditions() { + return visibilityConditions; + } + + public void setVisibilityConditions(@javax.annotation.Nullable Rule visibilityConditions) { + this.visibilityConditions = visibilityConditions; + } + + + public UpdateReward rule(@javax.annotation.Nullable Rule rule) { + this.rule = rule; return this; } @@ -210,11 +231,11 @@ public UpdateReward addRuleItem(Rule ruleItem) { * @return rule */ @javax.annotation.Nullable - public List getRule() { + public Rule getRule() { return rule; } - public void setRule(@javax.annotation.Nullable List rule) { + public void setRule(@javax.annotation.Nullable Rule rule) { this.rule = rule; } @@ -245,6 +266,33 @@ public void setBindings(@javax.annotation.Nullable List bindings) { this.bindings = bindings; } + + public UpdateReward pointsRequired(@javax.annotation.Nullable List pointsRequired) { + this.pointsRequired = pointsRequired; + return this; + } + + public UpdateReward addPointsRequiredItem(RewardPointsRequired pointsRequiredItem) { + if (this.pointsRequired == null) { + this.pointsRequired = new ArrayList<>(); + } + this.pointsRequired.add(pointsRequiredItem); + return this; + } + + /** + * The loyalty points required to activate the reward. Each object defines the specific loyalty program and subledger from which points are deducted when activating the reward. **Note:** - Objects with an `id` are updated. - Objects without an `id` are created. - Existing objects omitted from the payload are deleted. + * @return pointsRequired + */ + @javax.annotation.Nullable + public List getPointsRequired() { + return pointsRequired; + } + + public void setPointsRequired(@javax.annotation.Nullable List pointsRequired) { + this.pointsRequired = pointsRequired; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -303,14 +351,16 @@ public boolean equals(Object o) { return Objects.equals(this.name, updateReward.name) && Objects.equals(this.description, updateReward.description) && Objects.equals(this.status, updateReward.status) && + Objects.equals(this.visibilityConditions, updateReward.visibilityConditions) && Objects.equals(this.rule, updateReward.rule) && - Objects.equals(this.bindings, updateReward.bindings)&& + Objects.equals(this.bindings, updateReward.bindings) && + Objects.equals(this.pointsRequired, updateReward.pointsRequired)&& Objects.equals(this.additionalProperties, updateReward.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, description, status, rule, bindings, additionalProperties); + return Objects.hash(name, description, status, visibilityConditions, rule, bindings, pointsRequired, additionalProperties); } @Override @@ -320,8 +370,10 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" visibilityConditions: ").append(toIndentedString(visibilityConditions)).append("\n"); sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); sb.append(" bindings: ").append(toIndentedString(bindings)).append("\n"); + sb.append(" pointsRequired: ").append(toIndentedString(pointsRequired)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -332,10 +384,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } @@ -344,7 +393,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("name", "description", "status", "rule", "bindings")); + openapiFields = new HashSet(Arrays.asList("name", "description", "status", "visibilityConditions", "rule", "bindings", "pointsRequired")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name", "status")); @@ -381,19 +430,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `status` StatusEnum.validateJsonElement(jsonObj.get("status")); + // validate the optional field `visibilityConditions` + if (jsonObj.get("visibilityConditions") != null && !jsonObj.get("visibilityConditions").isJsonNull()) { + Rule.validateJsonElement(jsonObj.get("visibilityConditions")); + } + // validate the optional field `rule` if (jsonObj.get("rule") != null && !jsonObj.get("rule").isJsonNull()) { - JsonArray jsonArrayrule = jsonObj.getAsJsonArray("rule"); - if (jsonArrayrule != null) { - // ensure the json data is an array - if (!jsonObj.get("rule").isJsonArray()) { - throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `rule` to be an array in the JSON string but got `%s`", jsonObj.get("rule").toString())); - } - - // validate the optional field `rule` (array) - for (int i = 0; i < jsonArrayrule.size(); i++) { - Rule.validateJsonElement(jsonArrayrule.get(i)); - }; - } + Rule.validateJsonElement(jsonObj.get("rule")); } if (jsonObj.get("bindings") != null && !jsonObj.get("bindings").isJsonNull()) { JsonArray jsonArraybindings = jsonObj.getAsJsonArray("bindings"); @@ -409,6 +452,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } + if (jsonObj.get("pointsRequired") != null && !jsonObj.get("pointsRequired").isJsonNull()) { + JsonArray jsonArraypointsRequired = jsonObj.getAsJsonArray("pointsRequired"); + if (jsonArraypointsRequired != null) { + // ensure the json data is an array + if (!jsonObj.get("pointsRequired").isJsonArray()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `pointsRequired` to be an array in the JSON string but got `%s`", jsonObj.get("pointsRequired").toString())); + } + + // validate the optional field `pointsRequired` (array) + for (int i = 0; i < jsonArraypointsRequired.size(); i++) { + RewardPointsRequired.validateJsonElement(jsonArraypointsRequired.get(i)); + }; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/one/talon/model/UpdateRole.java b/src/main/java/one/talon/model/UpdateRole.java index 20ff45d3..78158f30 100644 --- a/src/main/java/one/talon/model/UpdateRole.java +++ b/src/main/java/one/talon/model/UpdateRole.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -244,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateStore.java b/src/main/java/one/talon/model/UpdateStore.java index 076329d7..aa6cd6b4 100644 --- a/src/main/java/one/talon/model/UpdateStore.java +++ b/src/main/java/one/talon/model/UpdateStore.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UpdateSupportRequest.java b/src/main/java/one/talon/model/UpdateSupportRequest.java new file mode 100644 index 00000000..a9ec8d95 --- /dev/null +++ b/src/main/java/one/talon/model/UpdateSupportRequest.java @@ -0,0 +1,373 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import one.talon.JSON; + +/** + * UpdateSupportRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") +public class UpdateSupportRequest { + /** + * Current status of the support request. + */ + @JsonAdapter(RequestStatusEnum.Adapter.class) + public enum RequestStatusEnum { + APPROVED("approved"), + + REJECTED("rejected"); + + private String value; + + RequestStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestStatusEnum fromValue(String value) { + for (RequestStatusEnum b : RequestStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RequestStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_REQUEST_STATUS = "requestStatus"; + @SerializedName(SERIALIZED_NAME_REQUEST_STATUS) + @javax.annotation.Nonnull + private RequestStatusEnum requestStatus; + + public static final String SERIALIZED_NAME_PROCESSING_NOTE = "processingNote"; + @SerializedName(SERIALIZED_NAME_PROCESSING_NOTE) + @javax.annotation.Nullable + private String processingNote; + + public UpdateSupportRequest() { + } + + public UpdateSupportRequest requestStatus(@javax.annotation.Nonnull RequestStatusEnum requestStatus) { + this.requestStatus = requestStatus; + return this; + } + + /** + * Current status of the support request. + * @return requestStatus + */ + @javax.annotation.Nonnull + public RequestStatusEnum getRequestStatus() { + return requestStatus; + } + + public void setRequestStatus(@javax.annotation.Nonnull RequestStatusEnum requestStatus) { + this.requestStatus = requestStatus; + } + + + public UpdateSupportRequest processingNote(@javax.annotation.Nullable String processingNote) { + this.processingNote = processingNote; + return this; + } + + /** + * Notes attached by the admin when rejecting or approving a request. + * @return processingNote + */ + @javax.annotation.Nullable + public String getProcessingNote() { + return processingNote; + } + + public void setProcessingNote(@javax.annotation.Nullable String processingNote) { + this.processingNote = processingNote; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSupportRequest instance itself + */ + public UpdateSupportRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSupportRequest updateSupportRequest = (UpdateSupportRequest) o; + return Objects.equals(this.requestStatus, updateSupportRequest.requestStatus) && + Objects.equals(this.processingNote, updateSupportRequest.processingNote)&& + Objects.equals(this.additionalProperties, updateSupportRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(requestStatus, processingNote, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSupportRequest {\n"); + sb.append(" requestStatus: ").append(toIndentedString(requestStatus)).append("\n"); + sb.append(" processingNote: ").append(toIndentedString(processingNote)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("requestStatus", "processingNote")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("requestStatus")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSupportRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSupportRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in UpdateSupportRequest is not found in the empty JSON string", UpdateSupportRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSupportRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("requestStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `requestStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestStatus").toString())); + } + // validate the required field `requestStatus` + RequestStatusEnum.validateJsonElement(jsonObj.get("requestStatus")); + if ((jsonObj.get("processingNote") != null && !jsonObj.get("processingNote").isJsonNull()) && !jsonObj.get("processingNote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `processingNote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processingNote").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSupportRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSupportRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSupportRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSupportRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSupportRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSupportRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSupportRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSupportRequest + * @throws IOException if the JSON string is invalid with respect to UpdateSupportRequest + */ + public static UpdateSupportRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSupportRequest.class); + } + + /** + * Convert an instance of UpdateSupportRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/one/talon/model/UpdateUser.java b/src/main/java/one/talon/model/UpdateUser.java index 98fd5e4d..140ab86d 100644 --- a/src/main/java/one/talon/model/UpdateUser.java +++ b/src/main/java/one/talon/model/UpdateUser.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -348,10 +347,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/User.java b/src/main/java/one/talon/model/User.java index c19d5d75..30a99f7c 100644 --- a/src/main/java/one/talon/model/User.java +++ b/src/main/java/one/talon/model/User.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -637,10 +636,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/UserEntity.java b/src/main/java/one/talon/model/UserEntity.java index 5f39b023..61342521 100644 --- a/src/main/java/one/talon/model/UserEntity.java +++ b/src/main/java/one/talon/model/UserEntity.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -156,10 +155,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/ValueMap.java b/src/main/java/one/talon/model/ValueMap.java index 07730468..6ef91eec 100644 --- a/src/main/java/one/talon/model/ValueMap.java +++ b/src/main/java/one/talon/model/ValueMap.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -235,10 +234,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/Webhook.java b/src/main/java/one/talon/model/Webhook.java index 1a0cf30a..b1e796b1 100644 --- a/src/main/java/one/talon/model/Webhook.java +++ b/src/main/java/one/talon/model/Webhook.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -580,10 +579,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/WebhookAuthentication.java b/src/main/java/one/talon/model/WebhookAuthentication.java index 3bde04b8..5eefeefd 100644 --- a/src/main/java/one/talon/model/WebhookAuthentication.java +++ b/src/main/java/one/talon/model/WebhookAuthentication.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.WebhookAuthenticationWebhookRef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -428,10 +427,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/WebhookAuthenticationDataBasic.java b/src/main/java/one/talon/model/WebhookAuthenticationDataBasic.java index 2429f277..82df3e8e 100644 --- a/src/main/java/one/talon/model/WebhookAuthenticationDataBasic.java +++ b/src/main/java/one/talon/model/WebhookAuthenticationDataBasic.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -182,10 +181,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/WebhookAuthenticationDataCustom.java b/src/main/java/one/talon/model/WebhookAuthenticationDataCustom.java index 69751d31..8921ba6c 100644 --- a/src/main/java/one/talon/model/WebhookAuthenticationDataCustom.java +++ b/src/main/java/one/talon/model/WebhookAuthenticationDataCustom.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,10 +165,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/WebhookAuthenticationWebhookRef.java b/src/main/java/one/talon/model/WebhookAuthenticationWebhookRef.java index db384fe6..c7e77c7d 100644 --- a/src/main/java/one/talon/model/WebhookAuthenticationWebhookRef.java +++ b/src/main/java/one/talon/model/WebhookAuthenticationWebhookRef.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/WebhookWithOutgoingIntegrationDetails.java b/src/main/java/one/talon/model/WebhookWithOutgoingIntegrationDetails.java index a2329794..09b7198d 100644 --- a/src/main/java/one/talon/model/WebhookWithOutgoingIntegrationDetails.java +++ b/src/main/java/one/talon/model/WebhookWithOutgoingIntegrationDetails.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import one.talon.model.TemplateArgDef; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -658,10 +657,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/main/java/one/talon/model/WillAwardGiveawayEffectProps.java b/src/main/java/one/talon/model/WillAwardGiveawayEffectProps.java index 9a3eecbf..4c5908d7 100644 --- a/src/main/java/one/talon/model/WillAwardGiveawayEffectProps.java +++ b/src/main/java/one/talon/model/WillAwardGiveawayEffectProps.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import com.google.gson.JsonElement; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -208,10 +207,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/src/test/java/one/talon/api/IntegrationApiTest.java b/src/test/java/one/talon/api/IntegrationApiTest.java index e4a84f68..fa49a621 100644 --- a/src/test/java/one/talon/api/IntegrationApiTest.java +++ b/src/test/java/one/talon/api/IntegrationApiTest.java @@ -553,7 +553,7 @@ public void syncCatalogTest() throws ApiException { /** * Track event * - * Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. + * Triggers a custom event. To use this endpoint: 1. [Create a custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation. * * @throws ApiException if the Api call fails */ diff --git a/src/test/java/one/talon/api/ManagementApiTest.java b/src/test/java/one/talon/api/ManagementApiTest.java index 307655b9..716da530 100644 --- a/src/test/java/one/talon/api/ManagementApiTest.java +++ b/src/test/java/one/talon/api/ManagementApiTest.java @@ -49,6 +49,7 @@ import one.talon.model.ErrorResponse; import one.talon.model.ErrorResponseWithStatus; import one.talon.model.Experiment; +import java.io.File; import one.talon.model.GenerateCouponRejections200Response; import one.talon.model.GetAccessLogsWithoutTotalCount200Response; import one.talon.model.GetAdditionalCosts200Response; @@ -1958,9 +1959,9 @@ public void getLoyaltyCardTest() throws ApiException { } /** - * List card's transactions + * List card's transactions (Management API) * - * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + * Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. > [!note] For most use cases, especially real-time integrations, use the Integration API endpoint: > [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions). If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. * * @throws ApiException if the Api call fails */ @@ -2000,9 +2001,9 @@ public void getLoyaltyCardsTest() throws ApiException { } /** - * Get customer's loyalty balances + * Get customer's loyalty balances (Management API) * - * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + * Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: [Get customer's loyalty balances](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances). > - If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) * * @throws ApiException if the Api call fails */ @@ -2048,9 +2049,9 @@ public void getLoyaltyProgramTest() throws ApiException { } /** - * List customer's loyalty transactions + * List customer's loyalty transactions (Management API) * - * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint. + * Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] **Note** > - For most use cases, especially real-time integrations, use the Integration API endpoint: > [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). > - To retrieve all loyalty program transaction logs in a given loyalty program, use the > [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. * * @throws ApiException if the Api call fails */ @@ -2310,7 +2311,7 @@ public void getWebhooksTest() throws ApiException { @Test public void importAccountCollectionTest() throws ApiException { Long collectionId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importAccountCollection(collectionId, upFile); // TODO: test validations } @@ -2325,7 +2326,7 @@ public void importAccountCollectionTest() throws ApiException { @Test public void importAllowedListTest() throws ApiException { Long attributeId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importAllowedList(attributeId, upFile); // TODO: test validations } @@ -2340,7 +2341,7 @@ public void importAllowedListTest() throws ApiException { @Test public void importAudiencesMembershipsTest() throws ApiException { Long audienceId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importAudiencesMemberships(audienceId, upFile); // TODO: test validations } @@ -2358,7 +2359,7 @@ public void importCampaignStoreBudgetTest() throws ApiException { Long campaignId = null; String action = null; String period = null; - String upFile = null; + File upFile = null; ModelImport response = api.importCampaignStoreBudget(applicationId, campaignId, action, period, upFile); // TODO: test validations } @@ -2374,7 +2375,7 @@ public void importCampaignStoreBudgetTest() throws ApiException { public void importCampaignStoresTest() throws ApiException { Long applicationId = null; Long campaignId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importCampaignStores(applicationId, campaignId, upFile); // TODO: test validations } @@ -2391,7 +2392,7 @@ public void importCollectionTest() throws ApiException { Long applicationId = null; Long campaignId = null; Long collectionId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importCollection(applicationId, campaignId, collectionId, upFile); // TODO: test validations } @@ -2408,7 +2409,7 @@ public void importCouponsTest() throws ApiException { Long applicationId = null; Long campaignId = null; Boolean skipDuplicates = null; - String upFile = null; + File upFile = null; ModelImport response = api.importCoupons(applicationId, campaignId, skipDuplicates, upFile); // TODO: test validations } @@ -2416,14 +2417,14 @@ public void importCouponsTest() throws ApiException { /** * Import loyalty cards * - * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] We recommend limiting your file size to 500MB. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` + * Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;). > [!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds. ## Example ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ``` * * @throws ApiException if the Api call fails */ @Test public void importLoyaltyCardsTest() throws ApiException { Long loyaltyProgramId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importLoyaltyCards(loyaltyProgramId, upFile); // TODO: test validations } @@ -2431,14 +2432,14 @@ public void importLoyaltyCardsTest() throws ApiException { /** * Import customers into loyalty tiers * - * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. > [!note] We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` + * Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. > [!important] This endpoint only works with loyalty programs with advanced > tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiry date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiry date is updated. > [!note] We recommend importing customers into the tier that matches their > current balance. If a customer is imported into a lower tier, any session > or points update automatically upgrades them to the tier they qualify for. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. > [!note] We recommend limiting your file size to 500 MB. ## Example ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` * * @throws ApiException if the Api call fails */ @Test public void importLoyaltyCustomersTiersTest() throws ApiException { Long loyaltyProgramId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importLoyaltyCustomersTiers(loyaltyProgramId, upFile); // TODO: test validations } @@ -2454,7 +2455,7 @@ public void importLoyaltyCustomersTiersTest() throws ApiException { public void importLoyaltyPointsTest() throws ApiException { Long loyaltyProgramId = null; Boolean notificationsEnabled = null; - String upFile = null; + File upFile = null; ModelImport response = api.importLoyaltyPoints(loyaltyProgramId, notificationsEnabled, upFile); // TODO: test validations } @@ -2469,7 +2470,7 @@ public void importLoyaltyPointsTest() throws ApiException { @Test public void importPoolGiveawaysTest() throws ApiException { Long poolId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importPoolGiveaways(poolId, upFile); // TODO: test validations } @@ -2485,7 +2486,7 @@ public void importPoolGiveawaysTest() throws ApiException { public void importReferralsTest() throws ApiException { Long applicationId = null; Long campaignId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importReferrals(applicationId, campaignId, upFile); // TODO: test validations } diff --git a/src/test/java/one/talon/model/AchievementBaseV2Test.java b/src/test/java/one/talon/model/AchievementBaseV2Test.java index cff8393b..23090178 100644 --- a/src/test/java/one/talon/model/AchievementBaseV2Test.java +++ b/src/test/java/one/talon/model/AchievementBaseV2Test.java @@ -121,14 +121,6 @@ public void allowRollbackAfterCompletionTest() { // TODO: test allowRollbackAfterCompletion } - /** - * Test the property 'sandbox' - */ - @Test - public void sandboxTest() { - // TODO: test sandbox - } - /** * Test the property 'subscribedApplications' */ @@ -137,12 +129,4 @@ public void subscribedApplicationsTest() { // TODO: test subscribedApplications } - /** - * Test the property 'timezone' - */ - @Test - public void timezoneTest() { - // TODO: test timezone - } - } diff --git a/src/test/java/one/talon/model/AchievementV2Test.java b/src/test/java/one/talon/model/AchievementV2Test.java index 546d3bb1..cdd4b66e 100644 --- a/src/test/java/one/talon/model/AchievementV2Test.java +++ b/src/test/java/one/talon/model/AchievementV2Test.java @@ -137,14 +137,6 @@ public void allowRollbackAfterCompletionTest() { // TODO: test allowRollbackAfterCompletion } - /** - * Test the property 'sandbox' - */ - @Test - public void sandboxTest() { - // TODO: test sandbox - } - /** * Test the property 'subscribedApplications' */ @@ -153,14 +145,6 @@ public void subscribedApplicationsTest() { // TODO: test subscribedApplications } - /** - * Test the property 'timezone' - */ - @Test - public void timezoneTest() { - // TODO: test timezone - } - /** * Test the property 'userId' */ @@ -193,4 +177,20 @@ public void statusTest() { // TODO: test status } + /** + * Test the property 'sandbox' + */ + @Test + public void sandboxTest() { + // TODO: test sandbox + } + + /** + * Test the property 'timezone' + */ + @Test + public void timezoneTest() { + // TODO: test timezone + } + } diff --git a/src/test/java/one/talon/model/ApplicationEventTest.java b/src/test/java/one/talon/model/ApplicationEventTest.java index e4d3e09f..71f4b33b 100644 --- a/src/test/java/one/talon/model/ApplicationEventTest.java +++ b/src/test/java/one/talon/model/ApplicationEventTest.java @@ -90,6 +90,14 @@ public void storeIntegrationIdTest() { // TODO: test storeIntegrationId } + /** + * Test the property 'integrationId' + */ + @Test + public void integrationIdTest() { + // TODO: test integrationId + } + /** * Test the property 'sessionId' */ diff --git a/src/test/java/one/talon/model/BestPriorPriceTest.java b/src/test/java/one/talon/model/BestPriorPriceTest.java index 7b0a1f74..d26548bc 100644 --- a/src/test/java/one/talon/model/BestPriorPriceTest.java +++ b/src/test/java/one/talon/model/BestPriorPriceTest.java @@ -21,7 +21,9 @@ import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import one.talon.model.BestPriorPriceMetadata; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -64,6 +66,14 @@ public void observedAtTest() { // TODO: test observedAt } + /** + * Test the property 'contextIds' + */ + @Test + public void contextIdsTest() { + // TODO: test contextIds + } + /** * Test the property 'contextId' */ diff --git a/src/test/java/one/talon/model/CampaignEligibilityTest.java b/src/test/java/one/talon/model/CampaignEligibilityTest.java index 8236ea87..f4812af2 100644 --- a/src/test/java/one/talon/model/CampaignEligibilityTest.java +++ b/src/test/java/one/talon/model/CampaignEligibilityTest.java @@ -24,7 +24,7 @@ import java.util.Arrays; import java.util.List; import one.talon.model.CampaignEligibilityDetails; -import one.talon.model.RuleMetadata; +import one.talon.model.RuleMetadataEligibility; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -43,19 +43,19 @@ public void testCampaignEligibility() { } /** - * Test the property 'id' + * Test the property 'applicationId' */ @Test - public void idTest() { - // TODO: test id + public void applicationIdTest() { + // TODO: test applicationId } /** - * Test the property 'applicationId' + * Test the property 'id' */ @Test - public void applicationIdTest() { - // TODO: test applicationId + public void idTest() { + // TODO: test id } /** @@ -123,19 +123,19 @@ public void featuresTest() { } /** - * Test the property 'rules' + * Test the property 'eligibility' */ @Test - public void rulesTest() { - // TODO: test rules + public void eligibilityTest() { + // TODO: test eligibility } /** - * Test the property 'eligibility' + * Test the property 'rules' */ @Test - public void eligibilityTest() { - // TODO: test eligibility + public void rulesTest() { + // TODO: test rules } } diff --git a/src/test/java/one/talon/model/CatalogActionTest.java b/src/test/java/one/talon/model/CatalogActionTest.java new file mode 100644 index 00000000..138e32fb --- /dev/null +++ b/src/test/java/one/talon/model/CatalogActionTest.java @@ -0,0 +1,56 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogAction + */ +public class CatalogActionTest { + private final CatalogAction model = new CatalogAction(); + + /** + * Model tests for CatalogAction + */ + @Test + public void testCatalogAction() { + // TODO: test CatalogAction + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/src/test/java/one/talon/model/CatalogSyncRequestTest.java b/src/test/java/one/talon/model/CatalogSyncRequestTest.java index 7680c6af..4a99c880 100644 --- a/src/test/java/one/talon/model/CatalogSyncRequestTest.java +++ b/src/test/java/one/talon/model/CatalogSyncRequestTest.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import one.talon.model.CatalogAction; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/src/test/java/one/talon/model/CreateAchievementV2Test.java b/src/test/java/one/talon/model/CreateAchievementV2Test.java index 9367dc81..5b907727 100644 --- a/src/test/java/one/talon/model/CreateAchievementV2Test.java +++ b/src/test/java/one/talon/model/CreateAchievementV2Test.java @@ -122,19 +122,19 @@ public void allowRollbackAfterCompletionTest() { } /** - * Test the property 'sandbox' + * Test the property 'subscribedApplications' */ @Test - public void sandboxTest() { - // TODO: test sandbox + public void subscribedApplicationsTest() { + // TODO: test subscribedApplications } /** - * Test the property 'subscribedApplications' + * Test the property 'sandbox' */ @Test - public void subscribedApplicationsTest() { - // TODO: test subscribedApplications + public void sandboxTest() { + // TODO: test sandbox } /** diff --git a/src/test/java/one/talon/model/CustomerSessionV2Test.java b/src/test/java/one/talon/model/CustomerSessionV2Test.java index 3525f16e..e6d54b14 100644 --- a/src/test/java/one/talon/model/CustomerSessionV2Test.java +++ b/src/test/java/one/talon/model/CustomerSessionV2Test.java @@ -214,6 +214,14 @@ public void additionalCostTotalTest() { // TODO: test additionalCostTotal } + /** + * Test the property 'cartItemAdditionalCostTotal' + */ + @Test + public void cartItemAdditionalCostTotalTest() { + // TODO: test cartItemAdditionalCostTotal + } + /** * Test the property 'updated' */ diff --git a/src/test/java/one/talon/model/EventTest.java b/src/test/java/one/talon/model/EventTest.java index 505ee0b7..cb457a7c 100644 --- a/src/test/java/one/talon/model/EventTest.java +++ b/src/test/java/one/talon/model/EventTest.java @@ -98,6 +98,14 @@ public void attributesTest() { // TODO: test attributes } + /** + * Test the property 'integrationId' + */ + @Test + public void integrationIdTest() { + // TODO: test integrationId + } + /** * Test the property 'sessionId' */ diff --git a/src/test/java/one/talon/model/EventV3ConnectionsTest.java b/src/test/java/one/talon/model/EventV3ConnectionsTest.java new file mode 100644 index 00000000..400a7abe --- /dev/null +++ b/src/test/java/one/talon/model/EventV3ConnectionsTest.java @@ -0,0 +1,48 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EventV3Connections + */ +public class EventV3ConnectionsTest { + private final EventV3Connections model = new EventV3Connections(); + + /** + * Model tests for EventV3Connections + */ + @Test + public void testEventV3Connections() { + // TODO: test EventV3Connections + } + + /** + * Test the property 'connectedSessionId' + */ + @Test + public void connectedSessionIdTest() { + // TODO: test connectedSessionId + } + +} diff --git a/src/test/java/one/talon/model/EventV3EntityTest.java b/src/test/java/one/talon/model/EventV3EntityTest.java new file mode 100644 index 00000000..15b66650 --- /dev/null +++ b/src/test/java/one/talon/model/EventV3EntityTest.java @@ -0,0 +1,48 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EventV3Entity + */ +public class EventV3EntityTest { + private final EventV3Entity model = new EventV3Entity(); + + /** + * Model tests for EventV3Entity + */ + @Test + public void testEventV3Entity() { + // TODO: test EventV3Entity + } + + /** + * Test the property 'integrationId' + */ + @Test + public void integrationIdTest() { + // TODO: test integrationId + } + +} diff --git a/src/test/java/one/talon/model/EventV3RequestEntityTest.java b/src/test/java/one/talon/model/EventV3RequestEntityTest.java new file mode 100644 index 00000000..1c842ca3 --- /dev/null +++ b/src/test/java/one/talon/model/EventV3RequestEntityTest.java @@ -0,0 +1,98 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EventV3RequestEntity + */ +public class EventV3RequestEntityTest { + private final EventV3RequestEntity model = new EventV3RequestEntity(); + + /** + * Model tests for EventV3RequestEntity + */ + @Test + public void testEventV3RequestEntity() { + // TODO: test EventV3RequestEntity + } + + /** + * Test the property 'profileId' + */ + @Test + public void profileIdTest() { + // TODO: test profileId + } + + /** + * Test the property 'storeIntegrationId' + */ + @Test + public void storeIntegrationIdTest() { + // TODO: test storeIntegrationId + } + + /** + * Test the property 'evaluableCampaignIds' + */ + @Test + public void evaluableCampaignIdsTest() { + // TODO: test evaluableCampaignIds + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + + /** + * Test the property 'integrationId' + */ + @Test + public void integrationIdTest() { + // TODO: test integrationId + } + + /** + * Test the property 'connectedSessionId' + */ + @Test + public void connectedSessionIdTest() { + // TODO: test connectedSessionId + } + +} diff --git a/src/test/java/one/talon/model/EventV3Test.java b/src/test/java/one/talon/model/EventV3Test.java index 7e9a6eea..65d57895 100644 --- a/src/test/java/one/talon/model/EventV3Test.java +++ b/src/test/java/one/talon/model/EventV3Test.java @@ -19,6 +19,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -40,35 +41,51 @@ public void testEventV3() { } /** - * Test the property 'profileId' + * Test the property 'connectedSessionId' */ @Test - public void profileIdTest() { - // TODO: test profileId + public void connectedSessionIdTest() { + // TODO: test connectedSessionId } /** - * Test the property 'storeIntegrationId' + * Test the property 'id' */ @Test - public void storeIntegrationIdTest() { - // TODO: test storeIntegrationId + public void idTest() { + // TODO: test id } /** - * Test the property 'evaluableCampaignIds' + * Test the property 'created' */ @Test - public void evaluableCampaignIdsTest() { - // TODO: test evaluableCampaignIds + public void createdTest() { + // TODO: test created } /** - * Test the property 'integrationId' + * Test the property 'applicationId' */ @Test - public void integrationIdTest() { - // TODO: test integrationId + public void applicationIdTest() { + // TODO: test applicationId + } + + /** + * Test the property 'profileId' + */ + @Test + public void profileIdTest() { + // TODO: test profileId + } + + /** + * Test the property 'storeIntegrationId' + */ + @Test + public void storeIntegrationIdTest() { + // TODO: test storeIntegrationId } /** @@ -88,19 +105,19 @@ public void attributesTest() { } /** - * Test the property 'connectedSessionID' + * Test the property 'integrationId' */ @Test - public void connectedSessionIDTest() { - // TODO: test connectedSessionID + public void integrationIdTest() { + // TODO: test integrationId } /** - * Test the property 'previousEventID' + * Test the property 'effects' */ @Test - public void previousEventIDTest() { - // TODO: test previousEventID + public void effectsTest() { + // TODO: test effects } } diff --git a/src/test/java/one/talon/model/ExperimentCopyExperimentTest.java b/src/test/java/one/talon/model/ExperimentCopyExperimentTest.java index d24521fa..945b10bb 100644 --- a/src/test/java/one/talon/model/ExperimentCopyExperimentTest.java +++ b/src/test/java/one/talon/model/ExperimentCopyExperimentTest.java @@ -54,4 +54,20 @@ public void campaignTest() { // TODO: test campaign } + /** + * Test the property 'goalType' + */ + @Test + public void goalTypeTest() { + // TODO: test goalType + } + + /** + * Test the property 'goalDescription' + */ + @Test + public void goalDescriptionTest() { + // TODO: test goalDescription + } + } diff --git a/src/test/java/one/talon/model/ExperimentTest.java b/src/test/java/one/talon/model/ExperimentTest.java index cff37e73..ae9f606f 100644 --- a/src/test/java/one/talon/model/ExperimentTest.java +++ b/src/test/java/one/talon/model/ExperimentTest.java @@ -106,6 +106,22 @@ public void variantsTest() { // TODO: test variants } + /** + * Test the property 'goalType' + */ + @Test + public void goalTypeTest() { + // TODO: test goalType + } + + /** + * Test the property 'goalDescription' + */ + @Test + public void goalDescriptionTest() { + // TODO: test goalDescription + } + /** * Test the property 'deletedat' */ diff --git a/src/test/java/one/talon/model/FeatureFlagUpdateTest.java b/src/test/java/one/talon/model/FeatureFlagUpdateTest.java new file mode 100644 index 00000000..1faafaa1 --- /dev/null +++ b/src/test/java/one/talon/model/FeatureFlagUpdateTest.java @@ -0,0 +1,56 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FeatureFlagUpdate + */ +public class FeatureFlagUpdateTest { + private final FeatureFlagUpdate model = new FeatureFlagUpdate(); + + /** + * Model tests for FeatureFlagUpdate + */ + @Test + public void testFeatureFlagUpdate() { + // TODO: test FeatureFlagUpdate + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/src/test/java/one/talon/model/HistoryTest.java b/src/test/java/one/talon/model/HistoryTest.java index 315aa536..f4240337 100644 --- a/src/test/java/one/talon/model/HistoryTest.java +++ b/src/test/java/one/talon/model/HistoryTest.java @@ -21,7 +21,9 @@ import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import one.talon.model.BestPriorPriceMetadata; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -56,6 +58,14 @@ public void observedAtTest() { // TODO: test observedAt } + /** + * Test the property 'contextIds' + */ + @Test + public void contextIdsTest() { + // TODO: test contextIds + } + /** * Test the property 'contextId' */ diff --git a/src/test/java/one/talon/model/IntegrationCampaignBaseTest.java b/src/test/java/one/talon/model/IntegrationCampaignBaseTest.java new file mode 100644 index 00000000..0352af01 --- /dev/null +++ b/src/test/java/one/talon/model/IntegrationCampaignBaseTest.java @@ -0,0 +1,123 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for IntegrationCampaignBase + */ +public class IntegrationCampaignBaseTest { + private final IntegrationCampaignBase model = new IntegrationCampaignBase(); + + /** + * Model tests for IntegrationCampaignBase + */ + @Test + public void testIntegrationCampaignBase() { + // TODO: test IntegrationCampaignBase + } + + /** + * Test the property 'applicationId' + */ + @Test + public void applicationIdTest() { + // TODO: test applicationId + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'startTime' + */ + @Test + public void startTimeTest() { + // TODO: test startTime + } + + /** + * Test the property 'endTime' + */ + @Test + public void endTimeTest() { + // TODO: test endTime + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + + /** + * Test the property 'state' + */ + @Test + public void stateTest() { + // TODO: test state + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'features' + */ + @Test + public void featuresTest() { + // TODO: test features + } + +} diff --git a/src/test/java/one/talon/model/IntegrationEventV3RequestTest.java b/src/test/java/one/talon/model/IntegrationEventV3RequestTest.java index 2bbeaacb..9f9cec11 100644 --- a/src/test/java/one/talon/model/IntegrationEventV3RequestTest.java +++ b/src/test/java/one/talon/model/IntegrationEventV3RequestTest.java @@ -63,14 +63,6 @@ public void evaluableCampaignIdsTest() { // TODO: test evaluableCampaignIds } - /** - * Test the property 'integrationId' - */ - @Test - public void integrationIdTest() { - // TODO: test integrationId - } - /** * Test the property 'type' */ @@ -88,19 +80,19 @@ public void attributesTest() { } /** - * Test the property 'connectedSessionID' + * Test the property 'integrationId' */ @Test - public void connectedSessionIDTest() { - // TODO: test connectedSessionID + public void integrationIdTest() { + // TODO: test integrationId } /** - * Test the property 'previousEventID' + * Test the property 'connectedSessionId' */ @Test - public void previousEventIDTest() { - // TODO: test previousEventID + public void connectedSessionIdTest() { + // TODO: test connectedSessionId } /** diff --git a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotificationTest.java b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotificationTest.java index ff2427e7..942e0b27 100644 --- a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotificationTest.java +++ b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedNotificationTest.java @@ -57,6 +57,14 @@ public void loyaltyProgramIDTest() { // TODO: test loyaltyProgramID } + /** + * Test the property 'loyaltyProgramName' + */ + @Test + public void loyaltyProgramNameTest() { + // TODO: test loyaltyProgramName + } + /** * Test the property 'subledgerID' */ @@ -73,6 +81,14 @@ public void sourceOfEventTest() { // TODO: test sourceOfEvent } + /** + * Test the property 'currentTier' + */ + @Test + public void currentTierTest() { + // TODO: test currentTier + } + /** * Test the property 'employeeName' */ @@ -113,14 +129,6 @@ public void publishedAtTest() { // TODO: test publishedAt } - /** - * Test the property 'currentTier' - */ - @Test - public void currentTierTest() { - // TODO: test currentTier - } - /** * Test the property 'oldTier' */ diff --git a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationTest.java b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationTest.java index a08315e9..3a160c48 100644 --- a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationTest.java +++ b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedPointsChangedNotificationTest.java @@ -57,6 +57,14 @@ public void loyaltyProgramIDTest() { // TODO: test loyaltyProgramID } + /** + * Test the property 'loyaltyProgramName' + */ + @Test + public void loyaltyProgramNameTest() { + // TODO: test loyaltyProgramName + } + /** * Test the property 'subledgerID' */ @@ -73,6 +81,14 @@ public void sourceOfEventTest() { // TODO: test sourceOfEvent } + /** + * Test the property 'currentTier' + */ + @Test + public void currentTierTest() { + // TODO: test currentTier + } + /** * Test the property 'employeeName' */ diff --git a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotificationTest.java b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotificationTest.java index f4b1c617..3bf72ed9 100644 --- a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotificationTest.java +++ b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierDowngradeNotificationTest.java @@ -54,6 +54,14 @@ public void loyaltyProgramIDTest() { // TODO: test loyaltyProgramID } + /** + * Test the property 'loyaltyProgramName' + */ + @Test + public void loyaltyProgramNameTest() { + // TODO: test loyaltyProgramName + } + /** * Test the property 'subledgerID' */ diff --git a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificationTest.java b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificationTest.java index e28ae81d..7e00aeb9 100644 --- a/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificationTest.java +++ b/src/test/java/one/talon/model/IntegrationHubEventPayloadLoyaltyProfileBasedTierUpgradeNotificationTest.java @@ -54,6 +54,14 @@ public void loyaltyProgramIDTest() { // TODO: test loyaltyProgramID } + /** + * Test the property 'loyaltyProgramName' + */ + @Test + public void loyaltyProgramNameTest() { + // TODO: test loyaltyProgramName + } + /** * Test the property 'subledgerID' */ diff --git a/src/test/java/one/talon/model/IntegrationHubEventRecordTest.java b/src/test/java/one/talon/model/IntegrationHubEventRecordTest.java index 4649ffb5..4afaaae5 100644 --- a/src/test/java/one/talon/model/IntegrationHubEventRecordTest.java +++ b/src/test/java/one/talon/model/IntegrationHubEventRecordTest.java @@ -86,6 +86,14 @@ public void processedAtTest() { // TODO: test processedAt } + /** + * Test the property 'deliveredAt' + */ + @Test + public void deliveredAtTest() { + // TODO: test deliveredAt + } + /** * Test the property 'processAfter' */ diff --git a/src/test/java/one/talon/model/IntegrationHubEventStatusUpdateTest.java b/src/test/java/one/talon/model/IntegrationHubEventStatusUpdateTest.java new file mode 100644 index 00000000..77e829de --- /dev/null +++ b/src/test/java/one/talon/model/IntegrationHubEventStatusUpdateTest.java @@ -0,0 +1,56 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for IntegrationHubEventStatusUpdate + */ +public class IntegrationHubEventStatusUpdateTest { + private final IntegrationHubEventStatusUpdate model = new IntegrationHubEventStatusUpdate(); + + /** + * Model tests for IntegrationHubEventStatusUpdate + */ + @Test + public void testIntegrationHubEventStatusUpdate() { + // TODO: test IntegrationHubEventStatusUpdate + } + + /** + * Test the property 'eventId' + */ + @Test + public void eventIdTest() { + // TODO: test eventId + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/src/test/java/one/talon/model/NewEventV3EntityTest.java b/src/test/java/one/talon/model/NewEventV3EntityTest.java new file mode 100644 index 00000000..8bb19892 --- /dev/null +++ b/src/test/java/one/talon/model/NewEventV3EntityTest.java @@ -0,0 +1,48 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEventV3Entity + */ +public class NewEventV3EntityTest { + private final NewEventV3Entity model = new NewEventV3Entity(); + + /** + * Model tests for NewEventV3Entity + */ + @Test + public void testNewEventV3Entity() { + // TODO: test NewEventV3Entity + } + + /** + * Test the property 'integrationId' + */ + @Test + public void integrationIdTest() { + // TODO: test integrationId + } + +} diff --git a/src/test/java/one/talon/model/NewExperimentTest.java b/src/test/java/one/talon/model/NewExperimentTest.java index 98da59b4..08ac5655 100644 --- a/src/test/java/one/talon/model/NewExperimentTest.java +++ b/src/test/java/one/talon/model/NewExperimentTest.java @@ -54,4 +54,20 @@ public void campaignTest() { // TODO: test campaign } + /** + * Test the property 'goalType' + */ + @Test + public void goalTypeTest() { + // TODO: test goalType + } + + /** + * Test the property 'goalDescription' + */ + @Test + public void goalDescriptionTest() { + // TODO: test goalDescription + } + } diff --git a/src/test/java/one/talon/model/NewRewardTest.java b/src/test/java/one/talon/model/NewRewardTest.java index 2f133ef1..34dcfaab 100644 --- a/src/test/java/one/talon/model/NewRewardTest.java +++ b/src/test/java/one/talon/model/NewRewardTest.java @@ -22,8 +22,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import one.talon.model.Binding; -import one.talon.model.Rule; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -81,20 +79,4 @@ public void sandboxTest() { // TODO: test sandbox } - /** - * Test the property 'rule' - */ - @Test - public void ruleTest() { - // TODO: test rule - } - - /** - * Test the property 'bindings' - */ - @Test - public void bindingsTest() { - // TODO: test bindings - } - } diff --git a/src/test/java/one/talon/model/NewRiskNotificationTest.java b/src/test/java/one/talon/model/NewRiskNotificationTest.java new file mode 100644 index 00000000..9b09510f --- /dev/null +++ b/src/test/java/one/talon/model/NewRiskNotificationTest.java @@ -0,0 +1,64 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewRiskNotification + */ +public class NewRiskNotificationTest { + private final NewRiskNotification model = new NewRiskNotification(); + + /** + * Model tests for NewRiskNotification + */ + @Test + public void testNewRiskNotification() { + // TODO: test NewRiskNotification + } + + /** + * Test the property 'entity' + */ + @Test + public void entityTest() { + // TODO: test entity + } + + /** + * Test the property 'activity' + */ + @Test + public void activityTest() { + // TODO: test activity + } + + /** + * Test the property 'timeFrame' + */ + @Test + public void timeFrameTest() { + // TODO: test timeFrame + } + +} diff --git a/src/test/java/one/talon/model/RewardPointsRequiredTest.java b/src/test/java/one/talon/model/RewardPointsRequiredTest.java new file mode 100644 index 00000000..8efba261 --- /dev/null +++ b/src/test/java/one/talon/model/RewardPointsRequiredTest.java @@ -0,0 +1,73 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RewardPointsRequired + */ +public class RewardPointsRequiredTest { + private final RewardPointsRequired model = new RewardPointsRequired(); + + /** + * Model tests for RewardPointsRequired + */ + @Test + public void testRewardPointsRequired() { + // TODO: test RewardPointsRequired + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'loyaltyProgramId' + */ + @Test + public void loyaltyProgramIdTest() { + // TODO: test loyaltyProgramId + } + + /** + * Test the property 'subledgerId' + */ + @Test + public void subledgerIdTest() { + // TODO: test subledgerId + } + +} diff --git a/src/test/java/one/talon/model/RewardTest.java b/src/test/java/one/talon/model/RewardTest.java index ff04e85d..d28ec39c 100644 --- a/src/test/java/one/talon/model/RewardTest.java +++ b/src/test/java/one/talon/model/RewardTest.java @@ -24,6 +24,7 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Binding; +import one.talon.model.RewardPointsRequired; import one.talon.model.Rule; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -106,6 +107,14 @@ public void sandboxTest() { // TODO: test sandbox } + /** + * Test the property 'visibilityConditions' + */ + @Test + public void visibilityConditionsTest() { + // TODO: test visibilityConditions + } + /** * Test the property 'rule' */ @@ -122,6 +131,14 @@ public void bindingsTest() { // TODO: test bindings } + /** + * Test the property 'modified' + */ + @Test + public void modifiedTest() { + // TODO: test modified + } + /** * Test the property 'status' */ @@ -130,4 +147,12 @@ public void statusTest() { // TODO: test status } + /** + * Test the property 'pointsRequired' + */ + @Test + public void pointsRequiredTest() { + // TODO: test pointsRequired + } + } diff --git a/src/test/java/one/talon/model/RiskNotificationTest.java b/src/test/java/one/talon/model/RiskNotificationTest.java new file mode 100644 index 00000000..3c2e06f5 --- /dev/null +++ b/src/test/java/one/talon/model/RiskNotificationTest.java @@ -0,0 +1,97 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RiskNotification + */ +public class RiskNotificationTest { + private final RiskNotification model = new RiskNotification(); + + /** + * Model tests for RiskNotification + */ + @Test + public void testRiskNotification() { + // TODO: test RiskNotification + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'created' + */ + @Test + public void createdTest() { + // TODO: test created + } + + /** + * Test the property 'entity' + */ + @Test + public void entityTest() { + // TODO: test entity + } + + /** + * Test the property 'activity' + */ + @Test + public void activityTest() { + // TODO: test activity + } + + /** + * Test the property 'timeFrame' + */ + @Test + public void timeFrameTest() { + // TODO: test timeFrame + } + + /** + * Test the property 'active' + */ + @Test + public void activeTest() { + // TODO: test active + } + + /** + * Test the property 'modified' + */ + @Test + public void modifiedTest() { + // TODO: test modified + } + +} diff --git a/src/test/java/one/talon/model/RuleMetadataEligibilityTest.java b/src/test/java/one/talon/model/RuleMetadataEligibilityTest.java new file mode 100644 index 00000000..70daedf6 --- /dev/null +++ b/src/test/java/one/talon/model/RuleMetadataEligibilityTest.java @@ -0,0 +1,83 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import one.talon.model.RuleEligibility; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RuleMetadataEligibility + */ +public class RuleMetadataEligibilityTest { + private final RuleMetadataEligibility model = new RuleMetadataEligibility(); + + /** + * Model tests for RuleMetadataEligibility + */ + @Test + public void testRuleMetadataEligibility() { + // TODO: test RuleMetadataEligibility + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'displayName' + */ + @Test + public void displayNameTest() { + // TODO: test displayName + } + + /** + * Test the property 'displayDescription' + */ + @Test + public void displayDescriptionTest() { + // TODO: test displayDescription + } + + /** + * Test the property 'relatedData' + */ + @Test + public void relatedDataTest() { + // TODO: test relatedData + } + + /** + * Test the property 'eligibility' + */ + @Test + public void eligibilityTest() { + // TODO: test eligibility + } + +} diff --git a/src/test/java/one/talon/model/RuleMetadataTest.java b/src/test/java/one/talon/model/RuleMetadataTest.java index e502d29d..8fb9187d 100644 --- a/src/test/java/one/talon/model/RuleMetadataTest.java +++ b/src/test/java/one/talon/model/RuleMetadataTest.java @@ -19,10 +19,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; -import one.talon.model.RuleEligibility; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -72,12 +69,4 @@ public void relatedDataTest() { // TODO: test relatedData } - /** - * Test the property 'eligibility' - */ - @Test - public void eligibilityTest() { - // TODO: test eligibility - } - } diff --git a/src/test/java/one/talon/model/SupportRequestInputTest.java b/src/test/java/one/talon/model/SupportRequestInputTest.java new file mode 100644 index 00000000..df6caff6 --- /dev/null +++ b/src/test/java/one/talon/model/SupportRequestInputTest.java @@ -0,0 +1,104 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SupportRequestInput + */ +public class SupportRequestInputTest { + private final SupportRequestInput model = new SupportRequestInput(); + + /** + * Model tests for SupportRequestInput + */ + @Test + public void testSupportRequestInput() { + // TODO: test SupportRequestInput + } + + /** + * Test the property 'applicationId' + */ + @Test + public void applicationIdTest() { + // TODO: test applicationId + } + + /** + * Test the property 'campaignId' + */ + @Test + public void campaignIdTest() { + // TODO: test campaignId + } + + /** + * Test the property 'loyaltyProgramId' + */ + @Test + public void loyaltyProgramIdTest() { + // TODO: test loyaltyProgramId + } + + /** + * Test the property 'subledgerId' + */ + @Test + public void subledgerIdTest() { + // TODO: test subledgerId + } + + /** + * Test the property 'customerProfileId' + */ + @Test + public void customerProfileIdTest() { + // TODO: test customerProfileId + } + + /** + * Test the property 'requestType' + */ + @Test + public void requestTypeTest() { + // TODO: test requestType + } + + /** + * Test the property 'requestValue' + */ + @Test + public void requestValueTest() { + // TODO: test requestValue + } + + /** + * Test the property 'requestNote' + */ + @Test + public void requestNoteTest() { + // TODO: test requestNote + } + +} diff --git a/src/test/java/one/talon/model/SupportRequestTest.java b/src/test/java/one/talon/model/SupportRequestTest.java new file mode 100644 index 00000000..d104f5c7 --- /dev/null +++ b/src/test/java/one/talon/model/SupportRequestTest.java @@ -0,0 +1,161 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SupportRequest + */ +public class SupportRequestTest { + private final SupportRequest model = new SupportRequest(); + + /** + * Model tests for SupportRequest + */ + @Test + public void testSupportRequest() { + // TODO: test SupportRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'applicationId' + */ + @Test + public void applicationIdTest() { + // TODO: test applicationId + } + + /** + * Test the property 'campaignId' + */ + @Test + public void campaignIdTest() { + // TODO: test campaignId + } + + /** + * Test the property 'loyaltyProgramId' + */ + @Test + public void loyaltyProgramIdTest() { + // TODO: test loyaltyProgramId + } + + /** + * Test the property 'subledgerId' + */ + @Test + public void subledgerIdTest() { + // TODO: test subledgerId + } + + /** + * Test the property 'createdByUser' + */ + @Test + public void createdByUserTest() { + // TODO: test createdByUser + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'customerProfileId' + */ + @Test + public void customerProfileIdTest() { + // TODO: test customerProfileId + } + + /** + * Test the property 'requestType' + */ + @Test + public void requestTypeTest() { + // TODO: test requestType + } + + /** + * Test the property 'requestValue' + */ + @Test + public void requestValueTest() { + // TODO: test requestValue + } + + /** + * Test the property 'requestNote' + */ + @Test + public void requestNoteTest() { + // TODO: test requestNote + } + + /** + * Test the property 'requestStatus' + */ + @Test + public void requestStatusTest() { + // TODO: test requestStatus + } + + /** + * Test the property 'processedAt' + */ + @Test + public void processedAtTest() { + // TODO: test processedAt + } + + /** + * Test the property 'processingNote' + */ + @Test + public void processingNoteTest() { + // TODO: test processingNote + } + + /** + * Test the property 'processedByUser' + */ + @Test + public void processedByUserTest() { + // TODO: test processedByUser + } + +} diff --git a/src/test/java/one/talon/model/UpdateAchievementV2Test.java b/src/test/java/one/talon/model/UpdateAchievementV2Test.java index 7d8147e7..bd2762f4 100644 --- a/src/test/java/one/talon/model/UpdateAchievementV2Test.java +++ b/src/test/java/one/talon/model/UpdateAchievementV2Test.java @@ -121,14 +121,6 @@ public void allowRollbackAfterCompletionTest() { // TODO: test allowRollbackAfterCompletion } - /** - * Test the property 'sandbox' - */ - @Test - public void sandboxTest() { - // TODO: test sandbox - } - /** * Test the property 'subscribedApplications' */ @@ -137,12 +129,4 @@ public void subscribedApplicationsTest() { // TODO: test subscribedApplications } - /** - * Test the property 'timezone' - */ - @Test - public void timezoneTest() { - // TODO: test timezone - } - } diff --git a/src/test/java/one/talon/model/UpdateExperimentTest.java b/src/test/java/one/talon/model/UpdateExperimentTest.java index 25ab1103..6ff12924 100644 --- a/src/test/java/one/talon/model/UpdateExperimentTest.java +++ b/src/test/java/one/talon/model/UpdateExperimentTest.java @@ -54,4 +54,20 @@ public void campaignTest() { // TODO: test campaign } + /** + * Test the property 'goalType' + */ + @Test + public void goalTypeTest() { + // TODO: test goalType + } + + /** + * Test the property 'goalDescription' + */ + @Test + public void goalDescriptionTest() { + // TODO: test goalDescription + } + } diff --git a/src/test/java/one/talon/model/UpdateRewardTest.java b/src/test/java/one/talon/model/UpdateRewardTest.java index 5d3f317a..bee9283b 100644 --- a/src/test/java/one/talon/model/UpdateRewardTest.java +++ b/src/test/java/one/talon/model/UpdateRewardTest.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.List; import one.talon.model.Binding; +import one.talon.model.RewardPointsRequired; import one.talon.model.Rule; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -65,6 +66,14 @@ public void statusTest() { // TODO: test status } + /** + * Test the property 'visibilityConditions' + */ + @Test + public void visibilityConditionsTest() { + // TODO: test visibilityConditions + } + /** * Test the property 'rule' */ @@ -81,4 +90,12 @@ public void bindingsTest() { // TODO: test bindings } + /** + * Test the property 'pointsRequired' + */ + @Test + public void pointsRequiredTest() { + // TODO: test pointsRequired + } + } diff --git a/src/test/java/one/talon/model/UpdateSupportRequestTest.java b/src/test/java/one/talon/model/UpdateSupportRequestTest.java new file mode 100644 index 00000000..4baeddb6 --- /dev/null +++ b/src/test/java/one/talon/model/UpdateSupportRequestTest.java @@ -0,0 +1,56 @@ +/* + * Talon.One API + * Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) to integrate with our platform. - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`. + * + * The version of the OpenAPI document: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package one.talon.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateSupportRequest + */ +public class UpdateSupportRequestTest { + private final UpdateSupportRequest model = new UpdateSupportRequest(); + + /** + * Model tests for UpdateSupportRequest + */ + @Test + public void testUpdateSupportRequest() { + // TODO: test UpdateSupportRequest + } + + /** + * Test the property 'requestStatus' + */ + @Test + public void requestStatusTest() { + // TODO: test requestStatus + } + + /** + * Test the property 'processingNote' + */ + @Test + public void processingNoteTest() { + // TODO: test processingNote + } + +}