Skip to content

Commit c376ebd

Browse files
committed
feat: Add segments and topics to sub services
1 parent ca5e7c2 commit c376ebd

File tree

4 files changed

+32
-18
lines changed

4 files changed

+32
-18
lines changed

src/main/java/com/resend/services/contactproperties/model/ContactProperty.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public class ContactProperty {
1313
@JsonProperty("key")
1414
private String key;
1515

16-
@JsonProperty("object")
17-
private String object;
16+
@JsonProperty("display_name")
17+
private String displayName;
1818

1919
@JsonProperty("created_at")
2020
private String createdAt;
@@ -37,15 +37,15 @@ public ContactProperty() {
3737
*
3838
* @param id The ID of the contact property.
3939
* @param key The key of the contact property.
40-
* @param object The object type of the contact property.
40+
* @param displayName The display name of the contact property.
4141
* @param createdAt The creation timestamp of the contact property.
4242
* @param type The type of the contact property.
4343
* @param fallbackValue The fallback value of the contact property.
4444
*/
45-
public ContactProperty(final String id, final String key, final String object, final String createdAt, final String type, final Object fallbackValue) {
45+
public ContactProperty(final String id, final String key, final String displayName, final String createdAt, final String type, final String fallbackValue) {
4646
this.id = id;
4747
this.key = key;
48-
this.object = object;
48+
this.displayName = displayName;
4949
this.createdAt = createdAt;
5050
this.type = type;
5151
this.fallbackValue = fallbackValue;
@@ -70,12 +70,12 @@ public String getKey() {
7070
}
7171

7272
/**
73-
* Gets the object type of the contact property.
73+
* Gets the display name of the contact property.
7474
*
75-
* @return The object type of the contact property.
75+
* @return The display name of the contact property.
7676
*/
77-
public String getObject() {
78-
return object;
77+
public String getDisplayName() {
78+
return displayName;
7979
}
8080

8181
/**

src/main/java/com/resend/services/contactproperties/model/CreateContactPropertyOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class CreateContactPropertyOptions {
1414
private final String type;
1515

1616
@JsonProperty("fallback_value")
17-
private final Object fallbackValue;
17+
private final String fallbackValue;
1818

1919
/**
2020
* Constructs a CreateContactPropertyOptions object using the provided builder.
@@ -69,7 +69,7 @@ public static Builder builder() {
6969
public static class Builder {
7070
private String key;
7171
private String type;
72-
private Object fallbackValue;
72+
private String fallbackValue;
7373

7474
/**
7575
* Set the key of the contact property.
@@ -99,7 +99,7 @@ public Builder type(String type) {
9999
* @param fallbackValue The fallback value of the contact property.
100100
* @return The builder instance.
101101
*/
102-
public Builder fallbackValue(Object fallbackValue) {
102+
public Builder fallbackValue(String fallbackValue) {
103103
this.fallbackValue = fallbackValue;
104104
return this;
105105
}

src/main/java/com/resend/services/contactproperties/model/ListContactPropertiesResponseSuccess.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class ListContactPropertiesResponseSuccess {
1414
@JsonProperty("object")
1515
private String object;
1616

17+
@JsonProperty("has_more")
18+
private Boolean hasMore;
19+
1720
/**
1821
* Default constructor
1922
*/
@@ -25,10 +28,12 @@ public ListContactPropertiesResponseSuccess() {
2528
*
2629
* @param data The list of contact properties.
2730
* @param object The object type.
31+
* @param hasMore Indicate if there are more items to be returned.
2832
*/
29-
public ListContactPropertiesResponseSuccess(final List<ContactProperty> data, final String object) {
33+
public ListContactPropertiesResponseSuccess(final List<ContactProperty> data, final String object, final Boolean hasMore) {
3034
this.data = data;
3135
this.object = object;
36+
this.hasMore = hasMore;
3237
}
3338

3439
/**
@@ -49,4 +54,13 @@ public String getObject() {
4954
return object;
5055
}
5156

57+
/**
58+
* Gets the indicator whether there are more items available for pagination.
59+
*
60+
* @return Whether there are more items available for pagination.
61+
*/
62+
public Boolean hasMore() {
63+
return hasMore;
64+
}
65+
5266
}

src/test/java/com/resend/services/util/ContactPropertiesUtil.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static CreateContactPropertyOptions createContactPropertyRequest() {
1111
return CreateContactPropertyOptions.builder()
1212
.key("age")
1313
.type("number")
14-
.fallbackValue(25)
14+
.fallbackValue("25")
1515
.build();
1616
}
1717

@@ -41,21 +41,21 @@ public static ContactProperty getContactProperty() {
4141
"contact_property",
4242
"2023-04-08T00:11:13.110779+00:00",
4343
"number",
44-
25
44+
"25"
4545
);
4646
}
4747

4848
public static ListContactPropertiesResponseSuccess createContactPropertiesListResponse() {
4949
List<ContactProperty> properties = new ArrayList<>();
5050

51-
ContactProperty p1 = new ContactProperty("1", "age", "contact_property", "2023-04-08T00:11:13.110779+00:00", "number", 25);
51+
ContactProperty p1 = new ContactProperty("1", "age", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "25");
5252
ContactProperty p2 = new ContactProperty("2", "city", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "New York");
53-
ContactProperty p3 = new ContactProperty("3", "subscribed", "contact_property", "2023-04-08T00:11:13.110779+00:00", "boolean", true);
53+
ContactProperty p3 = new ContactProperty("3", "subscribed", "contact_property", "2023-04-08T00:11:13.110779+00:00", "string", "fallback");
5454

5555
properties.add(p1);
5656
properties.add(p2);
5757
properties.add(p3);
5858

59-
return new ListContactPropertiesResponseSuccess(properties, "list");
59+
return new ListContactPropertiesResponseSuccess(properties, "list", false);
6060
}
6161
}

0 commit comments

Comments
 (0)