design

package
v0.0.0-...-b9360c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptTncFields = Type("AcceptTncFields", func() {
	Attribute("accept", Boolean)
	Required("accept")
})
View Source
var ActivityEntry = ResultType("application/vnd.app.activity.entry", func() {
	TypeName("ActivityEntry")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("key", String)
		Attribute("project", ProjectSummary)
		Attribute("station", StationSummary)
		Attribute("created_at", Int64)
		Attribute("type", String)
		Attribute("meta", Any)
		Required("id", "key", "project", "station", "created_at", "type", "meta")
	})
	View("default", func() {
		Attribute("id")
		Attribute("key")
		Attribute("project")
		Attribute("station")
		Attribute("created_at")
		Attribute("type")
		Attribute("meta")
	})
})
View Source
var AddFirmwarePayload = Type("AddFirmwarePayload", func() {
	Attribute("etag")
	Required("etag")
	Attribute("module")
	Required("module")
	Attribute("profile")
	Required("profile")
	Attribute("version")
	Required("version")
	Attribute("url")
	Required("url")
	Attribute("meta")
	Required("meta")
	Attribute("logicalAddress", Int64)
})
View Source
var AddProjectFields = Type("AddProjectFields", func() {
	Attribute("name", String)
	Attribute("description", String)
	Attribute("goal", String)
	Attribute("location", String)
	Attribute("tags", String)
	Attribute("privacy", Int32)
	Attribute("startTime", String)
	Attribute("endTime", String)
	Attribute("bounds", ProjectBounds)
	Attribute("showStations", Boolean)
	Required("name", "description")
})
View Source
var AddUserFields = Type("AddUserFields", func() {
	Attribute("name", String, func() {
		Pattern(`\S`)
		MaxLength(256)
	})
	Attribute("email", String, func() {
		Format("email")
		MaxLength(40)
	})
	Attribute("password", String, func() {
		MinLength(10)
	})
	Attribute("invite_token", String)
	Attribute("tncAccept", Boolean)
	Required("name", "email", "password")
})
View Source
var AdminDeleteFields = ResultType("application/vnd.app.admin.user.delete+json", func() {
	TypeName("AdminDeleteFields")
	Attributes(func() {
		Attribute("email", String)
		Required("email")
		Attribute("password", String)
		Required("password")
	})
})
View Source
var AdminTermsAndConditionsFields = ResultType("application/vnd.app.admin.user.tnc.update+json", func() {
	TypeName("AdminTermsAndConditionsFields")
	Attributes(func() {
		Attribute("email", String)
		Required("email")
	})
})
View Source
var AssociatedStation = ResultType("application/vnd.app.associated.station", func() {
	TypeName("AssociatedStation")
	Attributes(func() {
		Attribute("station", StationFull)
		Required("station")
		Attribute("project", ArrayOf(AssociatedViaProject))
		Attribute("location", ArrayOf(AssociatedViaLocation))
		Attribute("manual", ArrayOf(AssociatedViaManual))
		Attribute("hidden", Boolean)
		Required("hidden")
	})
	View("default", func() {
		Attribute("station")
		Attribute("project")
		Attribute("location")
		Attribute("manual")
		Attribute("hidden")
	})
})
View Source
var AssociatedStations = ResultType("application/vnd.app.associated.stations", func() {
	TypeName("AssociatedStations")
	Attributes(func() {
		Attribute("stations", CollectionOf(AssociatedStation))
		Required("stations")
	})
	View("default", func() {
		Attribute("stations")
	})
})
View Source
var AssociatedViaLocation = Type("AssociatedViaLocation", func() {
	Attribute("stationID", Int32)
	Attribute("distance", Float32)
	Required("stationID", "distance")
})
View Source
var AssociatedViaManual = Type("AssociatedViaManual", func() {
	Attribute("otherStationID", Int32)
	Attribute("priority", Int32)
	Required("otherStationID", "priority")
})
View Source
var AssociatedViaProject = Type("AssociatedViaProject", func() {
	Attribute("id", Int32)
	Required("id")
})
View Source
var AuthenticateDiscourseFields = Type("AuthenticateDiscourseFields", func() {
	Attribute("sso", String)
	Attribute("sig", String)
	Required("sso", "sig")

	Attribute("email", String)
	Attribute("password", String, func() {
		MinLength(10)
	})
})
View Source
var AuthorPhoto = Type("AuthorPhoto", func() {
	Attribute("url", String)
	Required("url")
})
View Source
var AvailableRole = Type("AvailableRole", func() {
	Attribute("id", Int32)
	Attribute("name", String)
	Required("id", "name")
})
View Source
var AvailableRoles = ResultType("application/vnd.app.roles.available", func() {
	TypeName("AvailableRoles")
	Attributes(func() {
		Attribute("roles", ArrayOf(AvailableRole))
		Required("roles")
	})
	View("default", func() {
		Attribute("roles")
	})
})
View Source
var Avatar = Type("Avatar", func() {
	Attribute("url", String)
	Required("url")
})
View Source
var DataEvent = ResultType("application/vnd.app.events.data.event", func() {
	TypeName("DataEvent")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("createdAt", Int64)
		Attribute("updatedAt", Int64)
		Attribute("author", PostAuthor)
		Attribute("title", String)
		Attribute("description", String)
		Attribute("bookmark", String)
		Attribute("start", Int64)
		Attribute("end", Int64)
		Required("id", "createdAt", "updatedAt", "author", "title", "description", "start", "end")
	})
	View("default", func() {
		Attribute("id")
		Attribute("createdAt")
		Attribute("updatedAt")
		Attribute("author")
		Attribute("title")
		Attribute("description")
		Attribute("bookmark")
		Attribute("start")
		Attribute("end")
	})
})
View Source
var DataEvents = ResultType("application/vnd.app.events.data", func() {
	TypeName("DataEvents")
	Attributes(func() {
		Attribute("events", ArrayOf(DataEvent))
		Required("events")
	})
	View("default", func() {
		Attribute("events")
	})
})
View Source
var DeviceDataStreamsSummary = Type("DeviceDataStreamsSummary", func() {
	Attribute("meta", DeviceStreamSummary)
	Attribute("data", DeviceStreamSummary)
})
View Source
var DeviceDataSummary = ResultType("application/vnd.app.device.data.summary+json", func() {
	TypeName("DeviceDataSummary")
	Attributes(func() {
		Attribute("size", Int64)
		Attribute("first", Int64)
		Attribute("last", Int64)
		Required("size")
		Required("first")
		Required("last")
	})
	View("default", func() {
		Attribute("size")
		Attribute("first")
		Attribute("last")
	})
})
View Source
var DeviceDataSummaryResponse = ResultType("application/vnd.app.device.summary+json", func() {
	TypeName("DeviceDataSummaryResponse")
	Attributes(func() {
		Attribute("provisions", CollectionOf(DeviceProvisionSummary))
		Required("provisions")
	})
	View("default", func() {
		Attribute("provisions")
	})
})
View Source
var DeviceLayoutResponse = ResultType("application/vnd.app.data.device.layout", func() {
	TypeName("DeviceLayoutResponse")
	Attributes(func() {
		Attribute("configurations", ArrayOf(StationConfiguration))
		Attribute("sensors", MapOf(String, ArrayOf(StationSensor)))
		Required("configurations")
		Required("sensors")
	})
	View("default", func() {
		Attribute("configurations")
		Attribute("sensors")
	})
})
View Source
var DeviceMetaSummary = ResultType("application/vnd.app.device.meta.summary+json", func() {
	TypeName("DeviceMetaSummary")
	Attributes(func() {
		Attribute("size", Int64)
		Attribute("first", Int64)
		Attribute("last", Int64)
		Required("size")
		Required("first")
		Required("last")
	})
	View("default", func() {
		Attribute("size")
		Attribute("first")
		Attribute("last")
	})
})
View Source
var DeviceProvisionSummary = ResultType("application/vnd.app.device.provision.summary+json", func() {
	TypeName("DeviceProvisionSummary")
	Attributes(func() {
		Attribute("generation", String)
		Attribute("created", Int64)
		Attribute("updated", Int64)
		Attribute("meta", DeviceMetaSummary)
		Attribute("data", DeviceDataSummary)

		Required("generation")
		Required("created")
		Required("updated")
		Required("meta")
		Required("data")
	})
	View("default", func() {
		Attribute("generation")
		Attribute("created")
		Attribute("updated")
		Attribute("meta")
		Attribute("data")
	})
})
View Source
var DeviceStreamSummary = Type("DeviceStreamSummary", func() {
	Attribute("records", Int64)
	Attribute("size", Int64)
})
View Source
var Discussion = ResultType("application/vnd.app.discussion", func() {
	TypeName("Discussion")
	Attributes(func() {
		Attribute("posts", ArrayOf(ThreadedPost))
		Required("posts")
	})
	View("default", func() {
		Attribute("posts")
	})
})
View Source
var DownloadedPhoto = ResultType("application/vnd.app.photo+json", func() {
	TypeName("DownloadedPhoto")
	Attributes(func() {
		Attribute("length", Int64)
		Required("length")
		Attribute("contentType", String)
		Required("contentType")
		Attribute("etag", String)
		Required("etag")
		Attribute("body", Bytes)
	})
	View("default", func() {
		Attribute("length")
		Attribute("body")
		Attribute("contentType")
		Attribute("etag")
	})
})
View Source
var EditUserFields = Type("EditUserFields", func() {
	Attribute("email", String)
	Required("email")
	Attribute("role", Int32)
	Required("role")
})
View Source
var EssentialStation = Type("EssentialStation", func() {
	Attribute("id", Int64)
	Attribute("deviceId")
	Attribute("name")
	Attribute("owner", Owner)
	Attribute("createdAt", Int64)
	Attribute("updatedAt", Int64)

	Required("id", "deviceId", "name", "owner", "createdAt", "updatedAt")

	Attribute("recordingStartedAt", Int64)
	Attribute("memoryUsed", Int32)
	Attribute("memoryAvailable", Int32)
	Attribute("firmwareNumber", Int32)
	Attribute("firmwareTime", Int64)
	Attribute("location", StationLocation)
	Attribute("lastIngestionAt", Int64)
})
View Source
var EventAuthor = Type("EventAuthor", func() {
	Attribute("id", Int32)
	Attribute("name", String)
	Attribute("photo", AuthorPhoto)
	Required("id", "name")
})
View Source
var EventAuthorPhoto = Type("EventAuthorPhoto", func() {
	Attribute("url", String)
	Required("url")
})
View Source
var ExistingFieldNote = Type("ExistingFieldNote", func() {
	Attribute("id", Int64)
	Attribute("key", String)
	Attribute("title", String)
	Attribute("body", String)
	Attribute("mediaIds", ArrayOf(Int64))
	Required("id")
})
View Source
var ExportStatus = ResultType("application/vnd.app.export.status", func() {
	TypeName("ExportStatus")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("token", String)
		Attribute("createdAt", Int64)
		Attribute("completedAt", Int64)
		Attribute("format", String)
		Attribute("progress", Float32)
		Attribute("message", String)
		Attribute("statusUrl", String)
		Attribute("downloadUrl", String)
		Attribute("size", Int32)
		Attribute("args", Any)
		Required("id", "token", "createdAt", "format", "statusUrl", "progress", "args")
	})
	View("default", func() {
		Attribute("id")
		Attribute("token")
		Attribute("createdAt")
		Attribute("completedAt")
		Attribute("format")
		Attribute("progress")
		Attribute("message")
		Attribute("statusUrl")
		Attribute("downloadUrl")
		Attribute("size")
		Attribute("args")
	})
})
View Source
var FieldNote = Type("FieldNote", func() {
	Attribute("id", Int64)
	Attribute("createdAt", Int64)
	Attribute("updatedAt", Int64)
	Attribute("author", FieldNoteAuthor)
	Attribute("key", String)
	Attribute("title", String)
	Attribute("body", String)
	Attribute("version", Int64)
	Attribute("media", ArrayOf(NoteMedia))
	Required("id", "createdAt", "updatedAt", "author", "media", "version")
})
View Source
var FieldNoteAuthor = Type("FieldNoteAuthor", func() {
	Attribute("id", Int32)
	Attribute("name", String)
	Attribute("mediaUrl", String)
	Required("id", "name", "mediaUrl")
})
View Source
var FieldNoteStation = ResultType("application/vnd.app.notes.station", func() {
	TypeName("FieldNoteStation")
	Attributes(func() {
		Attribute("readOnly", Boolean)
		Required("readOnly")
	})
	View("default", func() {
		Attribute("readOnly")
	})
})
View Source
var FieldNoteUpdate = ResultType("application/vnd.app.notes.update", func() {
	TypeName("FieldNoteUpdate")
	Attributes(func() {
		Attribute("notes", ArrayOf(ExistingFieldNote))
		Attribute("creating", ArrayOf(NewFieldNote))
		Required("notes")
		Required("creating")
	})
	View("default", func() {
		Attribute("notes")
		Attribute("creating")
	})
})
View Source
var FirmwareSummary = ResultType("application/vnd.app.firmware+json", func() {
	TypeName("FirmwareSummary")
	Attributes(func() {
		Attribute("id", Int32)
		Attribute("time", String)
		Attribute("etag", String)
		Attribute("module", String)
		Attribute("profile", String)
		Attribute("version", String)
		Attribute("url", String)
		Attribute("meta", MapOf(String, Any))
		Attribute("buildNumber", Int32)
		Attribute("buildTime", Int64)
		Attribute("logicalAddress", Int64)
		Required("id")
		Required("time")
		Required("etag")
		Required("module")
		Required("profile")
		Required("url")
		Required("meta")
		Required("buildNumber")
		Required("buildTime")
	})
	View("default", func() {
		Attribute("id")
		Attribute("time")
		Attribute("etag")
		Attribute("module")
		Attribute("profile")
		Attribute("version")
		Attribute("url")
		Attribute("meta")
		Attribute("buildNumber")
		Attribute("buildTime")
		Attribute("logicalAddress")
	})
})
View Source
var Firmwares = ResultType("application/vnd.app.firmwares+json", func() {
	TypeName("Firmwares")
	Attributes(func() {
		Attribute("firmwares", CollectionOf(FirmwareSummary))
		Required("firmwares")
	})
	View("default", func() {
		Attribute("firmwares")
	})
})
View Source
var Follower = ResultType("application/vnd.app.follower", func() {
	TypeName("Follower")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("name", String)
		Attribute("avatar", Avatar)
		Required("id", "name")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("avatar")
	})
})
View Source
var FollowersPage = ResultType("application/vnd.app.followers", func() {
	TypeName("FollowersPage")
	Attributes(func() {
		Attribute("followers", CollectionOf(Follower))
		Attribute("total", Int32)
		Attribute("page", Int32)
		Required("followers", "total", "page")
	})
})
View Source
var InviteUserFields = Type("InviteUserFields", func() {
	Attribute("email", String)
	Required("email")
	Attribute("role", Int32)
	Required("role")
})
View Source
var JWTAuth = JWTSecurity("jwt", func() {
	Scope("api:access", "API access")
	Scope("api:admin", "API admin access")
	Scope("api:ingestion", "Ingestion access")
})
View Source
var LoginFields = Type("LoginFields", func() {
	Reference(AddUserFields)
	Attribute("email")
	Attribute("password", String, func() {
		MinLength(10)
	})
	Required("email", "password")
})
View Source
var MentionableOptions = ResultType("application/vnd.app.mentionables+json", func() {
	TypeName("MentionableOptions")
	Attributes(func() {
		Attribute("users", CollectionOf(MentionableUser))
		Required("users")
	})
	View("default", func() {
		Attribute("users")
	})
})
View Source
var MentionableUser = ResultType("application/vnd.app.mentionable.user+json", func() {
	TypeName("MentionableUser")
	Attributes(func() {
		Attribute("id", Int32)
		Attribute("name", String)
		Attribute("mention", String)
		Attribute("photo", UserPhoto)
		Required("id")
		Required("name")
		Required("mention")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("mention")
		Attribute("photo")
	})
})
View Source
var NewDataEvent = ResultType("application/vnd.app.events.data.new+json", func() {
	TypeName("NewDataEvent")
	Attributes(func() {
		Attribute("allProjectSensors", Boolean)
		Attribute("bookmark", String)
		Attribute("title", String)
		Attribute("description", String)
		Attribute("start", Int64)
		Attribute("end", Int64)
		Required("allProjectSensors", "title", "description", "start", "end")
	})
	View("default", func() {
		Attribute("bookmark")
		Attribute("title")
		Attribute("description")
		Attribute("start")
		Attribute("end")
	})
})
View Source
var NewFieldNote = Type("NewFieldNote", func() {
	Attribute("key", String)
	Attribute("title", String)
	Attribute("body", String)
	Attribute("mediaIds", ArrayOf(Int64))
})
View Source
var NewPost = ResultType("application/vnd.app.discussion.post.new", func() {
	TypeName("NewPost")
	Attributes(func() {
		Attribute("threadId", Int64)
		Attribute("body", String)
		Attribute("projectId", Int32)
		Attribute("bookmark", String)
		Required("body")
	})
	View("default", func() {
		Attribute("threadId")
		Attribute("body")
		Attribute("projectId")
		Attribute("bookmark")
	})
})
View Source
var NoteMedia = ResultType("application/vnd.app.note.media", func() {
	TypeName("NoteMedia")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("url", String)
		Attribute("key", String)
		Attribute("contentType", String)
		Required("id", "url", "key", "contentType")
	})
	View("default", func() {
		Attribute("id")
		Attribute("url")
		Attribute("key")
	})
})
View Source
var Origins = []string{
	"https://fieldkit.org",
	"https://*.fieldkit.org",
	"https://dataviz.floodnet.nyc",
	"https://fkdev.org",
	"https://*.fkdev.org",
	"/(.+[.])?fklocal.org:\\d+/",
	"/127.0.0.1:\\d+/",
	"/192.168.(\\d+).(\\d+):\\d+/",
}
View Source
var Owner = Type("StationOwner", func() {
	Attribute("id", Int32)
	Attribute("name", String)
	Attribute("email", String)
	Attribute("photo", UserPhoto)
	Required("id", "name")
})
View Source
var PageOfStations = ResultType("application/vnd.app.stations.essential.page", func() {
	TypeName("PageOfStations")
	Attributes(func() {
		Attribute("stations", ArrayOf(EssentialStation))
		Required("stations")
		Attribute("total", Int32)
		Required("total")
	})
	View("default", func() {
		Attribute("stations")
		Attribute("total")
	})
})
View Source
var PendingInvite = Type("PendingInvite", func() {
	Attribute("id", Int64)
	Attribute("project", ProjectSummary)
	Attribute("time", Int64)
	Attribute("role", Int32)
	Required("id")
	Required("project")
	Required("time")
	Required("role")
})
View Source
var PendingInvites = ResultType("application/vnd.app.invites.pending", func() {
	TypeName("PendingInvites")
	Attributes(func() {
		Attribute("pending", ArrayOf(PendingInvite))
		Required("pending")
		Attribute("projects", CollectionOf(Project))
		Required("projects")
	})
	View("default", func() {
		Attribute("pending")
		Attribute("projects")
	})
})
View Source
var PostAuthor = Type("PostAuthor", func() {
	Attribute("id", Int32)
	Attribute("name", String)
	Attribute("photo", AuthorPhoto)
	Required("id", "name")
})
View Source
var Project = ResultType("application/vnd.app.project+json", func() {
	TypeName("Project")
	Reference(AddProjectFields)
	Attributes(func() {
		Attribute("id", Int32)
		Attribute("name")
		Attribute("description")
		Attribute("goal")
		Attribute("location")
		Attribute("tags")
		Attribute("privacy", Int32)
		Attribute("startTime", String)
		Attribute("endTime", String)
		Attribute("photo")
		Attribute("readOnly", Boolean)
		Attribute("showStations", Boolean)
		Attribute("bounds", ProjectBounds)
		Attribute("following", ProjectFollowing)
		Required("id", "name", "description", "goal", "location", "privacy", "tags", "readOnly", "showStations", "bounds", "following")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("description")
		Attribute("goal")
		Attribute("location")
		Attribute("tags")
		Attribute("privacy")
		Attribute("startTime")
		Attribute("endTime")
		Attribute("photo")
		Attribute("readOnly")
		Attribute("showStations")
		Attribute("bounds", ProjectBounds)
		Attribute("following")
	})
})
View Source
var ProjectActivityPage = ResultType("application/vnd.app.project.activity.page", func() {
	TypeName("ProjectActivityPage")
	Attributes(func() {
		Attribute("activities", CollectionOf(ActivityEntry))
		Attribute("total", Int32)
		Attribute("page", Int32)
		Required("activities", "total", "page")
	})
})
View Source
var ProjectBounds = Type("ProjectBounds", func() {
	Attribute("min", ArrayOf(Float64))
	Attribute("max", ArrayOf(Float64))
	Required("min", "max")
})
View Source
var ProjectFollowing = Type("ProjectFollowing", func() {
	Attribute("total", Int32)
	Required("total")
	Attribute("following", Boolean)
	Required("following")
})
View Source
var ProjectRole = ResultType("application/vnd.app.project.role+json", func() {
	TypeName("ProjectRole")
	Attributes(func() {
		Attribute("id", Int32)
		Attribute("name", String)
		Required("id", "name")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
	})
})
View Source
var ProjectSummary = Type("ProjectSummary", func() {
	Attribute("id", Int64)
	Attribute("name", String)
	Required("id", "name")
})
View Source
var ProjectUpdate = ResultType("application/vnd.app.project.update", func() {
	TypeName("ProjectUpdate")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("body", String)
		Attribute("createdAt", Int64)
		Required("id")
		Required("body")
		Required("createdAt")
	})
	View("default", func() {
		Attribute("id")
		Attribute("body")
	})
})
View Source
var ProjectUser = ResultType("application/vnd.app.project.user+json", func() {
	TypeName("ProjectUser")
	Attributes(func() {
		Attribute("user", User)
		Attribute("role", String)
		Attribute("membership", String)
		Attribute("invited", Boolean)
		Attribute("accepted", Boolean)
		Attribute("rejected", Boolean)
		Required("user", "role", "membership", "invited", "accepted", "rejected")
	})
	View("default", func() {
		Attribute("user")
		Attribute("role")
		Attribute("membership")
		Attribute("invited")
		Attribute("accepted")
		Attribute("rejected")
	})
})
View Source
var ProjectUsers = ResultType("application/vnd.app.users+json", func() {
	TypeName("ProjectUsers")
	Attributes(func() {
		Attribute("users", CollectionOf(ProjectUser))
		Required("users")
	})
	View("default", func() {
		Attribute("users")
	})
})
View Source
var Projects = ResultType("application/vnd.app.projects+json", func() {
	TypeName("Projects")
	Attributes(func() {
		Attribute("projects", CollectionOf(Project))
		Required("projects")
	})
	View("default", func() {
		Attribute("projects")
	})
})
View Source
var RecoveryFields = Type("RecoveryFields", func() {
	Attribute("token", String)
	Attribute("password", String, func() {
		MinLength(10)
	})
	Required("token", "password")
})
View Source
var RecoveryLookupFields = Type("RecoveryLookupFields", func() {
	Attribute("email", String)
	Required("email")
})
View Source
var RemoveUserFields = Type("RemoveUserFields", func() {
	Attribute("email", String)
	Required("email")
})
View Source
var SavedBookmark = ResultType("application/vnd.app.bookmark", func() {
	TypeName("SavedBookmark")
	Attributes(func() {
		Attribute("url", String)
		Attribute("bookmark", String)
		Attribute("token", String)
		Required("url", "bookmark", "token")
	})
	View("default", func() {
		Attribute("url")
		Attribute("bookmark")
		Attribute("token")
	})
})
View Source
var SensorRange = Type("SensorRange", func() {
	Attribute("minimum", Float32)
	Attribute("maximum", Float32)
	Required("minimum", "maximum")
})
View Source
var SensorReading = Type("SensorReading", func() {
	Attribute("last", Float32)
	Attribute("time", Int64)
	Required("last", "time")
})
View Source
var ServiceError = Type("ServiceError", func() {
	Attribute("code", String)
	Attribute("status", Int32)
})
View Source
var StationActivityPage = ResultType("application/vnd.app.station.activity.page", func() {
	TypeName("StationActivityPage")
	Attributes(func() {
		Attribute("activities", CollectionOf(ActivityEntry))
		Attribute("total", Int32)
		Attribute("page", Int32)
		Required("activities", "total", "page")
	})
})
View Source
var StationConfiguration = Type("StationConfiguration", func() {
	Attribute("id", Int64)
	Attribute("time", Int64)
	Attribute("provisionId", Int64)
	Attribute("metaRecordId", Int64)
	Attribute("sourceId", Int32)
	Attribute("modules", ArrayOf(StationModule))
	Required("id")
	Required("provisionId")
	Required("time")
	Required("modules")
})
View Source
var StationConfigurations = Type("StationConfigurations", func() {
	Attribute("all", ArrayOf(StationConfiguration))
	Required("all")
})
View Source
var StationDataSummary = Type("StationDataSummary", func() {
	Attribute("start", Int64)
	Attribute("end", Int64)
	Attribute("numberOfSamples", Int64)
	Required("start", "end", "numberOfSamples")
})
View Source
var StationFieldNotes = ResultType("application/vnd.app.notes", func() {
	TypeName("FieldNotes")
	Attributes(func() {
		Attribute("notes", ArrayOf(FieldNote))
		Required("notes")
		Attribute("media", ArrayOf(NoteMedia))
		Required("media")
		Attribute("station", FieldNoteStation)
		Required("station")
	})
	View("default", func() {
		Attribute("notes")
		Attribute("media")
		Attribute("station")
	})
})
View Source
var StationFull = ResultType("application/vnd.app.station.full", func() {
	TypeName("StationFull")
	Attributes(func() {
		Attribute("id", Int32)
		Attribute("name")
		Attribute("model", StationFullModel)
		Attribute("owner", Owner)
		Attribute("deviceId", String)
		Attribute("interestingness", StationInterestingness)
		Attribute("attributes", StationProjectAttributes)
		Attribute("uploads", ArrayOf(StationUpload))
		Attribute("photos", StationFullPhotos)
		Attribute("readOnly", Boolean)
		Attribute("status", String)
		Attribute("hidden", Boolean)
		Attribute("description", String)
		Required("id", "name", "model", "owner", "deviceId", "interestingness", "attributes", "uploads", "photos", "readOnly")

		Attribute("battery", Float32)
		Attribute("recordingStartedAt", Int64)
		Attribute("memoryUsed", Int32)
		Attribute("memoryAvailable", Int32)
		Attribute("firmwareNumber", Int32)
		Attribute("firmwareTime", Int64)
		Attribute("configurations", StationConfigurations)
		Required("configurations")

		Attribute("updatedAt", Int64)
		Attribute("lastReadingAt", Int64)
		Attribute("locationName", String)
		Attribute("placeNameOther", String)
		Attribute("placeNameNative", String)
		Attribute("location", StationLocation)
		Required("updatedAt")

		Attribute("syncedAt", Int64)
		Attribute("ingestionAt", Int64)

		Attribute("data", StationDataSummary)
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("model")
		Attribute("owner")
		Attribute("deviceId")
		Attribute("interestingness")
		Attribute("attributes")
		Attribute("uploads")
		Attribute("photos")
		Attribute("readOnly")
		Attribute("hidden")
		Attribute("description")
		Attribute("status")

		Attribute("battery")
		Attribute("recordingStartedAt")
		Attribute("memoryUsed")
		Attribute("memoryAvailable")
		Attribute("firmwareNumber")
		Attribute("firmwareTime")
		Attribute("configurations")

		Attribute("updatedAt")
		Attribute("lastReadingAt")
		Attribute("location")
		Attribute("locationName")
		Attribute("placeNameOther")
		Attribute("placeNameNative")

		Attribute("syncedAt", Int64)
		Attribute("ingestionAt", Int64)

		Attribute("data")
	})
})
View Source
var StationFullImageRef = Type("ImageRef", func() {
	Attribute("url", String)
	Required("url")
})
View Source
var StationFullModel = Type("StationFullModel", func() {
	Attribute("name", String)
	Attribute("only_visible_via_association", Boolean)
	Required("name", "only_visible_via_association")
})
View Source
var StationFullPhotos = Type("StationPhotos", func() {
	Attribute("small", String)
	Required("small")
})
View Source
var StationInterestingness = Type("StationInterestingness", func() {
	Attribute("windows", ArrayOf(StationInterestingnessWindow))
	Required("windows")
})
View Source
var StationInterestingnessWindow = Type("StationInterestingnessWindow", func() {
	Attribute("seconds", Int32)
	Attribute("interestingness", Float64)
	Attribute("value", Float64)
	Attribute("time", Int64)
	Required("seconds", "interestingness", "value", "time")
})
View Source
var StationJob = ResultType("application/vnd.app.stations.job", func() {
	TypeName("StationJob")
	Attributes(func() {
		Attribute("title", String)
		Attribute("startedAt", Int64)
		Attribute("completedAt", Int64)
		Attribute("progress", Float32)
		Required("startedAt")
		Required("progress")
		Required("title")
	})
	View("default", func() {
		Attribute("startedAt")
		Attribute("completedAt")
		Attribute("progress")
		Attribute("title")
	})
})
View Source
var StationLocation = ResultType("application/vnd.app.station.location", func() {
	TypeName("StationLocation")
	Attributes(func() {
		Attribute("precise", ArrayOf(Float64))
		Attribute("regions", ArrayOf(StationRegion))
		Attribute("url", String)
	})
	View("default", func() {
		Attribute("precise")
		Attribute("regions")
		Attribute("url")
	})
})
View Source
var StationModule = Type("StationModule", func() {
	Attribute("id", Int64)
	Attribute("hardwareId", String)
	Attribute("hardwareIdBase64", String)
	Attribute("metaRecordId", Int64)
	Attribute("name", String)
	Attribute("label", String)
	Attribute("position", Int32)
	Attribute("flags", Int32)
	Attribute("internal", Boolean)
	Attribute("fullKey", String)
	Attribute("sensors", ArrayOf(StationSensor))
	Attribute("meta", MapOf(String, Any))
	Required("id", "name", "position", "flags", "internal", "fullKey", "sensors")
})
View Source
var StationProgress = ResultType("application/vnd.app.stations.progress", func() {
	TypeName("StationProgress")
	Attributes(func() {
		Attribute("jobs", ArrayOf(StationJob))
		Required("jobs")
	})
	View("default", func() {
		Attribute("jobs")
	})
})
View Source
var StationProjectAttribute = Type("StationProjectAttribute", func() {
	Attribute("projectId", Int32)
	Attribute("attributeId", Int64)
	Attribute("name", String)
	Attribute("stringValue", String)
	Attribute("priority", Int32)
	Required("projectId", "attributeId", "name", "stringValue", "priority")
})
View Source
var StationProjectAttributes = Type("StationProjectAttributes", func() {
	Attribute("attributes", ArrayOf(StationProjectAttribute))
	Required("attributes")
})
View Source
var StationRegion = Type("StationRegion", func() {
	Attribute("name", String)
	Attribute("shape", ArrayOf(ArrayOf(ArrayOf(Float64))))
	Required("name", "shape")
})
View Source
var StationSensor = Type("StationSensor", func() {
	Attribute("name", String)
	Attribute("unitOfMeasure", String)
	Attribute("reading", SensorReading)
	Attribute("key", String)
	Attribute("fullKey", String)
	Attribute("ranges", ArrayOf(SensorRange))
	Attribute("meta", MapOf(String, Any))
	Required("name", "unitOfMeasure", "key", "fullKey", "ranges")
})
View Source
var StationSummary = Type("StationSummary", func() {
	Attribute("id", Int64)
	Attribute("name", String)
	Required("id", "name")
})
View Source
var StationUpload = Type("StationUpload", func() {
	Attribute("id", Int64)
	Attribute("time", Int64)
	Attribute("uploadId", String)
	Attribute("size", Int64)
	Attribute("url", String)
	Attribute("type", String)
	Attribute("blocks", ArrayOf(Int64))
	Required("id", "time", "uploadId", "size", "url", "type", "blocks")
})
View Source
var StationsFull = ResultType("application/vnd.app.stations.full", func() {
	TypeName("StationsFull")
	Attributes(func() {
		Attribute("stations", CollectionOf(StationFull))
		Required("stations")
	})
	View("default", func() {
		Attribute("stations")
	})
})
View Source
var ThreadedPost = ResultType("application/vnd.app.discussion.post", func() {
	TypeName("ThreadedPost")
	Attributes(func() {
		Attribute("id", Int64)
		Attribute("createdAt", Int64)
		Attribute("updatedAt", Int64)
		Attribute("author", PostAuthor)
		Attribute("replies", ArrayOf("ThreadedPost"))
		Attribute("body", String)
		Attribute("bookmark", String)
		Required("id", "createdAt", "updatedAt", "author", "replies", "body")
	})
	View("default", func() {
		Attribute("id")
		Attribute("createdAt")
		Attribute("updatedAt")
		Attribute("author")
		Attribute("replies")
		Attribute("body")
		Attribute("bookmark")
	})
})
View Source
var TransmissionToken = ResultType("application/vnd.app.user.transmission.token+json", func() {
	TypeName("TransmissionToken")
	Attributes(func() {
		Attribute("token", String)
		Attribute("url", String)
		Required("token")
		Required("url")
	})
	View("default", func() {
		Attribute("token")
		Attribute("url")
	})
})
View Source
var UpdateUserFields = Type("UpdateUserFields", func() {
	Reference(AddUserFields)
	Attribute("name")
	Attribute("email")
	Attribute("bio")
	Required("name", "email", "bio")
})
View Source
var UpdateUserPasswordFields = Type("UpdateUserPasswordFields", func() {
	Attribute("oldPassword", String, func() {
		MinLength(10)
	})
	Attribute("newPassword", String, func() {
		MinLength(10)
	})
	Required("oldPassword", "newPassword")
})
View Source
var User = ResultType("application/vnd.app.user+json", func() {
	TypeName("User")
	Reference(AddUserFields)
	Attributes(func() {
		Attribute("id", Int32)
		Attribute("name")
		Attribute("email")
		Attribute("bio")
		Attribute("photo", UserPhoto)
		Attribute("admin", Boolean)
		Attribute("updatedAt", Int64)
		Attribute("tncDate", Int64)
		Required("id", "name", "email", "bio", "admin", "updatedAt", "tncDate")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("email")
		Attribute("bio")
		Attribute("photo")
		Attribute("admin")
		Attribute("updatedAt")
		Attribute("tncDate")
	})
})
View Source
var UserExports = ResultType("application/vnd.app.exports", func() {
	TypeName("UserExports")
	Attributes(func() {
		Attribute("exports", ArrayOf(ExportStatus))
		Required("exports")
	})
	View("default", func() {
		Attribute("exports")
	})
})
View Source
var UserPhoto = Type("UserPhoto", func() {
	Attribute("url", String)
})

Functions

func DateTimeFormatting

func DateTimeFormatting()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL