add optional ID to api token request

This commit is contained in:
Jonathan Shook
2022-07-05 21:11:56 -05:00
parent 1b28e14ef5
commit 81faf9d53d

View File

@@ -24,11 +24,17 @@ public class ApiTokenRequest {
private final String name; private final String name;
private final String role; private final String role;
private final long ttl; private final long ttl;
private final int id;
public ApiTokenRequest(String name, String role, long ttl) { public ApiTokenRequest(String name, String role, long ttl, int id) {
this.name = name; this.name = name;
this.role = checkRole(role); this.role = checkRole(role);
this.ttl = ttl; this.ttl = ttl;
this.id = id;
}
public ApiTokenRequest(String name, String role, long ttl) {
this(name, role, ttl, 1);
} }
private String checkRole(String role) { private String checkRole(String role) {
@@ -38,6 +44,10 @@ public class ApiTokenRequest {
return role; return role;
} }
public int getId() {
return id;
}
public String getName() { public String getName() {
return name; return name;
} }