Merge pull request #7 from tuxmainy/main

implemented TTL feature
This commit is contained in:
Sven Kubiak 2023-07-13 11:58:19 +02:00 committed by GitHub
commit 0cbcf27da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -224,6 +224,17 @@ public class Message implements API {
return this;
}
/**
*
* @param ttl Seconds until this message should be automatically removed from the device. Needs to be positive
* @see https://pushover.net/api#ttl
* @return Message instance
*/
public Message withTTL(int ttl) {
body.put(Param.TTL.toString(), Integer.toString(ttl));
return this;
}
/**
* Uses a given proxy for the HTTP requests to Pushover
*

View File

@ -24,7 +24,8 @@ public enum Param {
TOKEN("token"),
URL("url"),
URL_TITLE("url_title"),
USER("user");
USER("user"),
TTL("ttl");
private final String value;