IceCubesApp/Packages/Models/Sources/Models/ServerPreferences.swift

24 lines
726 B
Swift
Raw Normal View History

2023-01-09 18:47:54 +00:00
import Foundation
public struct ServerPreferences: Decodable {
public let postVisibility: Visibility?
public let postIsSensitive: Bool?
public let postLanguage: String?
public let autoExpandmedia: AutoExpandMedia?
public let autoExpandSpoilers: Bool?
2023-01-17 10:36:01 +00:00
2023-01-09 18:47:54 +00:00
public enum AutoExpandMedia: String, Decodable {
case showAll = "show_all"
case hideAll = "hide_all"
case hideSensitive = "default"
}
2023-01-17 10:36:01 +00:00
2023-01-09 18:47:54 +00:00
enum CodingKeys: String, CodingKey {
case postVisibility = "posting:default:visibility"
case postIsSensitive = "posting:default:sensitive"
case postLanguage = "posting:default:language"
case autoExpandmedia = "reading:expand:media"
case autoExpandSpoilers = "reading:expand:spoilers"
}
}