Skip to content

Commit

Permalink
[freeboxos] Restore enum in API response record DTO (MacOS file shari…
Browse files Browse the repository at this point in the history
…ng) (openhab#17284)

Partial revert of openhab#17203

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and digitaldan committed Aug 29, 2024
1 parent 28e3040 commit 75189b3
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.openhab.binding.freeboxos.internal.api.FreeboxException;
import org.openhab.binding.freeboxos.internal.api.Response;

import com.google.gson.annotations.SerializedName;

/**
* The {@link AfpManager} is the Java class used to handle api requests related to Afp shares
*
Expand All @@ -31,8 +33,33 @@ public class AfpManager extends ConfigurableRest<AfpManager.Afp, AfpManager.Conf
protected static class ConfigResponse extends Response<Afp> {
}

protected static record Afp(boolean enabled, boolean guestAllow, String serverType, @Nullable String loginName,
protected static record Afp(boolean enabled, boolean guestAllow, ServerType serverType, @Nullable String loginName,
@Nullable String loginPassword) {
private enum ServerType {
@SerializedName("powerbook")
POWERBOOK,
@SerializedName("powermac")
POWERMAC,
@SerializedName("macmini")
MACMINI,
@SerializedName("imac")
IMAC,
@SerializedName("macbook")
MACBOOK,
@SerializedName("macbookpro")
MACBOOKPRO,
@SerializedName("macbookair")
MACBOOKAIR,
@SerializedName("macpro")
MACPRO,
@SerializedName("appletv")
APPLETV,
@SerializedName("airport")
AIRPORT,
@SerializedName("xserve")
XSERVE,
UNKNOWN
}
}

public AfpManager(FreeboxOsSession session, UriBuilder uriBuilder) throws FreeboxException {
Expand Down

0 comments on commit 75189b3

Please sign in to comment.