Skip to content

Commit 04d87ad

Browse files
authored
[freeboxos] Restore enum in API response record DTO (MacOS file sharing) (#17284)
Partial revert of #17203 Signed-off-by: Laurent Garnier <[email protected]>
1 parent 687337f commit 04d87ad

File tree

1 file changed

+28
-1
lines changed
  • bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/api/rest

1 file changed

+28
-1
lines changed

bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/api/rest/AfpManager.java

+28-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.openhab.binding.freeboxos.internal.api.FreeboxException;
2020
import org.openhab.binding.freeboxos.internal.api.Response;
2121

22+
import com.google.gson.annotations.SerializedName;
23+
2224
/**
2325
* The {@link AfpManager} is the Java class used to handle api requests related to Afp shares
2426
*
@@ -31,8 +33,33 @@ public class AfpManager extends ConfigurableRest<AfpManager.Afp, AfpManager.Conf
3133
protected static class ConfigResponse extends Response<Afp> {
3234
}
3335

34-
protected static record Afp(boolean enabled, boolean guestAllow, String serverType, @Nullable String loginName,
36+
protected static record Afp(boolean enabled, boolean guestAllow, ServerType serverType, @Nullable String loginName,
3537
@Nullable String loginPassword) {
38+
private enum ServerType {
39+
@SerializedName("powerbook")
40+
POWERBOOK,
41+
@SerializedName("powermac")
42+
POWERMAC,
43+
@SerializedName("macmini")
44+
MACMINI,
45+
@SerializedName("imac")
46+
IMAC,
47+
@SerializedName("macbook")
48+
MACBOOK,
49+
@SerializedName("macbookpro")
50+
MACBOOKPRO,
51+
@SerializedName("macbookair")
52+
MACBOOKAIR,
53+
@SerializedName("macpro")
54+
MACPRO,
55+
@SerializedName("appletv")
56+
APPLETV,
57+
@SerializedName("airport")
58+
AIRPORT,
59+
@SerializedName("xserve")
60+
XSERVE,
61+
UNKNOWN
62+
}
3663
}
3764

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

0 commit comments

Comments
 (0)