Skip to content

Commit

Permalink
fixes #57
Browse files Browse the repository at this point in the history
  • Loading branch information
Bindambc committed Mar 25, 2023
1 parent 7d68b34 commit ad7cdae
Show file tree
Hide file tree
Showing 6 changed files with 445 additions and 158 deletions.
191 changes: 191 additions & 0 deletions src/main/java/com/whatsapp/api/domain/messages/DateTime.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
package com.whatsapp.api.domain.messages;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.whatsapp.api.domain.messages.type.CalendarType;

/**
* The type Date time.
*/
@JsonInclude(Include.NON_NULL)
public class DateTime {

@JsonProperty("fallback_value")
private String fallbackValue;
@JsonProperty("calendar")
private CalendarType calendar;
@JsonProperty("month")
private Integer month;
@JsonProperty("hour")
private Integer hour;
@JsonProperty("year")
private Integer year;
@JsonProperty("day_of_month")
private Integer dayOfMonth;
@JsonProperty("day_of_week")
private Integer dayOfWeek;
@JsonProperty("minute")
private Integer minute;


/**
* Gets fallback value.
*
* @return the fallback value
*/
public String getFallbackValue() {
return fallbackValue;
}

/**
* Sets fallback value.
*
* @param fallbackValue the fallback value
* @return the fallback value
*/
public DateTime setFallbackValue(String fallbackValue) {
this.fallbackValue = fallbackValue;
return this;
}

/**
* Gets calendar.
*
* @return the calendar
*/
public CalendarType getCalendar() {
return calendar;
}

/**
* Sets calendar.
*
* @param calendar the calendar
* @return the calendar
*/
public DateTime setCalendar(CalendarType calendar) {
this.calendar = calendar;
return this;
}

/**
* Gets month.
*
* @return the month
*/
public Integer getMonth() {
return month;
}

/**
* Sets month.
*
* @param month the month
* @return the month
*/
public DateTime setMonth(Integer month) {
this.month = month;
return this;
}

/**
* Gets hour.
*
* @return the hour
*/
public Integer getHour() {
return hour;
}

/**
* Sets hour.
*
* @param hour the hour
* @return the hour
*/
public DateTime setHour(Integer hour) {
this.hour = hour;
return this;
}

/**
* Gets year.
*
* @return the year
*/
public Integer getYear() {
return year;
}

/**
* Sets year.
*
* @param year the year
* @return the year
*/
public DateTime setYear(Integer year) {
this.year = year;
return this;
}

/**
* Gets day of month.
*
* @return the day of month
*/
public Integer getDayOfMonth() {
return dayOfMonth;
}

/**
* Sets day of month.
*
* @param dayOfMonth the day of month
* @return the day of month
*/
public DateTime setDayOfMonth(Integer dayOfMonth) {
this.dayOfMonth = dayOfMonth;
return this;
}

/**
* Gets day of week.
*
* @return the day of week
*/
public Integer getDayOfWeek() {
return dayOfWeek;
}

/**
* Sets day of week.
*
* @param dayOfWeek the day of week
* @return the day of week
*/
public DateTime setDayOfWeek(Integer dayOfWeek) {
this.dayOfWeek = dayOfWeek;
return this;
}

/**
* Gets minute.
*
* @return the minute
*/
public Integer getMinute() {
return minute;
}

/**
* Sets minute.
*
* @param minute the minute
* @return the minute
*/
public DateTime setMinute(Integer minute) {
this.minute = minute;
return this;
}
}
176 changes: 18 additions & 158 deletions src/main/java/com/whatsapp/api/domain/messages/DateTimeParameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,10 @@
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DateTimeParameter extends Parameter {
@JsonProperty("fallback_value")
private String fallbackValue;
@JsonProperty("calendar")
private String calendar;
@JsonProperty("month")
private int month;
@JsonProperty("hour")
private int hour;
@JsonProperty("year")
private int year;
@JsonProperty("day_of_month")
private int dayOfMonth;
@JsonProperty("day_of_week")
private int dayOfWeek;
@JsonProperty("minute")
private int minute;

@JsonProperty("date_time")
private DateTime dateTime;


/**
* Instantiates a new Date time parameter.
Expand All @@ -33,163 +21,35 @@ public DateTimeParameter() {
super(ParameterType.DATE_TIME);
}

/**
* Gets fallback value.
*
* @return the fallback value
*/
public String getFallbackValue() {
return fallbackValue;
}

/**
* Sets fallback value.
*
* @param fallbackValue the fallback value
* @return the fallback value
*/
public DateTimeParameter setFallbackValue(String fallbackValue) {
this.fallbackValue = fallbackValue;
return this;
}

/**
* Gets calendar.
*
* @return the calendar
*/
public String getCalendar() {
return calendar;
}

/**
* Sets calendar.
*
* @param calendar the calendar
* @return the calendar
*/
public DateTimeParameter setCalendar(String calendar) {
this.calendar = calendar;
return this;
}

/**
* Gets month.
*
* @return the month
*/
public int getMonth() {
return month;
}

/**
* Sets month.
*
* @param month the month
* @return the month
*/
public DateTimeParameter setMonth(int month) {
this.month = month;
return this;
}

/**
* Gets hour.
*
* @return the hour
*/
public int getHour() {
return hour;
}

/**
* Sets hour.
*
* @param hour the hour
* @return the hour
*/
public DateTimeParameter setHour(int hour) {
this.hour = hour;
return this;
}

/**
* Gets year.
*
* @return the year
*/
public int getYear() {
return year;
}

/**
* Sets year.
*
* @param year the year
* @return the year
*/
public DateTimeParameter setYear(int year) {
this.year = year;
return this;
}

/**
* Gets day of month.
*
* @return the day of month
*/
public int getDayOfMonth() {
return dayOfMonth;
}

/**
* Sets day of month.
*
* @param dayOfMonth the day of month
* @return the day of month
*/
public DateTimeParameter setDayOfMonth(int dayOfMonth) {
this.dayOfMonth = dayOfMonth;
return this;
}

/**
* Gets day of week.
* Instantiates a new Date time parameter.
*
* @return the day of week
* @param dateTime the date time
*/
public int getDayOfWeek() {
return dayOfWeek;
}
public DateTimeParameter(DateTime dateTime) {
super(ParameterType.DATE_TIME);

/**
* Sets day of week.
*
* @param dayOfWeek the day of week
* @return the day of week
*/
public DateTimeParameter setDayOfWeek(int dayOfWeek) {
this.dayOfWeek = dayOfWeek;
return this;
this.dateTime = dateTime;
}

/**
* Gets minute.
* Gets date time.
*
* @return the minute
* @return the date time
*/
public int getMinute() {
return minute;
public DateTime getDateTime() {
return dateTime;
}

/**
* Sets minute.
* Sets date time.
*
* @param minute the minute
* @return the minute
* @param dateTime the date time
* @return the date time
*/
public DateTimeParameter setMinute(int minute) {
this.minute = minute;
public DateTimeParameter setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
}
Loading

0 comments on commit ad7cdae

Please sign in to comment.