42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package com.thebrokenrail.mtudining.api.method;
|
|
|
|
import com.thebrokenrail.mtudining.api.Method;
|
|
import com.thebrokenrail.mtudining.util.DateUtil;
|
|
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* API call used to list available "periods" (Breakfast, Lunch, etc).
|
|
*/
|
|
public class Periods implements Method<Periods.Response> {
|
|
private final int platform;
|
|
private final String locationId;
|
|
private final String date;
|
|
|
|
public Periods(int platform, String locationId, Date date) {
|
|
this.platform = platform;
|
|
this.locationId = locationId;
|
|
this.date = DateUtil.toString(date);
|
|
}
|
|
|
|
@Override
|
|
public String getPath() {
|
|
return "/location/" + locationId + "/periods?platform=" + platform + "&date=" + date;
|
|
}
|
|
|
|
@Override
|
|
public Class<Response> getResponseClass() {
|
|
return Response.class;
|
|
}
|
|
|
|
public static class Response {
|
|
public static class Period {
|
|
public String id;
|
|
public int sort_order;
|
|
public String name;
|
|
}
|
|
public List<Period> periods;
|
|
}
|
|
}
|