AnnouncementData

public struct AnnouncementData : Content

An announcement to display to all users.

Note

Admins can modify Announcements, but should only do so to correct typos or change the displayUntil time. Therefore if a user has seen an announcement, they need not be notified again if the announcement is edited. Any material change to the content of an announcement should be done via a new announcement, so that user notifications work correctly.

Returned by:

  • GET /api/v3/notification/announcements
  • GET /api/v3/notification/announcement/ID for admins/THO only.
  • id

    Only THO and admins need to send Announcement IDs back to the API (to modify or delete announcements, for example), but caching clients can still use the ID to correlate announcements returned by the API with cached ones.

    Declaration

    Swift

    var id: Int
  • The author of the announcement.

    Declaration

    Swift

    var author: UserHeader
  • The contents of the announcement.

    Declaration

    Swift

    var text: String
  • When the announcement was last modified.

    Declaration

    Swift

    var updatedAt: Date
  • Announcements are considered ‘active’ until this time. After this time, GET /api/v3/notification/announcements will no longer return the announcement, and caching clients should stop showing it to users.

    Declaration

    Swift

    var displayUntil: Date
  • TRUE if the announcement has been deleted. Only THO/admins can fetch deleted announcements; will always be FALSE for other users.

    Declaration

    Swift

    var isDeleted: Bool
  • Declaration

    Swift

    init(from: Announcement, authorHeader: UserHeader) throws