diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 618ff789..88ac3e5d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -277,6 +277,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 +348,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 @@ -509,6 +511,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 +580,7 @@ docs/RevisionActivation.md docs/RevisionActivationRequest.md docs/RevisionVersion.md docs/Reward.md +docs/RiskNotification.md docs/Role.md docs/RoleAssign.md docs/RoleMembership.md @@ -599,6 +603,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 @@ -1011,6 +1016,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 +1086,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 @@ -1241,6 +1248,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 +1317,7 @@ 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/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 +1340,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 @@ -1716,6 +1726,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 +1795,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 @@ -1946,6 +1958,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 @@ -2014,6 +2027,7 @@ 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/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 +2048,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 diff --git a/README.md b/README.md index 3347f606..7ce0f207 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.10.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.10.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 @@ -695,6 +695,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 +765,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) @@ -925,6 +927,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 +996,7 @@ Class | Method | HTTP request | Description - [RevisionActivationRequest](docs/RevisionActivationRequest.md) - [RevisionVersion](docs/RevisionVersion.md) - [Reward](docs/Reward.md) +- [RiskNotification](docs/RiskNotification.md) - [Role](docs/Role.md) - [RoleAssign](docs/RoleAssign.md) - [RoleMembership](docs/RoleMembership.md) @@ -1015,6 +1019,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) diff --git a/api/openapi.yaml b/api/openapi.yaml index 53b8abfb..0ae4a390 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -2447,8 +2447,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 +2565,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 +2944,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 +3113,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: @@ -7217,8 +7221,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 +7354,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: @@ -14216,7 +14226,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 @@ -17628,128 +17639,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 +17670,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 +17704,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 +17745,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 +17882,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 @@ -20927,6 +20910,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: @@ -25894,11 +25914,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 +25949,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: {} @@ -28064,14 +28086,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 +28641,24 @@ components: type: boolean campaign: $ref: "#/components/schemas/NewCampaign" + 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 required: - campaign + - goalType - isVariantAssignmentExternal ExperimentListResultsRequest: properties: @@ -28721,6 +28778,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. + 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 required: - campaign - isVariantAssignmentExternal @@ -34098,6 +34170,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 +34467,7 @@ components: format: int64 type: integer attributes: - $ref: "#/components/schemas/IntegrationCampaign_allOf_attributes" + $ref: "#/components/schemas/IntegrationCampaignBase_allOf_attributes" required: - applicationCount - billingEmail @@ -37054,21 +37188,6 @@ 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 @@ -37080,6 +37199,39 @@ components: - $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: @@ -37107,16 +37259,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 @@ -38843,25 +39003,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 +39027,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 +41045,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 +41568,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 +42321,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: @@ -43980,7 +44118,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: diff --git a/build.gradle b/build.gradle index 8f33dc4b..0f580566 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.10.0' buildscript { repositories { diff --git a/build.sbt b/build.sbt index dadf7735..7ddfd88d 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.10.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), 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/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/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/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/ManagementApi.md b/docs/ManagementApi.md index 81ad0e12..b844fee0 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 @@ -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 @@ -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/NewExperiment.md b/docs/NewExperiment.md index fbd12b7b..e17c491c 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" | +| OPTIMIZE_DISCOUNT_EFFICIENCY | "optimize_discount_efficiency" | +| MAXIMIZE_ITEMS_SOLD | "maximize_items_sold" | 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/Reward.md b/docs/Reward.md index 3c357c2a..251e5dd6 100644 --- a/docs/Reward.md +++ b/docs/Reward.md @@ -15,8 +15,10 @@ |**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. | | 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/UpdateExperiment.md b/docs/UpdateExperiment.md index 2bf215f8..47fca6a9 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. | [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. | [optional] | + + + +## 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/UpdateReward.md b/docs/UpdateReward.md index a8d85bdf..6239c936 100644 --- a/docs/UpdateReward.md +++ b/docs/UpdateReward.md @@ -10,7 +10,8 @@ |**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] | diff --git a/pom.xml b/pom.xml index 500ce8a3..3c436ef3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ talon-one-client jar talon-one-client - 26.09.0 + 26.10.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..00db3820 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.10.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..7fa20d01 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.10.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..151ad803 100644 --- a/src/main/java/one/talon/JSON.java +++ b/src/main/java/one/talon/JSON.java @@ -361,6 +361,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 +431,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()); @@ -591,6 +593,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 +662,7 @@ 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.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 +685,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()); diff --git a/src/main/java/one/talon/api/ManagementApi.java b/src/main/java/one/talon/api/ManagementApi.java index da36dbb3..62385da0 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)"); @@ -20832,7 +20833,7 @@ 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 ``` * @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,7 +20845,7 @@ 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(); } @@ -20853,7 +20854,7 @@ public ModelImport importLoyaltyCards(@javax.annotation.Nonnull Long loyaltyProg * 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 ``` * @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); @@ -20875,7 +20876,7 @@ 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 ``` * @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)"); @@ -20977,7 +20978,7 @@ 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 ``` * @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,7 +20991,7 @@ 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(); } @@ -20999,7 +21000,7 @@ public ModelImport importLoyaltyCustomersTiers(@javax.annotation.Nonnull Long lo * 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 ``` * @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); @@ -21022,7 +21023,7 @@ 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 ``` * @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/CampaignEligibility.java b/src/main/java/one/talon/model/CampaignEligibility.java index bbce466e..bbd60234 100644 --- a/src/main/java/one/talon/model/CampaignEligibility.java +++ b/src/main/java/one/talon/model/CampaignEligibility.java @@ -25,7 +25,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 com.google.gson.JsonElement; import com.google.gson.Gson; @@ -56,16 +56,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 +216,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 +435,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 +543,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 +553,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 +577,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(); @@ -601,10 +601,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 +650,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 +660,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/Experiment.java b/src/main/java/one/talon/model/Experiment.java index 6b97fc60..9d748dd5 100644 --- a/src/main/java/one/talon/model/Experiment.java +++ b/src/main/java/one/talon/model/Experiment.java @@ -150,6 +150,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 +384,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 +503,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 +526,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("}"); @@ -443,10 +551,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 +600,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/FeatureFlagUpdate.java b/src/main/java/one/talon/model/FeatureFlagUpdate.java new file mode 100644 index 00000000..94ebfef6 --- /dev/null +++ b/src/main/java/one/talon/model/FeatureFlagUpdate.java @@ -0,0 +1,323 @@ +/* + * 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.JsonElement; + +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) { + if (o == null) { + return "null"; + } + return 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/IntegrationCampaign.java b/src/main/java/one/talon/model/IntegrationCampaign.java index f36083c8..d5e3e547 100644 --- a/src/main/java/one/talon/model/IntegrationCampaign.java +++ b/src/main/java/one/talon/model/IntegrationCampaign.java @@ -217,8 +217,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 +429,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 +446,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; } @@ -569,7 +569,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 +615,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..ff745c39 --- /dev/null +++ b/src/main/java/one/talon/model/IntegrationCampaignBase.java @@ -0,0 +1,677 @@ +/* + * 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.JsonElement; + +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) { + if (o == null) { + return "null"; + } + return 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/NewExperiment.java b/src/main/java/one/talon/model/NewExperiment.java index 1658f8aa..3b3b6f7e 100644 --- a/src/main/java/one/talon/model/NewExperiment.java +++ b/src/main/java/one/talon/model/NewExperiment.java @@ -62,6 +62,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"), + + 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 NewExperiment() { } @@ -102,6 +168,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 +262,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 +279,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(); @@ -195,10 +303,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 +331,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/NewReward.java b/src/main/java/one/talon/model/NewReward.java index 3ab5637c..2d14cfa6 100644 --- a/src/main/java/one/talon/model/NewReward.java +++ b/src/main/java/one/talon/model/NewReward.java @@ -23,8 +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; @@ -80,16 +78,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 +183,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 +242,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 +260,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(); @@ -352,7 +282,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 +323,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..8bbb4107 --- /dev/null +++ b/src/main/java/one/talon/model/NewRiskNotification.java @@ -0,0 +1,520 @@ +/* + * 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.JsonElement; + +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) { + if (o == null) { + return "null"; + } + return 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/Reward.java b/src/main/java/one/talon/model/Reward.java index 407470ec..762cd3dd 100644 --- a/src/main/java/one/talon/model/Reward.java +++ b/src/main/java/one/talon/model/Reward.java @@ -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. */ @@ -326,29 +336,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 +401,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; @@ -461,15 +501,17 @@ 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.modified, reward.modified) && Objects.equals(this.status, reward.status)&& 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, additionalProperties); } @Override @@ -484,8 +526,10 @@ 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); @@ -509,7 +553,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")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("id", "created", "accountId", "name", "apiName", "applicationIds", "sandbox", "status")); @@ -550,19 +594,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"); 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..738f0c10 --- /dev/null +++ b/src/main/java/one/talon/model/RiskNotification.java @@ -0,0 +1,625 @@ +/* + * 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.JsonElement; + +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) { + if (o == null) { + return "null"; + } + return 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/RuleMetadata.java b/src/main/java/one/talon/model/RuleMetadata.java index b8bb2559..032f3f42 100644 --- a/src/main/java/one/talon/model/RuleMetadata.java +++ b/src/main/java/one/talon/model/RuleMetadata.java @@ -20,10 +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; @@ -74,11 +71,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 +149,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 +207,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 +224,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(); @@ -283,7 +246,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 +284,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..7d345c6a --- /dev/null +++ b/src/main/java/one/talon/model/RuleMetadataEligibility.java @@ -0,0 +1,428 @@ +/* + * 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.JsonElement; + +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) { + if (o == null) { + return "null"; + } + return 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/StrikethroughLabelingNotification.java b/src/main/java/one/talon/model/StrikethroughLabelingNotification.java index 5e5d1f83..938eab1b 100644 --- a/src/main/java/one/talon/model/StrikethroughLabelingNotification.java +++ b/src/main/java/one/talon/model/StrikethroughLabelingNotification.java @@ -57,7 +57,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 +210,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 diff --git a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java index 4c97a82c..69020775 100644 --- a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java +++ b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemEffectProps.java @@ -75,7 +75,7 @@ public StrikethroughSetDiscountPerItemEffectProps name(@javax.annotation.Nonnull } /** - * effect name. + * The effect name. * @return name */ @javax.annotation.Nonnull @@ -113,7 +113,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 diff --git a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java index ff9fe0b6..a8dcd99f 100644 --- a/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java +++ b/src/main/java/one/talon/model/StrikethroughSetDiscountPerItemMemberEffectProps.java @@ -70,7 +70,7 @@ public StrikethroughSetDiscountPerItemMemberEffectProps name(@javax.annotation.N } /** - * effect name. + * The effect name. * @return name */ @javax.annotation.Nonnull diff --git a/src/main/java/one/talon/model/UpdateExperiment.java b/src/main/java/one/talon/model/UpdateExperiment.java index f80975e4..82f243a2 100644 --- a/src/main/java/one/talon/model/UpdateExperiment.java +++ b/src/main/java/one/talon/model/UpdateExperiment.java @@ -62,6 +62,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. + */ + @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.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 +168,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. + * @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. + * @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 +262,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 +279,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(); @@ -195,7 +303,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 +331,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/UpdateReward.java b/src/main/java/one/talon/model/UpdateReward.java index 81acc356..9b9b9d56 100644 --- a/src/main/java/one/talon/model/UpdateReward.java +++ b/src/main/java/one/talon/model/UpdateReward.java @@ -122,10 +122,15 @@ 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) @@ -192,16 +197,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 +226,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; } @@ -303,6 +319,7 @@ 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.additionalProperties, updateReward.additionalProperties); @@ -310,7 +327,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, description, status, rule, bindings, additionalProperties); + return Objects.hash(name, description, status, visibilityConditions, rule, bindings, additionalProperties); } @Override @@ -320,6 +337,7 @@ 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -344,7 +362,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")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name", "status")); @@ -381,19 +399,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"); diff --git a/src/test/java/one/talon/api/ManagementApiTest.java b/src/test/java/one/talon/api/ManagementApiTest.java index 307655b9..c2962cca 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 } @@ -2423,7 +2424,7 @@ public void importCouponsTest() throws ApiException { @Test public void importLoyaltyCardsTest() throws ApiException { Long loyaltyProgramId = null; - String upFile = null; + File upFile = null; ModelImport response = api.importLoyaltyCards(loyaltyProgramId, upFile); // TODO: test validations } @@ -2438,7 +2439,7 @@ public void importLoyaltyCardsTest() throws ApiException { @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/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/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/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/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/RewardTest.java b/src/test/java/one/talon/model/RewardTest.java index ff04e85d..354cea26 100644 --- a/src/test/java/one/talon/model/RewardTest.java +++ b/src/test/java/one/talon/model/RewardTest.java @@ -106,6 +106,14 @@ public void sandboxTest() { // TODO: test sandbox } + /** + * Test the property 'visibilityConditions' + */ + @Test + public void visibilityConditionsTest() { + // TODO: test visibilityConditions + } + /** * Test the property 'rule' */ @@ -122,6 +130,14 @@ public void bindingsTest() { // TODO: test bindings } + /** + * Test the property 'modified' + */ + @Test + public void modifiedTest() { + // TODO: test modified + } + /** * Test the property 'status' */ 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/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..25811f21 100644 --- a/src/test/java/one/talon/model/UpdateRewardTest.java +++ b/src/test/java/one/talon/model/UpdateRewardTest.java @@ -65,6 +65,14 @@ public void statusTest() { // TODO: test status } + /** + * Test the property 'visibilityConditions' + */ + @Test + public void visibilityConditionsTest() { + // TODO: test visibilityConditions + } + /** * Test the property 'rule' */