Skip to content

Commit 45b7783

Browse files
authored
Merge pull request #47 from Bertievh/feature/WsDailySchedulesProperties
Feature/ws daily schedules properties
2 parents 27b3a97 + b25e0d9 commit 45b7783

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/main/java/com/smatechnologies/opcon/restapiclient/api/dailyschedules/WsDailySchedules.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.smatechnologies.opcon.restapiclient.WsFactory;
66
import com.smatechnologies.opcon.restapiclient.WsResult;
77
import com.smatechnologies.opcon.restapiclient.api.dailyschedules.dates.WsDates;
8+
import com.smatechnologies.opcon.restapiclient.api.dailyschedules.properties.WsDailySchedulesProperties;
89
import com.smatechnologies.opcon.restapiclient.model.DailySchedule;
910
import com.smatechnologies.opcon.restapiclient.model.ScheduleDailyStatusCount;
1011

@@ -59,4 +60,9 @@ public DailySchedule get(String dailyScheduleId) throws WsException {
5960
public ScheduleDailyStatusCount countByStatus(DailySchedulesCriteria criteria) throws WsException {
6061
return wsFactory.create(Ws.Type.GET).path("count_by_status").criteria(criteria).run(ScheduleDailyStatusCount.class);
6162
}
63+
64+
public WsDailySchedulesProperties properties(String dailyScheduleId) {
65+
return new WsDailySchedulesProperties(wsFactory.path(dailyScheduleId));
66+
}
67+
6268
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.smatechnologies.opcon.restapiclient.api.dailyschedules.properties;
2+
3+
import com.smatechnologies.opcon.commons.util.HtmlUtil;
4+
import com.smatechnologies.opcon.restapiclient.Ws;
5+
import com.smatechnologies.opcon.restapiclient.WsException;
6+
import com.smatechnologies.opcon.restapiclient.WsFactory;
7+
import com.smatechnologies.opcon.restapiclient.model.Property;
8+
9+
import javax.ws.rs.core.GenericType;
10+
import java.util.List;
11+
12+
public class WsDailySchedulesProperties {
13+
14+
private final WsFactory wsFactory;
15+
16+
public WsDailySchedulesProperties(WsFactory wsFactory) {
17+
this.wsFactory = wsFactory.path("properties");
18+
}
19+
20+
public List<Property> get() throws WsException {
21+
return wsFactory.create(Ws.Type.GET).run(new GenericType<List<Property>>() {
22+
23+
});
24+
}
25+
26+
public Property get(String name) throws WsException {
27+
return wsFactory.create(Ws.Type.GET).path(HtmlUtil.doubleUrlEncodeSlash(name)).run(Property.class);
28+
}
29+
30+
}

0 commit comments

Comments
 (0)