Last active
July 27, 2020 18:07
-
-
Save giovani-pereira-ifood/169810f4f3f43aa42c034a156733eff0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct User: Codable { | |
let name: String | |
let preferences: [Preference] | |
} | |
struct Account: Codable { | |
let uuid: String | |
let email: String? | |
let address: Address? | |
} | |
struct Address: Codable { | |
let street: String | |
let location: Location | |
} | |
struct Location: Codable { | |
let lat: Double | |
let lon: Double | |
} | |
struct Preference: Codable { | |
let type: PreferenceType | |
let color: ColorPreference | |
} | |
enum PreferenceType: Int, Codable { | |
case primary = 0 | |
case secondary = 1 | |
} | |
enum ColorPreference: String, Codable { | |
case red = "RED" | |
case yellow = "YELLOW" | |
case blue = "BLUE" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment