From 8e90db3341d2362ed9a9bb0ee90222fa09e4c7ff Mon Sep 17 00:00:00 2001 From: KSGRelewise <119578211+KSGRelewise@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:11:33 +0200 Subject: [PATCH 1/5] Added DataValueFactory method for acepting a boolean. --- .../java/com/relewise/client/factory/DataValueFactory.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/src/main/java/com/relewise/client/factory/DataValueFactory.java b/src/src/main/java/com/relewise/client/factory/DataValueFactory.java index 20d066a..e606b12 100644 --- a/src/src/main/java/com/relewise/client/factory/DataValueFactory.java +++ b/src/src/main/java/com/relewise/client/factory/DataValueFactory.java @@ -19,6 +19,12 @@ public static DataValue create(double value) { .setValue(value); } + public static DataValue create(boolean value) { + return DataValue.create() + .setType(DataValueDataValueTypes.Boolean) + .setValue(value); + } + public static DataValue create(MultiCurrency value) { return DataValue.create() .setType(DataValueDataValueTypes.MultiCurrency) From eb32e04a60bb60632bbaa3f203c7439f4351ea55 Mon Sep 17 00:00:00 2001 From: KSGRelewise <119578211+KSGRelewise@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:19:15 +0200 Subject: [PATCH 2/5] Added docs exxample for product integration. --- .../java/com/relewise/client/TrackerTest.java | 170 +++++++++++++++++- 1 file changed, 169 insertions(+), 1 deletion(-) diff --git a/src/src/test/java/com/relewise/client/TrackerTest.java b/src/src/test/java/com/relewise/client/TrackerTest.java index efda42b..f5e0a66 100644 --- a/src/src/test/java/com/relewise/client/TrackerTest.java +++ b/src/src/test/java/com/relewise/client/TrackerTest.java @@ -1,11 +1,14 @@ package com.relewise.client; import com.relewise.client.factory.DataValueFactory; +import com.relewise.client.factory.MultilingualCollectionValue; import com.relewise.client.factory.UserFactory; import com.relewise.client.model.*; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; +import java.util.ArrayList; + import static org.junit.jupiter.api.Assertions.*; public class TrackerTest extends TestBase { @@ -25,8 +28,173 @@ public void testProductView() throws Exception { assertDoesNotThrow(action); } + private void testDocsSampleProductUpdateWithVariant() throws Exception { + var tracker = new Tracker(GetDatasetId(), GetApiKey(), "https://api.relewise.com"); + + // Create a timestamp to distinguish active and inactive entities + // Read more at + // https://docs.relewise.com/docs/developer/bestpractices/product-integration.html + long importedAtTimestamp = System.currentTimeMillis(); + + // Language can be any string, and doesn't have to be a valid iso-standard. + var english = Language.create("en"); + var dkk = Currency.create("DKK"); + + var updates = new ArrayList(); + + // Foreach product that needs to be imported, do the following: + { + // The Id should be the primary id of the product + var product = Product.create("Product-SKU-01"); + + // We only set the English translation in this example + // but more can be set by parsing more MultilingualValue + // to the Multilingual.create method. + product.setDisplayName( + Multilingual.create( + MultilingualValue.create(english, "The english display name") + ) + ); + + product.setSalesPrice(MultiCurrency.create(Money.create(dkk, 199.0))); + product.setListPrice(MultiCurrency.create(Money.create(dkk, 199.0))); + + product.setBrand( + // Displayname can be left out, but Id is required + Brand.create("brandId") + .setDisplayName("Brand display name") + ); + + // We only set the English translation in this example + // but more can be set by parsing more MultilingualValue + // to the Multilingual.create method. + product.addToData("ShortDescription", DataValueFactory.create( + Multilingual.create( + MultilingualValue.create(english,"The short english description") + ) + )); + + product.addToCategoryPaths(CategoryPath.create( + CategoryNameAndId.create("74", Multilingual.create( + MultilingualValue.create(english, "Play") + )), + CategoryNameAndId.create("2", Multilingual.create( + MultilingualValue.create(english, "Swings") + )), + CategoryNameAndId.create("529", Multilingual.create( + MultilingualValue.create(english, "Swing Seats") + )) + )); + + product.addToData("ImportedAt", DataValueFactory.create(importedAtTimestamp)); + product.addToData("MinimumAge", DataValueFactory.create(4)); + product.addToData("InStock", DataValueFactory.create(true)); + product.addToData("USPs", DataValueFactory.create("first usp", "second usp", "third usp")); + // Add any additional fields you would want returned from Relewise + + var variants = new ArrayList(); + + // Foreach variant of this product + { + var variant = ProductVariant.create("The variant id"); + + variant.addToData("Materials", DataValueFactory.create( + new MultilingualCollectionValue[] { + new MultilingualCollectionValue( + english, new String[] { "Wood", "Metal" } + ) + } + )); + + variant.addToData("Colors", DataValueFactory.create( + new MultilingualCollectionValue[] { + new MultilingualCollectionValue( + english, new String[] { "Red", "Green" } + ) + } + )); + + variant.addToData("PrimaryMaterial", DataValueFactory.create( + Multilingual.create(MultilingualValue.create(english, "Wood"))) + ); + variant.addToData("PrimaryColor", DataValueFactory.create( + Multilingual.create(MultilingualValue.create(english, "Red"))) + ); + + // Add any additional fields you would want returned from Relewise + + variants.add(variant); + } + + var productUpdate = ProductUpdate.create( + product, ProductUpdateUpdateKind.ReplaceProvidedProperties + ); + productUpdate.setVariants(variants.toArray(new ProductVariant[variants.size()])); + productUpdate.setVariantUpdateKind(ProductUpdateUpdateKind.ReplaceProvidedProperties); + productUpdate.setReplaceExistingVariants(true); + // Replace existing variants = true will delete all variants in Relewise + // (for the listed products) not included in this update request. + + updates.add(productUpdate); + } + // Foreach product END + + // If this is a full-import (not delta), disable all non-included products + { + // Setting this to false will make it disable all products that don't have the "ImportedAt" key. + boolean onlyDisableOldProductsThatHaveTheImportedAtKey = true; + + boolean negated = true; + var nonUpdatedProductFilter = FilterCollection.create( + ProductDataFilter.create( + "ImportedAt", + ValueConditionCollection.create().setItems( + EqualsCondition.create(DataValueFactory.create(importedAtTimestamp), negated) + ), + true, + onlyDisableOldProductsThatHaveTheImportedAtKey, + null, + null) + ); + + var disableProductsWithoutNewestTimestamp = ProductAdministrativeAction.create( + Language.UNDEFINED, + Currency.UNDEFINED, + nonUpdatedProductFilter, + ProductAdministrativeActionUpdateKind.Disable, + ProductAdministrativeActionUpdateKind.Disable + ); + + updates.add(disableProductsWithoutNewestTimestamp); + } + + boolean negated = false; + var updatedProductFilter = FilterCollection.create( + ProductDataFilter.create( + "ImportedAt", + ValueConditionCollection.create().setItems( + EqualsCondition.create(DataValueFactory.create(importedAtTimestamp), negated) + ), + true, + true, + null, + null) + ); + var enabledProductsWithNewestTimestamp = ProductAdministrativeAction.create( + Language.UNDEFINED, + Currency.UNDEFINED, + updatedProductFilter, + ProductAdministrativeActionUpdateKind.Enable, + ProductAdministrativeActionUpdateKind.Enable + ); + + updates.add(enabledProductsWithNewestTimestamp); + + tracker.track(BatchedTrackingRequest.create(updates.toArray(new Trackable[updates.size()]))); + } + @Test - public void testProductUpdateWithVariant() throws Exception { + public void testCompactProductUpdateWithVariant() throws Exception { // Create Product by tracking it. var tracker = new Tracker(GetDatasetId(), GetApiKey(), "https://api.relewise.com"); From fe7fc75fd36cab94ac06a686cde54204b5eadb23 Mon Sep 17 00:00:00 2001 From: KSGRelewise <119578211+KSGRelewise@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:37:17 +0200 Subject: [PATCH 3/5] Updated parameter list to use nullability annotation for last parameter as well. --- Generator/JavaMemberWriters/JavaCreatorMethodWriter.cs | 4 ++-- Generator/JavaWriter.cs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Generator/JavaMemberWriters/JavaCreatorMethodWriter.cs b/Generator/JavaMemberWriters/JavaCreatorMethodWriter.cs index 989a88a..7ebfbc3 100644 --- a/Generator/JavaMemberWriters/JavaCreatorMethodWriter.cs +++ b/Generator/JavaMemberWriters/JavaCreatorMethodWriter.cs @@ -186,7 +186,7 @@ private void WriteCreatorMethodBody(IndentedTextWriter writer, string variable, if (propertyName is not null) { if (property!.PropertyType.IsGenericType && property!.PropertyType.GetGenericTypeDefinition() == typeof(List<>) && (parameter.ParameterType.IsArray - || (parameter == parameters.Last() && javaWriter.BetterTypedParameterTypeName(parameter.ParameterType, new NullabilityInfoContext().Create(parameter)).Contains("...")))) + || (parameter == parameters.Last() && javaWriter.BetterTypedParameterTypeName(parameter).Contains("...")))) { writer.WriteLine($"{variable}.{propertyName.AsFieldName()} = new ArrayList<>(Arrays.asList({parameter.Name.AsFieldName()}));"); } @@ -262,7 +262,7 @@ private string ParameterList(ParameterInfo[] parameters) { return string.Join(", ", parameters.Select(parameter => - $"{(parameters[^1] == parameter ? javaWriter.BetterTypedParameterTypeName(parameter.ParameterType, new NullabilityInfoContext().Create(parameter)) : javaWriter.TypeName(parameter))} {parameter.Name.AsFieldName()}" + $"{(parameters[^1] == parameter ? javaWriter.BetterTypedParameterTypeName(parameter) : javaWriter.TypeName(parameter))} {parameter.Name.AsFieldName()}" ) ); } diff --git a/Generator/JavaWriter.cs b/Generator/JavaWriter.cs index b64f443..d01366c 100644 --- a/Generator/JavaWriter.cs +++ b/Generator/JavaWriter.cs @@ -103,8 +103,11 @@ private static string PrependNullableIfApplicable(string typeName, NullabilityIn return typeName; } - public string BetterTypedParameterTypeName(Type parameterType, NullabilityInfo nullabilityInfo) + public string BetterTypedParameterTypeName(ParameterInfo parameter) { + Type parameterType = parameter.ParameterType; + var nullabilityInfo = new NullabilityInfoContext().Create(parameter); + if (nullabilityInfo.WriteState is NullabilityState.Nullable) { parameterType = nullabilityInfo.Type; @@ -114,7 +117,7 @@ parameterType.GenericTypeArguments is [var elementType] ? TypeName(elementType) + "..." : parameterType.IsArray ? TypeName(parameterType.GetElementType()!) + "..." - : TypeName(parameterType); + : PrependNullableIfApplicable(TypeName(parameterType), nullabilityInfo); } public string BetterTypedParameterTypeName(PropertyInfo property, NullabilityInfo nullabilityInfo) From c557060e87047118419f8303514467da140a0131 Mon Sep 17 00:00:00 2001 From: KSGRelewise <119578211+KSGRelewise@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:38:11 +0200 Subject: [PATCH 4/5] Regenerated. --- .../main/java/com/relewise/client/model/Advertiser.java | 4 ++-- .../java/com/relewise/client/model/BrandDataFilter.java | 8 ++++---- .../main/java/com/relewise/client/model/BrandQuery.java | 4 ++-- .../relewise/client/model/CampaignAnalyticsRequest.java | 4 ++-- .../java/com/relewise/client/model/CartDataFilter.java | 4 ++-- .../java/com/relewise/client/model/CategoryNameAndId.java | 4 ++-- .../java/com/relewise/client/model/CompanyDataFilter.java | 8 ++++---- .../relewise/client/model/ContentCategoryDataFilter.java | 8 ++++---- .../com/relewise/client/model/ContentCategoryQuery.java | 4 ++-- .../client/model/ContentDataDoubleRangeFacet.java | 4 ++-- .../java/com/relewise/client/model/ContentDataFilter.java | 8 ++++---- .../main/java/com/relewise/client/model/ContentQuery.java | 4 ++-- .../relewise/client/model/DataObjectDoubleRangeFacet.java | 4 ++-- .../relewise/client/model/DataObjectValueSelector.java | 4 ++-- .../relewise/client/model/FieldIndexConfiguration.java | 8 ++++---- .../client/model/LanguageIndexConfigurationEntry.java | 4 ++-- src/src/main/java/com/relewise/client/model/Location.java | 4 ++-- .../java/com/relewise/client/model/LocationPlacement.java | 4 ++-- .../relewise/client/model/LocationPlacementVariation.java | 4 ++-- .../java/com/relewise/client/model/MultilingualValue.java | 4 ++-- .../model/PopularSearchTermsRecommendationRequest.java | 4 ++-- .../java/com/relewise/client/model/PriceRangeFacet.java | 4 ++-- .../com/relewise/client/model/ProductAndVariantId.java | 4 ++-- .../client/model/ProductCategoryDataDoubleRangeFacet.java | 4 ++-- .../relewise/client/model/ProductCategoryDataFilter.java | 8 ++++---- .../com/relewise/client/model/ProductCategoryQuery.java | 4 ++-- .../client/model/ProductDataDoubleRangeFacet.java | 4 ++-- .../java/com/relewise/client/model/ProductDataFilter.java | 8 ++++---- .../relewise/client/model/ProductDisplayNameFilter.java | 4 ++-- .../java/com/relewise/client/model/ProductPromotion.java | 4 ++-- .../client/model/ProductPromotionSpecification.java | 4 ++-- .../main/java/com/relewise/client/model/ProductView.java | 4 ++-- .../java/com/relewise/client/model/PromotionLocation.java | 4 ++-- .../java/com/relewise/client/model/RedirectResult.java | 4 ++-- .../main/java/com/relewise/client/model/RedirectRule.java | 8 ++++---- .../model/SearchTermModifierRuleReplaceTermAction.java | 4 ++-- .../SearchTermModifierRuleReplaceWordsInTermAction.java | 4 ++-- .../com/relewise/client/model/SignificantDataValue.java | 4 ++-- .../com/relewise/client/model/SimilarProductsRequest.java | 8 ++++---- .../main/java/com/relewise/client/model/StemmingRule.java | 4 ++-- src/src/main/java/com/relewise/client/model/User.java | 4 ++-- .../java/com/relewise/client/model/VariantDataFilter.java | 8 ++++---- 42 files changed, 104 insertions(+), 104 deletions(-) diff --git a/src/src/main/java/com/relewise/client/model/Advertiser.java b/src/src/main/java/com/relewise/client/model/Advertiser.java index 7abd5f3..f261ac5 100644 --- a/src/src/main/java/com/relewise/client/model/Advertiser.java +++ b/src/src/main/java/com/relewise/client/model/Advertiser.java @@ -31,11 +31,11 @@ public class Advertiser extends AdvertiserEntityStateAdvertiserMetadataValuesRet public @Nullable PromotionSpecificationCollection allowedPromotions; /** Defines locations/placements/variations where this advertiser is allowed to make promotions at. If null or empty, an advertiser will not be allowed to make any promotions anywhere, only useful for Advertisers in draft. */ public @Nullable PromotionLocationCollection allowedLocations; - public static Advertiser create(@Nullable UUID id, AdvertiserEntityState state, String name, @Nullable PromotionSpecificationCollection allowedPromotions, PromotionLocationCollection allowedLocations) + public static Advertiser create(@Nullable UUID id, AdvertiserEntityState state, String name, @Nullable PromotionSpecificationCollection allowedPromotions, @Nullable PromotionLocationCollection allowedLocations) { return new Advertiser(id, state, name, allowedPromotions, allowedLocations); } - public Advertiser(@Nullable UUID id, AdvertiserEntityState state, String name, @Nullable PromotionSpecificationCollection allowedPromotions, PromotionLocationCollection allowedLocations) + public Advertiser(@Nullable UUID id, AdvertiserEntityState state, String name, @Nullable PromotionSpecificationCollection allowedPromotions, @Nullable PromotionLocationCollection allowedLocations) { this.id = id; this.state = state; diff --git a/src/src/main/java/com/relewise/client/model/BrandDataFilter.java b/src/src/main/java/com/relewise/client/model/BrandDataFilter.java index c68b070..df5523e 100644 --- a/src/src/main/java/com/relewise/client/model/BrandDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/BrandDataFilter.java @@ -40,11 +40,11 @@ public BrandDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static BrandDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static BrandDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new BrandDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public BrandDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public BrandDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public BrandDataFilter(String key) this.language = null; this.currency = null; } - public static BrandDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static BrandDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new BrandDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public BrandDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public BrandDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/BrandQuery.java b/src/src/main/java/com/relewise/client/model/BrandQuery.java index e397f7b..e17136b 100644 --- a/src/src/main/java/com/relewise/client/model/BrandQuery.java +++ b/src/src/main/java/com/relewise/client/model/BrandQuery.java @@ -42,11 +42,11 @@ public BrandQuery() this.language = null; this.currency = null; } - public static BrandQuery create(@Nullable Language language, Currency currency) + public static BrandQuery create(@Nullable Language language, @Nullable Currency currency) { return new BrandQuery(language, currency); } - public BrandQuery(@Nullable Language language, Currency currency) + public BrandQuery(@Nullable Language language, @Nullable Currency currency) { this.language = language; this.currency = currency; diff --git a/src/src/main/java/com/relewise/client/model/CampaignAnalyticsRequest.java b/src/src/main/java/com/relewise/client/model/CampaignAnalyticsRequest.java index e5d478a..7ccbb59 100644 --- a/src/src/main/java/com/relewise/client/model/CampaignAnalyticsRequest.java +++ b/src/src/main/java/com/relewise/client/model/CampaignAnalyticsRequest.java @@ -31,11 +31,11 @@ public class CampaignAnalyticsRequest extends LicensedRequest public UUID id; public LocalDateTimeRange periodUtc; public @Nullable FilterCollection filters; - public static CampaignAnalyticsRequest create(UUID id, LocalDateTimeRange periodUtc, FilterCollection filters) + public static CampaignAnalyticsRequest create(UUID id, LocalDateTimeRange periodUtc, @Nullable FilterCollection filters) { return new CampaignAnalyticsRequest(id, periodUtc, filters); } - public CampaignAnalyticsRequest(UUID id, LocalDateTimeRange periodUtc, FilterCollection filters) + public CampaignAnalyticsRequest(UUID id, LocalDateTimeRange periodUtc, @Nullable FilterCollection filters) { this.id = id; this.periodUtc = periodUtc; diff --git a/src/src/main/java/com/relewise/client/model/CartDataFilter.java b/src/src/main/java/com/relewise/client/model/CartDataFilter.java index 2109646..d12da44 100644 --- a/src/src/main/java/com/relewise/client/model/CartDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/CartDataFilter.java @@ -45,11 +45,11 @@ public CartDataFilter(String key) this.language = null; this.currency = null; } - public static CartDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static CartDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new CartDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public CartDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public CartDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/CategoryNameAndId.java b/src/src/main/java/com/relewise/client/model/CategoryNameAndId.java index b458e84..a9ca3a0 100644 --- a/src/src/main/java/com/relewise/client/model/CategoryNameAndId.java +++ b/src/src/main/java/com/relewise/client/model/CategoryNameAndId.java @@ -37,7 +37,7 @@ public CategoryNameAndId(String id) * @param id The ID of the category (Which is generally very unlikely to change in the future) * @param displayName The Display name of the category (More likely to change in the future) */ - public static CategoryNameAndId create(String id, Multilingual displayName) + public static CategoryNameAndId create(String id, @Nullable Multilingual displayName) { return new CategoryNameAndId(id, displayName); } @@ -46,7 +46,7 @@ public static CategoryNameAndId create(String id, Multilingual displayName) * @param id The ID of the category (Which is generally very unlikely to change in the future) * @param displayName The Display name of the category (More likely to change in the future) */ - public CategoryNameAndId(String id, Multilingual displayName) + public CategoryNameAndId(String id, @Nullable Multilingual displayName) { this.id = id; this.displayName = displayName; diff --git a/src/src/main/java/com/relewise/client/model/CompanyDataFilter.java b/src/src/main/java/com/relewise/client/model/CompanyDataFilter.java index 01dc9db..6597ba4 100644 --- a/src/src/main/java/com/relewise/client/model/CompanyDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/CompanyDataFilter.java @@ -40,11 +40,11 @@ public CompanyDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static CompanyDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static CompanyDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new CompanyDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public CompanyDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public CompanyDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public CompanyDataFilter(String key) this.language = null; this.currency = null; } - public static CompanyDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static CompanyDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new CompanyDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public CompanyDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public CompanyDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/ContentCategoryDataFilter.java b/src/src/main/java/com/relewise/client/model/ContentCategoryDataFilter.java index b981f56..63adc38 100644 --- a/src/src/main/java/com/relewise/client/model/ContentCategoryDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/ContentCategoryDataFilter.java @@ -40,11 +40,11 @@ public ContentCategoryDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static ContentCategoryDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ContentCategoryDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ContentCategoryDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ContentCategoryDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ContentCategoryDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public ContentCategoryDataFilter(String key) this.language = null; this.currency = null; } - public static ContentCategoryDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ContentCategoryDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ContentCategoryDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ContentCategoryDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ContentCategoryDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/ContentCategoryQuery.java b/src/src/main/java/com/relewise/client/model/ContentCategoryQuery.java index b78a76c..2f9408f 100644 --- a/src/src/main/java/com/relewise/client/model/ContentCategoryQuery.java +++ b/src/src/main/java/com/relewise/client/model/ContentCategoryQuery.java @@ -35,11 +35,11 @@ public ContentCategoryQuery() this.language = null; this.currency = null; } - public static ContentCategoryQuery create(@Nullable Language language, Currency currency) + public static ContentCategoryQuery create(@Nullable Language language, @Nullable Currency currency) { return new ContentCategoryQuery(language, currency); } - public ContentCategoryQuery(@Nullable Language language, Currency currency) + public ContentCategoryQuery(@Nullable Language language, @Nullable Currency currency) { this.language = language; this.currency = currency; diff --git a/src/src/main/java/com/relewise/client/model/ContentDataDoubleRangeFacet.java b/src/src/main/java/com/relewise/client/model/ContentDataDoubleRangeFacet.java index 49219e5..9f982a8 100644 --- a/src/src/main/java/com/relewise/client/model/ContentDataDoubleRangeFacet.java +++ b/src/src/main/java/com/relewise/client/model/ContentDataDoubleRangeFacet.java @@ -26,11 +26,11 @@ public class ContentDataDoubleRangeFacet extends DoubleContentDataRangeFacet { public String $type = "Relewise.Client.DataTypes.Search.Facets.Queries.ContentDataDoubleRangeFacet, Relewise.Client"; - public static ContentDataDoubleRangeFacet create(String key, DoubleRange selected) + public static ContentDataDoubleRangeFacet create(String key, @Nullable DoubleRange selected) { return new ContentDataDoubleRangeFacet(key, selected); } - public ContentDataDoubleRangeFacet(String key, DoubleRange selected) + public ContentDataDoubleRangeFacet(String key, @Nullable DoubleRange selected) { this.key = key; this.selected = selected; diff --git a/src/src/main/java/com/relewise/client/model/ContentDataFilter.java b/src/src/main/java/com/relewise/client/model/ContentDataFilter.java index 389465c..4b26237 100644 --- a/src/src/main/java/com/relewise/client/model/ContentDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/ContentDataFilter.java @@ -40,11 +40,11 @@ public ContentDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static ContentDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ContentDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ContentDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ContentDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ContentDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public ContentDataFilter(String key) this.language = null; this.currency = null; } - public static ContentDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ContentDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ContentDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ContentDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ContentDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/ContentQuery.java b/src/src/main/java/com/relewise/client/model/ContentQuery.java index d00e2de..3a2c9f8 100644 --- a/src/src/main/java/com/relewise/client/model/ContentQuery.java +++ b/src/src/main/java/com/relewise/client/model/ContentQuery.java @@ -42,11 +42,11 @@ public ContentQuery() this.language = null; this.currency = null; } - public static ContentQuery create(@Nullable Language language, Currency currency) + public static ContentQuery create(@Nullable Language language, @Nullable Currency currency) { return new ContentQuery(language, currency); } - public ContentQuery(@Nullable Language language, Currency currency) + public ContentQuery(@Nullable Language language, @Nullable Currency currency) { this.language = language; this.currency = currency; diff --git a/src/src/main/java/com/relewise/client/model/DataObjectDoubleRangeFacet.java b/src/src/main/java/com/relewise/client/model/DataObjectDoubleRangeFacet.java index 6ca3b55..475c455 100644 --- a/src/src/main/java/com/relewise/client/model/DataObjectDoubleRangeFacet.java +++ b/src/src/main/java/com/relewise/client/model/DataObjectDoubleRangeFacet.java @@ -26,11 +26,11 @@ public class DataObjectDoubleRangeFacet extends DoubleDataObjectRangeFacet { public String $type = "Relewise.Client.DataTypes.Search.Facets.Queries.DataObjectDoubleRangeFacet, Relewise.Client"; - public static DataObjectDoubleRangeFacet create(String key, DoubleRange selected) + public static DataObjectDoubleRangeFacet create(String key, @Nullable DoubleRange selected) { return new DataObjectDoubleRangeFacet(key, selected); } - public DataObjectDoubleRangeFacet(String key, DoubleRange selected) + public DataObjectDoubleRangeFacet(String key, @Nullable DoubleRange selected) { this.key = key; this.selected = selected; diff --git a/src/src/main/java/com/relewise/client/model/DataObjectValueSelector.java b/src/src/main/java/com/relewise/client/model/DataObjectValueSelector.java index 6673fe1..9caddc7 100644 --- a/src/src/main/java/com/relewise/client/model/DataObjectValueSelector.java +++ b/src/src/main/java/com/relewise/client/model/DataObjectValueSelector.java @@ -24,11 +24,11 @@ public class DataObjectValueSelector public @Nullable DataObjectFilter filter; public @Nullable DataObjectValueSelector childSelector; public @Nullable DataObjectValueSelector fallbackSelector; - public static DataObjectValueSelector create(String key, @Nullable DataObjectFilter filter, @Nullable DataObjectValueSelector childSelector, DataObjectValueSelector fallbackSelector) + public static DataObjectValueSelector create(String key, @Nullable DataObjectFilter filter, @Nullable DataObjectValueSelector childSelector, @Nullable DataObjectValueSelector fallbackSelector) { return new DataObjectValueSelector(key, filter, childSelector, fallbackSelector); } - public DataObjectValueSelector(String key, @Nullable DataObjectFilter filter, @Nullable DataObjectValueSelector childSelector, DataObjectValueSelector fallbackSelector) + public DataObjectValueSelector(String key, @Nullable DataObjectFilter filter, @Nullable DataObjectValueSelector childSelector, @Nullable DataObjectValueSelector fallbackSelector) { this.key = key; this.filter = filter; diff --git a/src/src/main/java/com/relewise/client/model/FieldIndexConfiguration.java b/src/src/main/java/com/relewise/client/model/FieldIndexConfiguration.java index d947d11..3ca1fd7 100644 --- a/src/src/main/java/com/relewise/client/model/FieldIndexConfiguration.java +++ b/src/src/main/java/com/relewise/client/model/FieldIndexConfiguration.java @@ -37,11 +37,11 @@ public FieldIndexConfiguration(Boolean included, Short weight, PredictionSourceT this.parser = parser; this.matchTypeSettings = null; } - public static FieldIndexConfiguration create(Boolean included, Short weight, PredictionSourceType predictionSourceType, Parser parser, MatchTypeSettings matchTypeSettings) + public static FieldIndexConfiguration create(Boolean included, Short weight, PredictionSourceType predictionSourceType, Parser parser, @Nullable MatchTypeSettings matchTypeSettings) { return new FieldIndexConfiguration(included, weight, predictionSourceType, parser, matchTypeSettings); } - public FieldIndexConfiguration(Boolean included, Short weight, PredictionSourceType predictionSourceType, Parser parser, MatchTypeSettings matchTypeSettings) + public FieldIndexConfiguration(Boolean included, Short weight, PredictionSourceType predictionSourceType, Parser parser, @Nullable MatchTypeSettings matchTypeSettings) { this.included = included; this.weight = weight; @@ -60,11 +60,11 @@ public FieldIndexConfiguration(Boolean included, Short weight, PredictionSourceT this.predictionSourceType = predictionSourceType; this.matchTypeSettings = null; } - public static FieldIndexConfiguration create(Boolean included, Short weight, PredictionSourceType predictionSourceType, MatchTypeSettings matchTypeSettings) + public static FieldIndexConfiguration create(Boolean included, Short weight, PredictionSourceType predictionSourceType, @Nullable MatchTypeSettings matchTypeSettings) { return new FieldIndexConfiguration(included, weight, predictionSourceType, matchTypeSettings); } - public FieldIndexConfiguration(Boolean included, Short weight, PredictionSourceType predictionSourceType, MatchTypeSettings matchTypeSettings) + public FieldIndexConfiguration(Boolean included, Short weight, PredictionSourceType predictionSourceType, @Nullable MatchTypeSettings matchTypeSettings) { this.included = included; this.weight = weight; diff --git a/src/src/main/java/com/relewise/client/model/LanguageIndexConfigurationEntry.java b/src/src/main/java/com/relewise/client/model/LanguageIndexConfigurationEntry.java index ac7f32e..1841781 100644 --- a/src/src/main/java/com/relewise/client/model/LanguageIndexConfigurationEntry.java +++ b/src/src/main/java/com/relewise/client/model/LanguageIndexConfigurationEntry.java @@ -34,11 +34,11 @@ public LanguageIndexConfigurationEntry(Language language, Boolean included) this.included = included; this.iSO639_1 = null; } - public static LanguageIndexConfigurationEntry create(Language language, Boolean included, String iso639_1) + public static LanguageIndexConfigurationEntry create(Language language, Boolean included, @Nullable String iso639_1) { return new LanguageIndexConfigurationEntry(language, included, iso639_1); } - public LanguageIndexConfigurationEntry(Language language, Boolean included, String iso639_1) + public LanguageIndexConfigurationEntry(Language language, Boolean included, @Nullable String iso639_1) { this.language = language; this.included = included; diff --git a/src/src/main/java/com/relewise/client/model/Location.java b/src/src/main/java/com/relewise/client/model/Location.java index bacaa89..8ea20f1 100644 --- a/src/src/main/java/com/relewise/client/model/Location.java +++ b/src/src/main/java/com/relewise/client/model/Location.java @@ -35,11 +35,11 @@ public class Location extends LocationEntityStateLocationMetadataValuesRetailMed public @Nullable LocationPlacementCollection placements; /** Defines what kinds of promotions are supported by this location */ public @Nullable PromotionSpecificationCollection supportedPromotions; - public static Location create(@Nullable UUID id, LocationEntityState state, String name, LocationPlacementCollection placements, PromotionSpecificationCollection supportedPromotions) + public static Location create(@Nullable UUID id, LocationEntityState state, String name, LocationPlacementCollection placements, @Nullable PromotionSpecificationCollection supportedPromotions) { return new Location(id, state, name, placements, supportedPromotions); } - public Location(@Nullable UUID id, LocationEntityState state, String name, LocationPlacementCollection placements, PromotionSpecificationCollection supportedPromotions) + public Location(@Nullable UUID id, LocationEntityState state, String name, LocationPlacementCollection placements, @Nullable PromotionSpecificationCollection supportedPromotions) { this.id = id; this.state = state; diff --git a/src/src/main/java/com/relewise/client/model/LocationPlacement.java b/src/src/main/java/com/relewise/client/model/LocationPlacement.java index ad046d9..e6efc1e 100644 --- a/src/src/main/java/com/relewise/client/model/LocationPlacement.java +++ b/src/src/main/java/com/relewise/client/model/LocationPlacement.java @@ -27,11 +27,11 @@ public class LocationPlacement public @Nullable String key; /** The variations of this placement, e.g. to support multiple different views, like Mobile, Tablet, Desktop, Email template etc. If null or empty, no promotions will be shown for this placement */ public @Nullable LocationPlacementVariationCollection variations; - public static LocationPlacement create(String name, LocationPlacementVariationCollection variations) + public static LocationPlacement create(String name, @Nullable LocationPlacementVariationCollection variations) { return new LocationPlacement(name, variations); } - public LocationPlacement(String name, LocationPlacementVariationCollection variations) + public LocationPlacement(String name, @Nullable LocationPlacementVariationCollection variations) { this.name = name; this.variations = variations; diff --git a/src/src/main/java/com/relewise/client/model/LocationPlacementVariation.java b/src/src/main/java/com/relewise/client/model/LocationPlacementVariation.java index e63e19d..06fc477 100644 --- a/src/src/main/java/com/relewise/client/model/LocationPlacementVariation.java +++ b/src/src/main/java/com/relewise/client/model/LocationPlacementVariation.java @@ -23,11 +23,11 @@ public class LocationPlacementVariation public String name; public @Nullable String key; public @Nullable PromotionSpecificationVariationCollection supportedPromotions; - public static LocationPlacementVariation create(String name, PromotionSpecificationVariationCollection supportedPromotions) + public static LocationPlacementVariation create(String name, @Nullable PromotionSpecificationVariationCollection supportedPromotions) { return new LocationPlacementVariation(name, supportedPromotions); } - public LocationPlacementVariation(String name, PromotionSpecificationVariationCollection supportedPromotions) + public LocationPlacementVariation(String name, @Nullable PromotionSpecificationVariationCollection supportedPromotions) { this.name = name; this.supportedPromotions = supportedPromotions; diff --git a/src/src/main/java/com/relewise/client/model/MultilingualValue.java b/src/src/main/java/com/relewise/client/model/MultilingualValue.java index 393a8c1..9fc6943 100644 --- a/src/src/main/java/com/relewise/client/model/MultilingualValue.java +++ b/src/src/main/java/com/relewise/client/model/MultilingualValue.java @@ -22,11 +22,11 @@ public class MultilingualValue { public Language language; public @Nullable String text; - public static MultilingualValue create(Language language, String text) + public static MultilingualValue create(Language language, @Nullable String text) { return new MultilingualValue(language, text); } - public MultilingualValue(Language language, String text) + public MultilingualValue(Language language, @Nullable String text) { this.language = language; this.text = text; diff --git a/src/src/main/java/com/relewise/client/model/PopularSearchTermsRecommendationRequest.java b/src/src/main/java/com/relewise/client/model/PopularSearchTermsRecommendationRequest.java index ba9b43c..2367e89 100644 --- a/src/src/main/java/com/relewise/client/model/PopularSearchTermsRecommendationRequest.java +++ b/src/src/main/java/com/relewise/client/model/PopularSearchTermsRecommendationRequest.java @@ -28,11 +28,11 @@ public class PopularSearchTermsRecommendationRequest extends RecommendationReque public String $type = "Relewise.Client.Requests.Recommendations.PopularSearchTermsRecommendationRequest, Relewise.Client"; public @Nullable String term; public @Nullable RecommendPopularSearchTermSettings settings; - public static PopularSearchTermsRecommendationRequest create(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, String term) + public static PopularSearchTermsRecommendationRequest create(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, @Nullable String term) { return new PopularSearchTermsRecommendationRequest(language, currency, displayedAtLocationType, user, term); } - public PopularSearchTermsRecommendationRequest(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, String term) + public PopularSearchTermsRecommendationRequest(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, @Nullable String term) { this.language = language; this.currency = currency; diff --git a/src/src/main/java/com/relewise/client/model/PriceRangeFacet.java b/src/src/main/java/com/relewise/client/model/PriceRangeFacet.java index 066001b..b06aa84 100644 --- a/src/src/main/java/com/relewise/client/model/PriceRangeFacet.java +++ b/src/src/main/java/com/relewise/client/model/PriceRangeFacet.java @@ -28,11 +28,11 @@ public class PriceRangeFacet extends Facet public String $type = "Relewise.Client.DataTypes.Search.Facets.Queries.PriceRangeFacet, Relewise.Client"; public @Nullable DoubleRange selected; public PriceSelectionStrategy priceSelectionStrategy; - public static PriceRangeFacet create(FacetingField field, PriceSelectionStrategy priceSelectionStrategy, DoubleRange selected) + public static PriceRangeFacet create(FacetingField field, PriceSelectionStrategy priceSelectionStrategy, @Nullable DoubleRange selected) { return new PriceRangeFacet(field, priceSelectionStrategy, selected); } - public PriceRangeFacet(FacetingField field, PriceSelectionStrategy priceSelectionStrategy, DoubleRange selected) + public PriceRangeFacet(FacetingField field, PriceSelectionStrategy priceSelectionStrategy, @Nullable DoubleRange selected) { this.field = field; this.priceSelectionStrategy = priceSelectionStrategy; diff --git a/src/src/main/java/com/relewise/client/model/ProductAndVariantId.java b/src/src/main/java/com/relewise/client/model/ProductAndVariantId.java index 9f20493..e23c9d6 100644 --- a/src/src/main/java/com/relewise/client/model/ProductAndVariantId.java +++ b/src/src/main/java/com/relewise/client/model/ProductAndVariantId.java @@ -31,11 +31,11 @@ public ProductAndVariantId(String productId) this.productId = productId; this.variantId = null; } - public static ProductAndVariantId create(String productId, String variantId) + public static ProductAndVariantId create(String productId, @Nullable String variantId) { return new ProductAndVariantId(productId, variantId); } - public ProductAndVariantId(String productId, String variantId) + public ProductAndVariantId(String productId, @Nullable String variantId) { this.productId = productId; this.variantId = variantId; diff --git a/src/src/main/java/com/relewise/client/model/ProductCategoryDataDoubleRangeFacet.java b/src/src/main/java/com/relewise/client/model/ProductCategoryDataDoubleRangeFacet.java index dd7d775..36beb23 100644 --- a/src/src/main/java/com/relewise/client/model/ProductCategoryDataDoubleRangeFacet.java +++ b/src/src/main/java/com/relewise/client/model/ProductCategoryDataDoubleRangeFacet.java @@ -26,11 +26,11 @@ public class ProductCategoryDataDoubleRangeFacet extends DoubleProductCategoryDataRangeFacet { public String $type = "Relewise.Client.DataTypes.Search.Facets.Queries.ProductCategoryDataDoubleRangeFacet, Relewise.Client"; - public static ProductCategoryDataDoubleRangeFacet create(String key, DoubleRange selected) + public static ProductCategoryDataDoubleRangeFacet create(String key, @Nullable DoubleRange selected) { return new ProductCategoryDataDoubleRangeFacet(key, selected); } - public ProductCategoryDataDoubleRangeFacet(String key, DoubleRange selected) + public ProductCategoryDataDoubleRangeFacet(String key, @Nullable DoubleRange selected) { this.key = key; this.selected = selected; diff --git a/src/src/main/java/com/relewise/client/model/ProductCategoryDataFilter.java b/src/src/main/java/com/relewise/client/model/ProductCategoryDataFilter.java index ce664be..37d50e4 100644 --- a/src/src/main/java/com/relewise/client/model/ProductCategoryDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/ProductCategoryDataFilter.java @@ -40,11 +40,11 @@ public ProductCategoryDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static ProductCategoryDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ProductCategoryDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ProductCategoryDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ProductCategoryDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ProductCategoryDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public ProductCategoryDataFilter(String key) this.language = null; this.currency = null; } - public static ProductCategoryDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ProductCategoryDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ProductCategoryDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ProductCategoryDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ProductCategoryDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/ProductCategoryQuery.java b/src/src/main/java/com/relewise/client/model/ProductCategoryQuery.java index eb27d14..c9ca544 100644 --- a/src/src/main/java/com/relewise/client/model/ProductCategoryQuery.java +++ b/src/src/main/java/com/relewise/client/model/ProductCategoryQuery.java @@ -35,11 +35,11 @@ public ProductCategoryQuery() this.language = null; this.currency = null; } - public static ProductCategoryQuery create(@Nullable Language language, Currency currency) + public static ProductCategoryQuery create(@Nullable Language language, @Nullable Currency currency) { return new ProductCategoryQuery(language, currency); } - public ProductCategoryQuery(@Nullable Language language, Currency currency) + public ProductCategoryQuery(@Nullable Language language, @Nullable Currency currency) { this.language = language; this.currency = currency; diff --git a/src/src/main/java/com/relewise/client/model/ProductDataDoubleRangeFacet.java b/src/src/main/java/com/relewise/client/model/ProductDataDoubleRangeFacet.java index 810a26a..2e86ff7 100644 --- a/src/src/main/java/com/relewise/client/model/ProductDataDoubleRangeFacet.java +++ b/src/src/main/java/com/relewise/client/model/ProductDataDoubleRangeFacet.java @@ -26,11 +26,11 @@ public class ProductDataDoubleRangeFacet extends DoubleProductDataRangeFacet { public String $type = "Relewise.Client.DataTypes.Search.Facets.Queries.ProductDataDoubleRangeFacet, Relewise.Client"; - public static ProductDataDoubleRangeFacet create(String key, DataSelectionStrategy dataSelectionStrategy, DoubleRange selected) + public static ProductDataDoubleRangeFacet create(String key, DataSelectionStrategy dataSelectionStrategy, @Nullable DoubleRange selected) { return new ProductDataDoubleRangeFacet(key, dataSelectionStrategy, selected); } - public ProductDataDoubleRangeFacet(String key, DataSelectionStrategy dataSelectionStrategy, DoubleRange selected) + public ProductDataDoubleRangeFacet(String key, DataSelectionStrategy dataSelectionStrategy, @Nullable DoubleRange selected) { this.key = key; this.dataSelectionStrategy = dataSelectionStrategy; diff --git a/src/src/main/java/com/relewise/client/model/ProductDataFilter.java b/src/src/main/java/com/relewise/client/model/ProductDataFilter.java index 430b2e5..4f621f1 100644 --- a/src/src/main/java/com/relewise/client/model/ProductDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/ProductDataFilter.java @@ -40,11 +40,11 @@ public ProductDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static ProductDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ProductDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ProductDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ProductDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ProductDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public ProductDataFilter(String key) this.language = null; this.currency = null; } - public static ProductDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static ProductDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new ProductDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public ProductDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public ProductDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; diff --git a/src/src/main/java/com/relewise/client/model/ProductDisplayNameFilter.java b/src/src/main/java/com/relewise/client/model/ProductDisplayNameFilter.java index 0a26941..2939ac9 100644 --- a/src/src/main/java/com/relewise/client/model/ProductDisplayNameFilter.java +++ b/src/src/main/java/com/relewise/client/model/ProductDisplayNameFilter.java @@ -39,11 +39,11 @@ public ProductDisplayNameFilter(ValueConditionCollection conditions) this.mustMatchAllConditions = true; this.language = null; } - public static ProductDisplayNameFilter create(ValueConditionCollection conditions, Boolean mustMatchAllConditions, Language language) + public static ProductDisplayNameFilter create(ValueConditionCollection conditions, Boolean mustMatchAllConditions, @Nullable Language language) { return new ProductDisplayNameFilter(conditions, mustMatchAllConditions, language); } - public ProductDisplayNameFilter(ValueConditionCollection conditions, Boolean mustMatchAllConditions, Language language) + public ProductDisplayNameFilter(ValueConditionCollection conditions, Boolean mustMatchAllConditions, @Nullable Language language) { this.conditions = conditions; this.mustMatchAllConditions = mustMatchAllConditions; diff --git a/src/src/main/java/com/relewise/client/model/ProductPromotion.java b/src/src/main/java/com/relewise/client/model/ProductPromotion.java index c442f9d..a5dafb3 100644 --- a/src/src/main/java/com/relewise/client/model/ProductPromotion.java +++ b/src/src/main/java/com/relewise/client/model/ProductPromotion.java @@ -28,11 +28,11 @@ public class ProductPromotion extends Promotion public String $type = "Relewise.Client.DataTypes.RetailMedia.ProductPromotion, Relewise.Client"; /** Filters matching the products to be promoted */ public @Nullable FilterCollection filters; - public static ProductPromotion create(String name, @Nullable FilterCollection filters, PromotionLocationCollection locations) + public static ProductPromotion create(String name, @Nullable FilterCollection filters, @Nullable PromotionLocationCollection locations) { return new ProductPromotion(name, filters, locations); } - public ProductPromotion(String name, @Nullable FilterCollection filters, PromotionLocationCollection locations) + public ProductPromotion(String name, @Nullable FilterCollection filters, @Nullable PromotionLocationCollection locations) { this.name = name; this.filters = filters; diff --git a/src/src/main/java/com/relewise/client/model/ProductPromotionSpecification.java b/src/src/main/java/com/relewise/client/model/ProductPromotionSpecification.java index 8e036e1..d59f805 100644 --- a/src/src/main/java/com/relewise/client/model/ProductPromotionSpecification.java +++ b/src/src/main/java/com/relewise/client/model/ProductPromotionSpecification.java @@ -29,11 +29,11 @@ public class ProductPromotionSpecification extends PromotionSpecification public String $type = "Relewise.Client.DataTypes.RetailMedia.ProductPromotion+Specification, Relewise.Client"; /** Filters matching the products which may be promoted */ public @Nullable FilterCollection promotableProducts; - public static ProductPromotionSpecification create(FilterCollection promotableProducts) + public static ProductPromotionSpecification create(@Nullable FilterCollection promotableProducts) { return new ProductPromotionSpecification(promotableProducts); } - public ProductPromotionSpecification(FilterCollection promotableProducts) + public ProductPromotionSpecification(@Nullable FilterCollection promotableProducts) { this.promotableProducts = promotableProducts; } diff --git a/src/src/main/java/com/relewise/client/model/ProductView.java b/src/src/main/java/com/relewise/client/model/ProductView.java index 4e52c2e..c5914b1 100644 --- a/src/src/main/java/com/relewise/client/model/ProductView.java +++ b/src/src/main/java/com/relewise/client/model/ProductView.java @@ -41,11 +41,11 @@ public ProductView(@Nullable User user, Product product) this.product = product; this.variant = null; } - public static ProductView create(@Nullable User user, Product product, ProductVariant variant) + public static ProductView create(@Nullable User user, Product product, @Nullable ProductVariant variant) { return new ProductView(user, product, variant); } - public ProductView(@Nullable User user, Product product, ProductVariant variant) + public ProductView(@Nullable User user, Product product, @Nullable ProductVariant variant) { this.user = user; this.product = product; diff --git a/src/src/main/java/com/relewise/client/model/PromotionLocation.java b/src/src/main/java/com/relewise/client/model/PromotionLocation.java index 25a40c5..507efe0 100644 --- a/src/src/main/java/com/relewise/client/model/PromotionLocation.java +++ b/src/src/main/java/com/relewise/client/model/PromotionLocation.java @@ -31,11 +31,11 @@ public PromotionLocation(String key) this.key = key; this.placements = null; } - public static PromotionLocation create(String key, PromotionLocationPlacementCollection placements) + public static PromotionLocation create(String key, @Nullable PromotionLocationPlacementCollection placements) { return new PromotionLocation(key, placements); } - public PromotionLocation(String key, PromotionLocationPlacementCollection placements) + public PromotionLocation(String key, @Nullable PromotionLocationPlacementCollection placements) { this.key = key; this.placements = placements; diff --git a/src/src/main/java/com/relewise/client/model/RedirectResult.java b/src/src/main/java/com/relewise/client/model/RedirectResult.java index a88cd1f..a085d84 100644 --- a/src/src/main/java/com/relewise/client/model/RedirectResult.java +++ b/src/src/main/java/com/relewise/client/model/RedirectResult.java @@ -24,11 +24,11 @@ public class RedirectResult public SearchTermCondition condition; public @Nullable String destination; public @Nullable HashMap data; - public static RedirectResult create(UUID id, SearchTermCondition condition, @Nullable String destination, HashMap data) + public static RedirectResult create(UUID id, SearchTermCondition condition, @Nullable String destination, @Nullable HashMap data) { return new RedirectResult(id, condition, destination, data); } - public RedirectResult(UUID id, SearchTermCondition condition, @Nullable String destination, HashMap data) + public RedirectResult(UUID id, SearchTermCondition condition, @Nullable String destination, @Nullable HashMap data) { this.id = id; this.condition = condition; diff --git a/src/src/main/java/com/relewise/client/model/RedirectRule.java b/src/src/main/java/com/relewise/client/model/RedirectRule.java index a825b3e..62abeeb 100644 --- a/src/src/main/java/com/relewise/client/model/RedirectRule.java +++ b/src/src/main/java/com/relewise/client/model/RedirectRule.java @@ -29,11 +29,11 @@ public class RedirectRule extends SearchRule public SearchTermCondition condition; public @Nullable String destination; public @Nullable HashMap data; - public static RedirectRule create(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, String destination) + public static RedirectRule create(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, @Nullable String destination) { return new RedirectRule(id, indexes, languages, isApproved, condition, destination); } - public RedirectRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, String destination) + public RedirectRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, @Nullable String destination) { this.id = id; this.indexes = indexes; @@ -43,11 +43,11 @@ public RedirectRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable Appl this.destination = destination; this.data = null; } - public static RedirectRule create(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, @Nullable String destination, HashMap data) + public static RedirectRule create(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, @Nullable String destination, @Nullable HashMap data) { return new RedirectRule(id, indexes, languages, isApproved, condition, destination, data); } - public RedirectRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, @Nullable String destination, HashMap data) + public RedirectRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, SearchTermCondition condition, @Nullable String destination, @Nullable HashMap data) { this.id = id; this.indexes = indexes; diff --git a/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceTermAction.java b/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceTermAction.java index c61284a..6fa325b 100644 --- a/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceTermAction.java +++ b/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceTermAction.java @@ -27,11 +27,11 @@ public class SearchTermModifierRuleReplaceTermAction extends SearchTermModifierR { public String $type = "Relewise.Client.DataTypes.Search.Rules.SearchTermModifierRule+ReplaceTermAction, Relewise.Client"; public @Nullable String replacement; - public static SearchTermModifierRuleReplaceTermAction create(String replacement) + public static SearchTermModifierRuleReplaceTermAction create(@Nullable String replacement) { return new SearchTermModifierRuleReplaceTermAction(replacement); } - public SearchTermModifierRuleReplaceTermAction(String replacement) + public SearchTermModifierRuleReplaceTermAction(@Nullable String replacement) { this.replacement = replacement; } diff --git a/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceWordsInTermAction.java b/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceWordsInTermAction.java index 008630c..fb5b9fe 100644 --- a/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceWordsInTermAction.java +++ b/src/src/main/java/com/relewise/client/model/SearchTermModifierRuleReplaceWordsInTermAction.java @@ -28,11 +28,11 @@ public class SearchTermModifierRuleReplaceWordsInTermAction extends SearchTermMo public String $type = "Relewise.Client.DataTypes.Search.Rules.SearchTermModifierRule+ReplaceWordsInTermAction, Relewise.Client"; public String words; public @Nullable String replacement; - public static SearchTermModifierRuleReplaceWordsInTermAction create(String words, String replacement) + public static SearchTermModifierRuleReplaceWordsInTermAction create(String words, @Nullable String replacement) { return new SearchTermModifierRuleReplaceWordsInTermAction(words, replacement); } - public SearchTermModifierRuleReplaceWordsInTermAction(String words, String replacement) + public SearchTermModifierRuleReplaceWordsInTermAction(String words, @Nullable String replacement) { this.words = words; this.replacement = replacement; diff --git a/src/src/main/java/com/relewise/client/model/SignificantDataValue.java b/src/src/main/java/com/relewise/client/model/SignificantDataValue.java index e12e89f..b51de6d 100644 --- a/src/src/main/java/com/relewise/client/model/SignificantDataValue.java +++ b/src/src/main/java/com/relewise/client/model/SignificantDataValue.java @@ -35,11 +35,11 @@ public SignificantDataValue(String key, SignificantDataValueSignificantDataValue this.significance = 1d; this.transformer = null; } - public static SignificantDataValue create(String key, SignificantDataValueSignificantDataValueComparer comparer, Double significance, TrimStringTransformer transformer) + public static SignificantDataValue create(String key, SignificantDataValueSignificantDataValueComparer comparer, Double significance, @Nullable TrimStringTransformer transformer) { return new SignificantDataValue(key, comparer, significance, transformer); } - public SignificantDataValue(String key, SignificantDataValueSignificantDataValueComparer comparer, Double significance, TrimStringTransformer transformer) + public SignificantDataValue(String key, SignificantDataValueSignificantDataValueComparer comparer, Double significance, @Nullable TrimStringTransformer transformer) { this.key = key; this.comparer = comparer; diff --git a/src/src/main/java/com/relewise/client/model/SimilarProductsRequest.java b/src/src/main/java/com/relewise/client/model/SimilarProductsRequest.java index 897342e..f915a20 100644 --- a/src/src/main/java/com/relewise/client/model/SimilarProductsRequest.java +++ b/src/src/main/java/com/relewise/client/model/SimilarProductsRequest.java @@ -45,11 +45,11 @@ public SimilarProductsRequest(@Nullable Language language, @Nullable Currency cu this.considerAlreadyKnownInformationAboutProduct = considerAlreadyKnownInformationAboutProduct; this.evaluationSettings = null; } - public static SimilarProductsRequest create(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, Product productData, Boolean considerAlreadyKnownInformationAboutProduct, SimilarProductsEvaluationSettings evaluationSettings) + public static SimilarProductsRequest create(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, Product productData, Boolean considerAlreadyKnownInformationAboutProduct, @Nullable SimilarProductsEvaluationSettings evaluationSettings) { return new SimilarProductsRequest(language, currency, displayedAtLocationType, user, productData, considerAlreadyKnownInformationAboutProduct, evaluationSettings); } - public SimilarProductsRequest(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, Product productData, Boolean considerAlreadyKnownInformationAboutProduct, SimilarProductsEvaluationSettings evaluationSettings) + public SimilarProductsRequest(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, Product productData, Boolean considerAlreadyKnownInformationAboutProduct, @Nullable SimilarProductsEvaluationSettings evaluationSettings) { this.language = language; this.currency = currency; @@ -72,11 +72,11 @@ public SimilarProductsRequest(@Nullable Language language, @Nullable Currency cu this.existingProductId = existingProductId; this.evaluationSettings = null; } - public static SimilarProductsRequest create(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, ProductAndVariantId existingProductId, SimilarProductsEvaluationSettings evaluationSettings) + public static SimilarProductsRequest create(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, ProductAndVariantId existingProductId, @Nullable SimilarProductsEvaluationSettings evaluationSettings) { return new SimilarProductsRequest(language, currency, displayedAtLocationType, user, existingProductId, evaluationSettings); } - public SimilarProductsRequest(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, ProductAndVariantId existingProductId, SimilarProductsEvaluationSettings evaluationSettings) + public SimilarProductsRequest(@Nullable Language language, @Nullable Currency currency, String displayedAtLocationType, User user, ProductAndVariantId existingProductId, @Nullable SimilarProductsEvaluationSettings evaluationSettings) { this.language = language; this.currency = currency; diff --git a/src/src/main/java/com/relewise/client/model/StemmingRule.java b/src/src/main/java/com/relewise/client/model/StemmingRule.java index 5a8d4c9..2649719 100644 --- a/src/src/main/java/com/relewise/client/model/StemmingRule.java +++ b/src/src/main/java/com/relewise/client/model/StemmingRule.java @@ -28,11 +28,11 @@ public class StemmingRule extends SearchRule public String $type = "Relewise.Client.DataTypes.Search.Rules.StemmingRule, Relewise.Client"; public String[] words; public @Nullable String stem; - public static StemmingRule create(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, String[] words, String stem) + public static StemmingRule create(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, String[] words, @Nullable String stem) { return new StemmingRule(id, indexes, languages, isApproved, words, stem); } - public StemmingRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, String[] words, String stem) + public StemmingRule(UUID id, @Nullable ApplicableIndexes indexes, @Nullable ApplicableLanguages languages, Boolean isApproved, String[] words, @Nullable String stem) { this.id = id; this.indexes = indexes; diff --git a/src/src/main/java/com/relewise/client/model/User.java b/src/src/main/java/com/relewise/client/model/User.java index 6c04326..78d9604 100644 --- a/src/src/main/java/com/relewise/client/model/User.java +++ b/src/src/main/java/com/relewise/client/model/User.java @@ -47,7 +47,7 @@ public class User * @param identifiers A set of additional ids associated with the user, e.g. ERP customer id, Marketing id, CDP id etc. * @param data Data stored on the user */ - public static User create(@Nullable String authenticatedId, @Nullable String temporaryId, @Nullable String email, @Nullable String fingerprint, @Nullable HashMap classifications, @Nullable HashMap identifiers, HashMap data) + public static User create(@Nullable String authenticatedId, @Nullable String temporaryId, @Nullable String email, @Nullable String fingerprint, @Nullable HashMap classifications, @Nullable HashMap identifiers, @Nullable HashMap data) { return new User(authenticatedId, temporaryId, email, fingerprint, classifications, identifiers, data); } @@ -61,7 +61,7 @@ public static User create(@Nullable String authenticatedId, @Nullable String tem * @param identifiers A set of additional ids associated with the user, e.g. ERP customer id, Marketing id, CDP id etc. * @param data Data stored on the user */ - public User(@Nullable String authenticatedId, @Nullable String temporaryId, @Nullable String email, @Nullable String fingerprint, @Nullable HashMap classifications, @Nullable HashMap identifiers, HashMap data) + public User(@Nullable String authenticatedId, @Nullable String temporaryId, @Nullable String email, @Nullable String fingerprint, @Nullable HashMap classifications, @Nullable HashMap identifiers, @Nullable HashMap data) { this.authenticatedId = authenticatedId; this.temporaryId = temporaryId; diff --git a/src/src/main/java/com/relewise/client/model/VariantDataFilter.java b/src/src/main/java/com/relewise/client/model/VariantDataFilter.java index 7c44da7..e6d6921 100644 --- a/src/src/main/java/com/relewise/client/model/VariantDataFilter.java +++ b/src/src/main/java/com/relewise/client/model/VariantDataFilter.java @@ -40,11 +40,11 @@ public VariantDataFilter(String key, String... objectPath) this.language = null; this.currency = null; } - public static VariantDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static VariantDataFilter create(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new VariantDataFilter(key, objectPath, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public VariantDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public VariantDataFilter(String key, String[] objectPath, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.objectPath = objectPath; @@ -67,11 +67,11 @@ public VariantDataFilter(String key) this.language = null; this.currency = null; } - public static VariantDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public static VariantDataFilter create(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { return new VariantDataFilter(key, conditions, mustMatchAllConditions, filterOutIfKeyIsNotFound, language, currency); } - public VariantDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, Currency currency) + public VariantDataFilter(String key, @Nullable ValueConditionCollection conditions, Boolean mustMatchAllConditions, Boolean filterOutIfKeyIsNotFound, @Nullable Language language, @Nullable Currency currency) { this.key = key; this.conditions = conditions; From f23860bfeb26bf273b09a7e9058233dfe8f67cb2 Mon Sep 17 00:00:00 2001 From: KSGRelewise <119578211+KSGRelewise@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:18:54 +0200 Subject: [PATCH 5/5] Added content example that is used in Docs to tests. --- .../java/com/relewise/client/TrackerTest.java | 116 +++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/src/src/test/java/com/relewise/client/TrackerTest.java b/src/src/test/java/com/relewise/client/TrackerTest.java index f5e0a66..f01e14b 100644 --- a/src/src/test/java/com/relewise/client/TrackerTest.java +++ b/src/src/test/java/com/relewise/client/TrackerTest.java @@ -28,7 +28,8 @@ public void testProductView() throws Exception { assertDoesNotThrow(action); } - private void testDocsSampleProductUpdateWithVariant() throws Exception { + @Test + public void testDocsSampleProductUpdateWithVariant() throws Exception { var tracker = new Tracker(GetDatasetId(), GetApiKey(), "https://api.relewise.com"); // Create a timestamp to distinguish active and inactive entities @@ -193,6 +194,119 @@ private void testDocsSampleProductUpdateWithVariant() throws Exception { tracker.track(BatchedTrackingRequest.create(updates.toArray(new Trackable[updates.size()]))); } + @Test + public void testDocsSampleContentUpdate() throws Exception { + var tracker = new Tracker(GetDatasetId(), GetApiKey(), "https://api.relewise.com"); + + // Create a timestamp to distinguish active and inactive entities + // Read more at + // https://docs.relewise.com/docs/developer/bestpractices/product-integration.html + long importedAtTimestamp = System.currentTimeMillis(); + + // Language can be any string, and doesn't have to be a valid iso-standard. + var english = Language.create("en"); + + var updates = new ArrayList(); + + // Foreach content element that needs to be imported, do the following: + { + // The Id should be some value associated to the content element + // which does not change if titles or similar are changed. + var content = Content.create("Content-ID-01"); + + // We only set the English translation in this example + // but more can be set by parsing more MultilingualValue + // to the Multilingual.create method. + content.setDisplayName(Multilingual.create( + MultilingualValue.create(english, "The English display name")) + ); + + content.addToData("ShortDescription", DataValueFactory.create(Multilingual.create( + MultilingualValue.create( + english, + "The short English description" + ) + ))); + + content.addToCategoryPaths(CategoryPath.create( + CategoryNameAndId.create("23", Multilingual.create( + MultilingualValue.create(english, "Outdoor") + )), + CategoryNameAndId.create("372", Multilingual.create( + MultilingualValue.create(english, "Hiking") + )) + )); + + content.addToData("ImportedAt", DataValueFactory.create(importedAtTimestamp)); + content.addToData("ReadingTimeInMinutes", DataValueFactory.create(3)); + content.addToData("News", DataValueFactory.create(true)); + content.addToData("Badges", DataValueFactory.create("fun", "current season", "some other badge")); + + var contentUpdate = ContentUpdate.create( + content, + ContentUpdateUpdateKind.ReplaceProvidedProperties + ); + + updates.add(contentUpdate); + } + // Foreach content element END + + // If this is a full-import (not delta), disable all non-included content elements + { + // Setting this to false will make it disable all content elements that don't have the "ImportedAt" key. + boolean onlyDisableOldContentElementsThatHaveTheImportedAtKey = true; + + boolean negated = true; + var nonUpdatedContentFilter = FilterCollection.create( + ContentDataFilter.create( + "ImportedAt", + ValueConditionCollection.create().setItems( + EqualsCondition.create(DataValueFactory.create(importedAtTimestamp), negated) + ), + true, + onlyDisableOldContentElementsThatHaveTheImportedAtKey, + null, + null + ) + ); + + var disableContentElementsWithoutNewestTimestamp = ContentAdministrativeAction.create( + Language.UNDEFINED, + Currency.UNDEFINED, + nonUpdatedContentFilter, + ContentAdministrativeActionUpdateKind.Disable + ); + + updates.add(disableContentElementsWithoutNewestTimestamp); + } + + boolean negated = false; + var updatedContentFilter = FilterCollection.create( + ContentDataFilter.create( + "ImportedAt", + ValueConditionCollection.create().setItems( + EqualsCondition.create(DataValueFactory.create(importedAtTimestamp), negated) + ), + true, + true, + null, + null + ) + ); + var enableContentElementsWithNewestTimestamp = ContentAdministrativeAction.create( + Language.UNDEFINED, + Currency.UNDEFINED, + updatedContentFilter, + ContentAdministrativeActionUpdateKind.Enable + ); + + updates.add(enableContentElementsWithNewestTimestamp); + + tracker.track(BatchedTrackingRequest.create( + updates.toArray(new Trackable[updates.size()]) + )); + } + @Test public void testCompactProductUpdateWithVariant() throws Exception { // Create Product by tracking it.