Added rate limit information
This commit is contained in:
@@ -7,9 +7,12 @@ package de.svenkubiak.jpushover.http;
|
||||
*/
|
||||
public class PushoverResponse {
|
||||
private String pushoverResponse;
|
||||
private int pushoverHttpStatus;
|
||||
private boolean pushoverSuccessful;
|
||||
|
||||
private int pushoverHttpStatus;
|
||||
private long pushoverLimit;
|
||||
private long pushoverRemaining;
|
||||
private long pushoverReset;
|
||||
|
||||
public PushoverResponse response(String response) {
|
||||
this.pushoverResponse = response;
|
||||
return this;
|
||||
@@ -24,6 +27,21 @@ public class PushoverResponse {
|
||||
this.pushoverSuccessful = successful;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PushoverResponse limit(long limit) {
|
||||
this.pushoverLimit = limit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PushoverResponse remaining(long remaining) {
|
||||
this.pushoverRemaining = remaining;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PushoverResponse reset(long reset) {
|
||||
this.pushoverReset = reset;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The pushover response
|
||||
@@ -45,4 +63,25 @@ public class PushoverResponse {
|
||||
public boolean isSuccessful() {
|
||||
return pushoverSuccessful;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The API rate limit
|
||||
*/
|
||||
public long getLimit() {
|
||||
return pushoverLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The remaining allowed API requests
|
||||
*/
|
||||
public long getRemaining() {
|
||||
return pushoverRemaining;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The API rate limit reset timestamp
|
||||
*/
|
||||
public long getReset() {
|
||||
return pushoverReset;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user