Other Structures

The following structures are available globally.

  • Declaration

    Swift

    struct GenerateScheduleCommand : AsyncCommand
  • Random number generator that can be initialized with a seed value. Copied from https://github.com/mattgallagher/CwlUtils/blob/master/Sources/CwlUtils/CwlRandom.swift

    The idea here is that this RNG is seeded with a user’s userID, and will always produce the same sequence of numbers when building a user’s identicon..

    See more

    Declaration

    Swift

    public struct Xoshiro : RandomNumberGenerator
  • Declaration

    Swift

    struct SongInfoJSON : Decodable
  • For admins to upload new daily themes, or edit existing ones.

    See more

    Declaration

    Swift

    public struct DailyThemeUploadData : Content
  • Used to validate changes to the Event database. This public struct shows the differrences between the current schedule and the (already uploaded but not processed) updated schedule. Event identity is based on the uid field–two events with the same uid are the same event, and if they show different times, we conclude the event’s time changed. Two events with different uids are different events, even if all other fields are exactly the same.

    Events that are added or deleted will only appear in deleted or created event arrays. Modified events could appear in any or all of the 3 modification arrays. Deleted events take their contents from the database. All other arrays take content from the update.

    Required by: POST /api/v3/admin/schedule/verify

    See EventController.eventsUpdateHandler(_:data:).

    See more

    Declaration

    Swift

    public struct EventUpdateDifferenceData : Content
  • Declaration

    Swift

    public struct EventUpdateLogData : Content
  • Returns the registration code associated with a user. Not all users have registration codes; e.g. asking for the reg code for ‘admin’ will return an error.

    See more

    Declaration

    Swift

    public struct RegistrationCodeUserData : Content
  • Returns general info about registration codes.

    Each passenger gets sent an email with a unique registration code; the reg code allows them to create verified accounts. This struct lets the admins quickly view some basic stats on account usage.

    See more

    Declaration

    Swift

    public struct RegistrationCodeStatsData : Content
  • Used to enable/disable features. A featurePair with name: “kraken” and feature: “schedule” indicates the Schedule feature of the Kraken app. When the server indicates this app:feature pair is disabled, the client app should not show the feature to users, and should avoid calling API calls related to that feature. Either the app or feature field could be ‘all’.

    Used in: SettingsAdminData, SettingsUpdateData

    See more

    Declaration

    Swift

    public struct SettingsAppFeaturePair : Content
  • Used to return the current Settings values.

    Required by: GET /api/v3/events/update

    See AdminController.settingsHandler().

    See more

    Declaration

    Swift

    public struct SettingsAdminData : Content
  • Used to update the Settings values. Doesn’t update everything–some values aren’t meant to be updated live. The updated values are saved so that they’ll persist through app launches. Any optional values set to nil are not used to update Settings values.

    Required by: POST /api/v3/events/update

    See AdminController.settingsUpdateHandler().

    See more

    Declaration

    Swift

    public struct SettingsUpdateData : Content
  • Used to return information about the time zone changes scheduled to occur during the cruise.

    Returned by: GET /api/v3/admin/timezonechanges

    See more

    Declaration

    Swift

    public struct TimeZoneChangeData : Content
  • Parameters for the game recommender engine. Pass these values in, get back a BoardgameResponseData with a list of games filtered to match the criteria, and sorted based on how well they match the criteria. The sort takes into account each games’ overall rating from BGG, the recommended number of players (not just min and max allowed players), the average playtime, and the complexity score of the game.

    Sent to these methods as the JSON request body:

    • GET /api/v3/boardgames/recommend
    See more

    Declaration

    Swift

    public struct BoardgameRecommendationData : Content
  • Used to return the day’s theme.

    Returned by: GET /api/v3/notifications/dailythemes

    See more

    Declaration

    Swift

    public struct DailyThemeData : Content
  • A feature that has been turned off by the server. If the appName is all, the indicated featureName is disabled at the API level for this feature and all relevant endpoints will return errors. For any other value of appName, the API still works, but the indicated client apps should not allow the feature to be accessed. The goal is to be able to disable code that is impacting server stability or performance without shutting down the server entirely or disallowing specific clients entirely.

    Used in UserNotificationData.

    See more

    Declaration

    Swift

    public struct DisabledFeature : Content
  • All errors returned in HTTP responses use this structure.

    Some server errors (such as 404s) may not have any payload in the response body, but for any HTTP error response that has a payload, the payload will have this strcture.

    error is always true, reason concatenates all errors into a single string, and fieldErrors breaks errors up by field name of the request’s body content, if available. Only content validation errors actaully use fieldErrors. Field-specific validation errors are keyed by the path to the field that caused the error. Validation errors that aren’t specific to an input field (e.g. an error indicating that one of two fields may be empty, but not both) are all concatenated and placed into a general key in fieldErrors. This means that all field errors are both in error (concatenated into a single string), and also in fieldErrors (split into fields).

    Note

    If the request body has validation errors, the error response should list all validation errors at once. However, other errors that may prevent a successful action will not be included. For instance, a user might try creating a Forum with empty fields. The error response will indicate that both Title and Text fields need values. After fixing those issues, the user could still get an error becuase they are quarantined and not authorized to create posts.
    See more

    Declaration

    Swift

    public struct ErrorResponse : Codable, Error
  • Used to return data on a group of FriendlyFez objects.

    See more

    Declaration

    Swift

    public struct FezListData : Content
  • Used to return a (partial) list of forums along with the number of forums in the found set. Similar to CategoryData, but the forums need not be from the same category. Instead, this returns forums that match a common attribute acoss all categores.

    Returned by:

    • GET /api/v3/forum/favorites
    • GET /api/v3/forum/owner

    See ForumController.categoriesHandler(_:)

    See more

    Declaration

    Swift

    public struct ForumSearchData : Content
  • Wraps an array of KaraokeSongData with information for pagination. KaraokeSongData returns data about a single song.

    Returned by: GET /api/v3/karaoke See KaraokeController.getKaraokeSongs().

    See more

    Declaration

    Swift

    public struct KaraokeSongResponseData : Content
  • Returns information about a song in the Karaoke Song Library.

    Returned by: GET /api/v3/karaoke/:song_id Incorporated into: KaraokeSongResponseData

    See more

    Declaration

    Swift

    public struct KaraokeSongData : Content
  • Returns information about songs that have been performed in the Karaoke Lounge onboard.

    Returned by: GET /api/v3/karaoke/performance Incorporated into: KaraokeSongData, which itself is incorporated into `KaraokeSongResponseData

    See more

    Declaration

    Swift

    public struct KaraokePerformedSongsData : Content
  • Used to obtain the user’s current list of alert or mute keywords.

    Returned by:

    • GET /api/v3/user/alertwords
    • POST /api/v3/user/alertwords/add/STRING
    • POST /api/v3/user/alertwords/remove/STRING
    • GET /api/v3/user/mutewords
    • POST /api/v3/user/mutewords/add/STRING
    • POST /api/v3/user/mutewords/remove/STRING

    See UserController.alertwordsHandler(_:), UserController.alertwordsAddHandler(_:), UserController.alertwordsRemoveHandler(_:).

    See more

    Declaration

    Swift

    public struct KeywordData : Content
  • Used to return a list of completed Micro Karaoke songs, that is, finished videos the user can watch.

    Returned by:

    • GET /api/v3/karaoke/mk/songlist

    See UsersController.headerHandler(_:), ClientController.userHeadersHandler(_:).

    See more

    Declaration

    Swift

    public struct MicroKaraokeCompletedSong : Content
  • Used to upload a Micro Karaoke video. The offerID comes from the server when it offers a song clip.

    Used by:

    • POST /api/v3/karaoke/mk/recording
    See more

    Declaration

    Swift

    public struct MicroKaraokeRecordingData : Content
  • Declaration

    Swift

    public struct MicroKaraokeSnippetModeration : Content
  • When a user starts the Micro Karaoke flow to sing and record part of a song, the server reserves a song slot for that user and returns into about their reservation, including the lyrics they should sing, what song it’s part of, and URLs for the vocal and no-vocal song clipe.

    Returned by:

    • POST /api/v3/karaoke/mk/offer
    See more

    Declaration

    Swift

    public struct MicroKaraokeOfferPacket : Content
  • Declaration

    Swift

    public struct MicroKaraokeSongManifest : Content
  • Composes into other structs to add pagination.

    Generally this will be added to a top-level struct along with an array of some result type, like this:

        struct SomeCollectionData: Content {
            var paginator: Paginator
            var collection: [CollectionElementType]
        }
    

    The Paginator lets you page through results, showing the total number of pages and the current page. The outer-level struct should document the sort ordering for the returned collection; the first element in the sorted collection is returned in the first result element when start = 0.

    In many cases the size of the returned array will be smaller than limit, and not only at the end of the results. In several cases the results may be filtered after the database query returns. The next ‘page’ of results should be calculated with start + limit, not with start + collection.count.

    See more

    Declaration

    Swift

    public struct Paginator : Content
  • Used to return info about a search for ForumPosts. Like forums, this returns an array of PostData. However, this gives the results of a search for posts across all the forums.

    Returned by: GET /api/v3/forum/post/search

    See more

    Declaration

    Swift

    public struct PostSearchData : Content
  • A bool, wrapped in a struct. Used for the results of user capability queries.

    Required by:

    • POST /api/v3/karaoke/userIsManager

    See UserController.createHandler(_:data:), UserController.addHandler(_:data:).

    See more

    Declaration

    Swift

    public struct UserAuthorizedToCreateKaraokeLogs : Content
  • Returns status about a single Alertword, for either Twarrts of ForumPost hits on that word. Used inside UserNotificationData.

    See more

    Declaration

    Swift

    public struct UserNotificationAlertwordData : Content
  • Provides updates about server global state and the logged in user’s notifications. userNotificationHandler() is intended to be called frequently by clients (I mean, don’t call it once a second).

    Returned by AlertController.userNotificationHandler()

    See more

    Declaration

    Swift

    public struct UserNotificationData : Content
  • Used to edit the current user’s profile contents. For profile data on users, see ProfilePublicData.

    Required by:

    • POST /api/v3/user/profile

    Returned by:

    • GET /api/v3/user/profile
    • POST /api/v3/user/profile

    See UserController.profileHandler(_:), UserController.profileUpdateHandler(_:data:).

    See more

    Declaration

    Swift

    public struct UserProfileUploadData : Content
    extension UserProfileUploadData: RCFValidatable

Username Validation

Concrete LibGd Formatter

Hexadecimal

ModelAuthenticatable Conformance