QuartermasterCategory

enum QuartermasterCategory : String, CaseIterable, Codable, Sendable

The category of a QuartermasterItem — whether the user has the item to offer, or needs it.

  • The user has this item and is offering it to others.

    Declaration

    Swift

    case have
  • The user needs this item and is looking for someone who has it.

    Declaration

    Swift

    case need
  • .label returns a consumer-friendly display name.

    Declaration

    Swift

    var label: String { get }
  • For use by the URL-parameter layer. Lowercases the input and maps it to a case, throwing a 400 on unknown values.

    URL parameters that take a category string should use this function.

    Declaration

    Swift

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