Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add external selection #80

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ default PteroAction<ApplicationServer> retrieveServerById(long id) {
*
* @return {@link com.mattmalec.pterodactyl4j.PteroAction PteroAction} - Type {@link java.util.List List} of {@link com.mattmalec.pterodactyl4j.application.entities.ApplicationServer ApplicationServers}
*/

PteroAction<ApplicationServer> retrieveServerByExternalId(String id);
expxx marked this conversation as resolved.
Show resolved Hide resolved

PteroAction<List<ApplicationServer>> retrieveServersByName(String name, boolean caseSensitive);
expxx marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ public PaginationAction<ApplicationServer> retrieveServers() {
api, Route.Servers.LIST_SERVERS.compile(), (object) -> new ApplicationServerImpl(this, object));
}

@Override
public PteroAction<ApplicationServer> retrieveServerByExternalId(String id) {
return PteroActionImpl.onRequestExecute(
api,
Route.Servers.GET_SERVER_EXTERNAL.compile(id),
(response, request) -> new ApplicationServerImpl(this, response.getObject())
);
}

@Override
public PteroAction<ApplicationServer> retrieveServerById(String id) {
return PteroActionImpl.onRequestExecute(
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/mattmalec/pterodactyl4j/requests/Route.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public static class Servers {
GET,
APPLICATION_PREFIX
+ "servers/{server_id}?include=allocations,user,subusers,nest,egg,location,node,databases");
public static final Route GET_SERVER_EXTERNAL =
new Route(GET, APPLICATION_PREFIX + "servers/external/{external_id}" );
expxx marked this conversation as resolved.
Show resolved Hide resolved
public static final Route UPDATE_SERVER_DETAILS =
new Route(PATCH, APPLICATION_PREFIX + "servers/{server_id}/details");
public static final Route UPDATE_SERVER_BUILD =
Expand Down