From c376ebd3036f572debb61525d6985ab6036efb9c Mon Sep 17 00:00:00 2001 From: Kewyn Akshlley Date: Fri, 31 Oct 2025 11:46:25 -0300 Subject: [PATCH 1/3] feat: Add segments and topics to sub services --- .../model/ContactProperty.java | 18 +++++++++--------- .../model/CreateContactPropertyOptions.java | 6 +++--- .../ListContactPropertiesResponseSuccess.java | 16 +++++++++++++++- .../services/util/ContactPropertiesUtil.java | 10 +++++----- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java b/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java index 1c36f83..f54889a 100644 --- a/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java +++ b/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java @@ -13,8 +13,8 @@ public class ContactProperty { @JsonProperty("key") private String key; - @JsonProperty("object") - private String object; + @JsonProperty("display_name") + private String displayName; @JsonProperty("created_at") private String createdAt; @@ -37,15 +37,15 @@ public ContactProperty() { * * @param id The ID of the contact property. * @param key The key of the contact property. - * @param object The object type of the contact property. + * @param displayName The display name of the contact property. * @param createdAt The creation timestamp of the contact property. * @param type The type of the contact property. * @param fallbackValue The fallback value of the contact property. */ - public ContactProperty(final String id, final String key, final String object, final String createdAt, final String type, final Object fallbackValue) { + public ContactProperty(final String id, final String key, final String displayName, final String createdAt, final String type, final String fallbackValue) { this.id = id; this.key = key; - this.object = object; + this.displayName = displayName; this.createdAt = createdAt; this.type = type; this.fallbackValue = fallbackValue; @@ -70,12 +70,12 @@ public String getKey() { } /** - * Gets the object type of the contact property. + * Gets the display name of the contact property. * - * @return The object type of the contact property. + * @return The display name of the contact property. */ - public String getObject() { - return object; + public String getDisplayName() { + return displayName; } /** diff --git a/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java b/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java index 5d30c25..efbbeb0 100644 --- a/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java +++ b/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java @@ -14,7 +14,7 @@ public class CreateContactPropertyOptions { private final String type; @JsonProperty("fallback_value") - private final Object fallbackValue; + private final String fallbackValue; /** * Constructs a CreateContactPropertyOptions object using the provided builder. @@ -69,7 +69,7 @@ public static Builder builder() { public static class Builder { private String key; private String type; - private Object fallbackValue; + private String fallbackValue; /** * Set the key of the contact property. @@ -99,7 +99,7 @@ public Builder type(String type) { * @param fallbackValue The fallback value of the contact property. * @return The builder instance. */ - public Builder fallbackValue(Object fallbackValue) { + public Builder fallbackValue(String fallbackValue) { this.fallbackValue = fallbackValue; return this; } diff --git a/src/main/java/com/resend/services/contactproperties/model/ListContactPropertiesResponseSuccess.java b/src/main/java/com/resend/services/contactproperties/model/ListContactPropertiesResponseSuccess.java index 5d28e56..ff55aa5 100644 --- a/src/main/java/com/resend/services/contactproperties/model/ListContactPropertiesResponseSuccess.java +++ b/src/main/java/com/resend/services/contactproperties/model/ListContactPropertiesResponseSuccess.java @@ -14,6 +14,9 @@ public class ListContactPropertiesResponseSuccess { @JsonProperty("object") private String object; + @JsonProperty("has_more") + private Boolean hasMore; + /** * Default constructor */ @@ -25,10 +28,12 @@ public ListContactPropertiesResponseSuccess() { * * @param data The list of contact properties. * @param object The object type. + * @param hasMore Indicate if there are more items to be returned. */ - public ListContactPropertiesResponseSuccess(final List data, final String object) { + public ListContactPropertiesResponseSuccess(final List data, final String object, final Boolean hasMore) { this.data = data; this.object = object; + this.hasMore = hasMore; } /** @@ -49,4 +54,13 @@ public String getObject() { return object; } + /** + * Gets the indicator whether there are more items available for pagination. + * + * @return Whether there are more items available for pagination. + */ + public Boolean hasMore() { + return hasMore; + } + } diff --git a/src/test/java/com/resend/services/util/ContactPropertiesUtil.java b/src/test/java/com/resend/services/util/ContactPropertiesUtil.java index 36082a6..4626b97 100644 --- a/src/test/java/com/resend/services/util/ContactPropertiesUtil.java +++ b/src/test/java/com/resend/services/util/ContactPropertiesUtil.java @@ -11,7 +11,7 @@ public static CreateContactPropertyOptions createContactPropertyRequest() { return CreateContactPropertyOptions.builder() .key("age") .type("number") - .fallbackValue(25) + .fallbackValue("25") .build(); } @@ -41,21 +41,21 @@ public static ContactProperty getContactProperty() { "contact_property", "2023-04-08T00:11:13.110779+00:00", "number", - 25 + "25" ); } public static ListContactPropertiesResponseSuccess createContactPropertiesListResponse() { List properties = new ArrayList<>(); - ContactProperty p1 = new ContactProperty("1", "age", "contact_property", "2023-04-08T00:11:13.110779+00:00", "number", 25); + ContactProperty p1 = new ContactProperty("1", "age", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "25"); ContactProperty p2 = new ContactProperty("2", "city", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "New York"); - ContactProperty p3 = new ContactProperty("3", "subscribed", "contact_property", "2023-04-08T00:11:13.110779+00:00", "boolean", true); + ContactProperty p3 = new ContactProperty("3", "subscribed", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "fallback"); properties.add(p1); properties.add(p2); properties.add(p3); - return new ListContactPropertiesResponseSuccess(properties, "list"); + return new ListContactPropertiesResponseSuccess(properties, "list", false); } } From 9b42d2ca89bd18f4e650b58861fae40b3564371d Mon Sep 17 00:00:00 2001 From: Kewyn Akshlley Date: Fri, 31 Oct 2025 12:14:20 -0300 Subject: [PATCH 2/3] fix: remove display name --- .../model/ContactProperty.java | 20 +++---------------- .../services/util/ContactPropertiesUtil.java | 7 +++---- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java b/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java index f54889a..aee0e84 100644 --- a/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java +++ b/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java @@ -13,9 +13,6 @@ public class ContactProperty { @JsonProperty("key") private String key; - @JsonProperty("display_name") - private String displayName; - @JsonProperty("created_at") private String createdAt; @@ -23,7 +20,7 @@ public class ContactProperty { private String type; @JsonProperty("fallback_value") - private Object fallbackValue; + private String fallbackValue; /** * Default constructor @@ -37,15 +34,13 @@ public ContactProperty() { * * @param id The ID of the contact property. * @param key The key of the contact property. - * @param displayName The display name of the contact property. * @param createdAt The creation timestamp of the contact property. * @param type The type of the contact property. * @param fallbackValue The fallback value of the contact property. */ - public ContactProperty(final String id, final String key, final String displayName, final String createdAt, final String type, final String fallbackValue) { + public ContactProperty(final String id, final String key, final String createdAt, final String type, final String fallbackValue) { this.id = id; this.key = key; - this.displayName = displayName; this.createdAt = createdAt; this.type = type; this.fallbackValue = fallbackValue; @@ -69,15 +64,6 @@ public String getKey() { return key; } - /** - * Gets the display name of the contact property. - * - * @return The display name of the contact property. - */ - public String getDisplayName() { - return displayName; - } - /** * Gets the creation timestamp of the contact property. * @@ -101,7 +87,7 @@ public String getType() { * * @return The fallback value of the contact property. */ - public Object getFallbackValue() { + public String getFallbackValue() { return fallbackValue; } } diff --git a/src/test/java/com/resend/services/util/ContactPropertiesUtil.java b/src/test/java/com/resend/services/util/ContactPropertiesUtil.java index 4626b97..ee30a0c 100644 --- a/src/test/java/com/resend/services/util/ContactPropertiesUtil.java +++ b/src/test/java/com/resend/services/util/ContactPropertiesUtil.java @@ -38,7 +38,6 @@ public static ContactProperty getContactProperty() { return new ContactProperty( "123", "age", - "contact_property", "2023-04-08T00:11:13.110779+00:00", "number", "25" @@ -48,9 +47,9 @@ public static ContactProperty getContactProperty() { public static ListContactPropertiesResponseSuccess createContactPropertiesListResponse() { List properties = new ArrayList<>(); - ContactProperty p1 = new ContactProperty("1", "age", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "25"); - ContactProperty p2 = new ContactProperty("2", "city", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "New York"); - ContactProperty p3 = new ContactProperty("3", "subscribed", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "fallback"); + ContactProperty p1 = new ContactProperty("1", "age", "2023-04-08T00:11:13.110779+00:00", "string", "25"); + ContactProperty p2 = new ContactProperty("2", "city", "2023-04-08T00:11:13.110779+00:00", "string", "New York"); + ContactProperty p3 = new ContactProperty("3", "subscribed", "2023-04-08T00:11:13.110779+00:00", "string", "fallback"); properties.add(p1); properties.add(p2); From b68ff66b873ce5779d717e566db99e2b095f68b2 Mon Sep 17 00:00:00 2001 From: Kewyn Akshlley Date: Fri, 31 Oct 2025 12:31:02 -0300 Subject: [PATCH 3/3] fix: fallback type consistency --- .../services/contactproperties/model/ContactProperty.java | 6 +++--- .../model/CreateContactPropertyOptions.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java b/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java index aee0e84..197313c 100644 --- a/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java +++ b/src/main/java/com/resend/services/contactproperties/model/ContactProperty.java @@ -20,7 +20,7 @@ public class ContactProperty { private String type; @JsonProperty("fallback_value") - private String fallbackValue; + private Object fallbackValue; /** * Default constructor @@ -38,7 +38,7 @@ public ContactProperty() { * @param type The type of the contact property. * @param fallbackValue The fallback value of the contact property. */ - public ContactProperty(final String id, final String key, final String createdAt, final String type, final String fallbackValue) { + public ContactProperty(final String id, final String key, final String createdAt, final String type, final Object fallbackValue) { this.id = id; this.key = key; this.createdAt = createdAt; @@ -87,7 +87,7 @@ public String getType() { * * @return The fallback value of the contact property. */ - public String getFallbackValue() { + public Object getFallbackValue() { return fallbackValue; } } diff --git a/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java b/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java index efbbeb0..5d30c25 100644 --- a/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java +++ b/src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java @@ -14,7 +14,7 @@ public class CreateContactPropertyOptions { private final String type; @JsonProperty("fallback_value") - private final String fallbackValue; + private final Object fallbackValue; /** * Constructs a CreateContactPropertyOptions object using the provided builder. @@ -69,7 +69,7 @@ public static Builder builder() { public static class Builder { private String key; private String type; - private String fallbackValue; + private Object fallbackValue; /** * Set the key of the contact property. @@ -99,7 +99,7 @@ public Builder type(String type) { * @param fallbackValue The fallback value of the contact property. * @return The builder instance. */ - public Builder fallbackValue(String fallbackValue) { + public Builder fallbackValue(Object fallbackValue) { this.fallbackValue = fallbackValue; return this; }