FezType

enum FezType : String, CaseIterable, Codable

The type of FriendlyFez.

  • A closed chat. Participants are set at creation and can’t be changed. No location, start/end time, or capacity. Not moderated.

    Declaration

    Swift

    case closed
  • An open chat. Participants can be added/removed after creation and your UI should make this clear. No location, start/end time, or capacity.

    Declaration

    Swift

    case open
  • Some type of activity.

    Declaration

    Swift

    case activity
  • A dining LFG.

    Declaration

    Swift

    case dining
  • A gaming LFG.

    Declaration

    Swift

    case gaming
  • A general meetup.

    Declaration

    Swift

    case meetup
  • A music-related LFG.

    Declaration

    Swift

    case music
  • Some other type of LFG.

    Declaration

    Swift

    case other
  • A shore excursion LFG.

    Declaration

    Swift

    case shore
  • A personal calendar event. Has a location and start/end time, but no participants and no chat. Operates just like an event in your phone’s Calendar app.

    Declaration

    Swift

    case personalEvent
  • A calendar event where the owner can add other users (like an open chat), but should display the event’s location and time. No capacity. Unlike LFGs, there’s no searching for events you don’t belong to.

    Declaration

    Swift

    case privateEvent
  • The types that are LFGs, and a computed property to test it.

    Declaration

    Swift

    static var lfgTypes: [FezType] { get }
  • Declaration

    Swift

    var isLFGType: Bool { get }
  • Types that are Seamails.

    Declaration

    Swift

    static var seamailTypes: [FezType] { get }
  • Declaration

    Swift

    var isSeamailType: Bool { get }
  • Types that are Private Events.

    Declaration

    Swift

    static var privateEventTypes: [FezType] { get }
  • Declaration

    Swift

    var isPrivateEventType: Bool { get }
  • .label returns consumer-friendly case names.

    Declaration

    Swift

    var label: String { get }
  • For use by the UI layer. Returns whether this fez should be labeled as a Seamail chat or as an LFG or a Private Event.

    Declaration

    Swift

    var lfgLabel: String { get }
  • This gives us a bit more control than init(rawValue:). Since the strings for FezTypes are part of the API (specifically, they’re URL query values), they should be somewhat abstracted from internal representation. URL Parameters that take a FezType string should use this function to make a FezType from the input.

    Declaration

    Swift

    static func fromAPIString(_ str: String) throws -> FezType