Skip to content

Commit

Permalink
CalendarEvent.repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUmbrella committed Jun 15, 2023
1 parent e5f6bc3 commit 78d7a1a
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class CalendarEvent
private int id;
private String serverId, channelId, name, description, location, url, startsAt, createdAt, createdBy;
private Integer color, duration;
private Boolean isPrivate;
private Boolean isPrivate, repeats;
private Mention[] mentions;
private CalendarEventCancellation cancellation;

Expand Down Expand Up @@ -49,6 +49,7 @@ public static CalendarEvent fromJSON(JSONObject json)
.setLocation(json.getStr("location"))
.setUrl(json.getStr("url"))
.setColor(json.getInt("color"))
.setRepeats(json.getBool("repeats"))
.setStartsAt(json.getStr("startsAt"))
.setDuration(json.getInt("duration"))
.setIsPrivate(json.getBool("isPrivate"))
Expand Down Expand Up @@ -146,6 +147,17 @@ public CalendarEvent setColor(Integer color)
return this;
}

/**
* Is this event a repeating event?
*/
public boolean isRepeating(){return repeats != null && repeats;}

public CalendarEvent setRepeats(Boolean repeats)
{
this.repeats = repeats;
return this;
}

/**
* Get the ISO 8601 timestamp that the event starts at.
*/
Expand All @@ -171,7 +183,7 @@ public CalendarEvent setDuration(Integer duration)
/**
* No description available in API documentation.
*/
public Boolean getIsPrivate(){return isPrivate;}
public boolean isPrivate(){return isPrivate != null && isPrivate;}

public CalendarEvent setIsPrivate(Boolean isPrivate)
{
Expand Down Expand Up @@ -236,6 +248,7 @@ public String toString()
.set("location", location)
.set("url", url)
.set("color", color)
.set("repeats", repeats)
.set("startsAt", startsAt)
.set("duration", duration)
.set("isPrivate", isPrivate)
Expand Down

0 comments on commit 78d7a1a

Please sign in to comment.