services.EventsService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of courier-java Show documentation
Show all versions of courier-java Show documentation
Java SDK for communicating with the Courier REST API.
package services;
import models.Event;
import models.Events;
import java.io.IOException;
public class EventsService {
private final EventsInterface eventsInterface;
public EventsService() {
eventsInterface = Courier.getRetrofit().create(EventsInterface.class);
}
public Events getEvents(
) throws IOException {
return eventsInterface.getEvents(
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
public Event getEvent(
String eventId
) throws IOException {
return eventsInterface.getEvent(
eventId,
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
public Event putEvent(
String eventId,
Event event
) throws IOException {
return eventsInterface.putEvent(
eventId,
event,
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy