Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public class ContactProperty {
@JsonProperty("key")
private String key;

@JsonProperty("object")
private String object;

@JsonProperty("created_at")
private String createdAt;

Expand All @@ -37,15 +34,13 @@ 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 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 createdAt, final String type, final Object fallbackValue) {
this.id = id;
this.key = key;
this.object = object;
this.createdAt = createdAt;
this.type = type;
this.fallbackValue = fallbackValue;
Expand All @@ -69,15 +64,6 @@ public String getKey() {
return key;
}

/**
* Gets the object type of the contact property.
*
* @return The object type of the contact property.
*/
public String getObject() {
return object;
}

/**
* Gets the creation timestamp of the contact property.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class ListContactPropertiesResponseSuccess {
@JsonProperty("object")
private String object;

@JsonProperty("has_more")
private Boolean hasMore;

/**
* Default constructor
*/
Expand All @@ -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<ContactProperty> data, final String object) {
public ListContactPropertiesResponseSuccess(final List<ContactProperty> data, final String object, final Boolean hasMore) {
this.data = data;
this.object = object;
this.hasMore = hasMore;
}

/**
Expand All @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static CreateContactPropertyOptions createContactPropertyRequest() {
return CreateContactPropertyOptions.builder()
.key("age")
.type("number")
.fallbackValue(25)
.fallbackValue("25")
.build();
}

Expand All @@ -38,24 +38,23 @@ public static ContactProperty getContactProperty() {
return new ContactProperty(
"123",
"age",
"contact_property",
"2023-04-08T00:11:13.110779+00:00",
"number",
25
"25"
);
}

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

ContactProperty p1 = new ContactProperty("1", "age", "contact_property", "2023-04-08T00:11:13.110779+00:00", "number", 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 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);
properties.add(p3);

return new ListContactPropertiesResponseSuccess(properties, "list");
return new ListContactPropertiesResponseSuccess(properties, "list", false);
}
}