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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.smatechnologies</groupId>
<artifactId>opcon-rest-api-client</artifactId>
<version>1.0.5</version>
<version>1.0.6</version>

<name>SMA OpCon Library Rest Api Client</name>
<description>SMA OpCon Library Rest Api Client</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.smatechnologies.opcon.restapiclient.WsException;
import com.smatechnologies.opcon.restapiclient.WsFactory;
import com.smatechnologies.opcon.restapiclient.WsResult;
import com.smatechnologies.opcon.restapiclient.api.dailyjobs.incidentTickets.WsDailyJobsIncidentTickets;
import com.smatechnologies.opcon.restapiclient.api.dailyschedules.properties.WsDailySchedulesProperties;
import com.smatechnologies.opcon.restapiclient.model.JobDailyStatusCount;
import com.smatechnologies.opcon.restapiclient.model.dailyjob.DailyJob;

Expand Down Expand Up @@ -62,4 +64,9 @@ public DailyJob put(DailyJob dailyJob) throws WsException {

return wsFactory.create(Ws.Type.PUT, dailyJob).path(id).run(DailyJob.class);
}

public WsDailyJobsIncidentTickets incidentTickets(String dailyJobUid) {
return new WsDailyJobsIncidentTickets(wsFactory.path(dailyJobUid));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.smatechnologies.opcon.restapiclient.api.dailyjobs.incidentTickets;

import java.util.List;
import java.util.Objects;

import com.smatechnologies.opcon.restapiclient.Ws;
import com.smatechnologies.opcon.restapiclient.WsException;
import com.smatechnologies.opcon.restapiclient.WsFactory;
import com.smatechnologies.opcon.restapiclient.model.dailyjob.IncidentTicketDailyJob;

import javax.ws.rs.core.GenericType;

public class WsDailyJobsIncidentTickets {

private final WsFactory wsFactory;

public WsDailyJobsIncidentTickets(WsFactory wsFactory) {
this.wsFactory = wsFactory.path("incidentTickets");
}

public List<IncidentTicketDailyJob> get() throws WsException {
return wsFactory.create(Ws.Type.GET).run(new GenericType<List<IncidentTicketDailyJob>>() {
});
}

public IncidentTicketDailyJob put(IncidentTicketDailyJob incidentTicketDailyJob) throws WsException {
Objects.requireNonNull(incidentTicketDailyJob, "IncidentTicketDailyJob cannot be null");
String id = Objects.requireNonNull(incidentTicketDailyJob.getId(), "Id cannot be null");

return wsFactory.create(Ws.Type.PUT, incidentTicketDailyJob).path(id).run(IncidentTicketDailyJob.class);
}

public IncidentTicketDailyJob post(IncidentTicketDailyJob incidentTicketDailyJob) throws WsException {
Objects.requireNonNull(incidentTicketDailyJob, "IncidentTicketDailyJob cannot be null");

return wsFactory.create(Ws.Type.POST, incidentTicketDailyJob).run(IncidentTicketDailyJob.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.smatechnologies.opcon.restapiclient.model.dailyjob;

import java.util.Objects;

public class IncidentTicketDailyJob {

public static final String RESOURCE = "incidentTickets";

public static final String PROPERTY_ID = "id";
public static final String PROPERTY_TICKET_ID = "ticketId";
public static final String PROPERTY_TICKET_URL = "ticketUrl";

private String id;
private String ticketId;
private String ticketUrl;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getTicketId() {
return ticketId;
}

public void setTicketId(String ticketId) {
this.ticketId = ticketId;
}

public String getTicketUrl() {
return ticketUrl;
}

public void setTicketUrl(String ticketUrl) {
this.ticketUrl = ticketUrl;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
IncidentTicketDailyJob that = (IncidentTicketDailyJob) o;
return Objects.equals(id, that.id) &&
Objects.equals(ticketId, that.ticketId) &&
Objects.equals(ticketUrl, that.ticketUrl);
}

@Override
public int hashCode() {
return Objects.hash(id, ticketId, ticketUrl);
}

}