Documentation
¶
Index ¶
- Constants
- Variables
- func CategorizedDetailErr(category, message, reason string, params map[string]string, err error) error
- func CategorizedErr(category, message string, err error) error
- func ClientErr(err error) error
- func ClientErrf(format string, a ...any) error
- func MethodHasUnboundedRuntime(method string) bool
- func QuietClientErr(err error) error
- func QuietClientErrf(format string, a ...any) error
- type ActiveMedia
- type ActiveMediaQueryParams
- type ActiveMediaResponse
- type ActiveProfile
- type AddMappingParams
- type AllMappingsParams
- type AllMappingsResponse
- type AuthLinkStatusResponse
- type BackupCategoryStatus
- type BackupNameParams
- type BackupRemoteRestoreParams
- type BackupStateNotification
- type BackupStatusEntry
- type BackupStatusResponse
- type BackupWarning
- type BrowseEntry
- type BrowseIndexGroup
- type BrowseIndexResults
- type BrowseParams
- type BrowseResults
- type CategorizedError
- type ClientError
- type ClientResponse
- type ClientsCurrentResponse
- type ClientsDeleteParams
- type ClientsPairStartParams
- type ClientsPairStartResponse
- type ClientsPairedNotification
- type ClientsResponse
- type DeckCardScriptInput
- type DeckCoverInput
- type DeckItemInput
- type DeckItemMedia
- type DeckItemResponse
- type DeckResponse
- type DecksChangedNotification
- type DecksDeleteParams
- type DecksGetParams
- type DecksImageParams
- type DecksNewParams
- type DecksOpenParams
- type DecksParams
- type DecksResponse
- type DecksUpdateParams
- type DeleteClientParams
- type DeleteInboxParams
- type DeleteMappingParams
- type DeleteProfileParams
- type DeviceBattery
- type DeviceBluetooth
- type DeviceBluetoothDevice
- type DeviceBluetoothDeviceParams
- type DeviceBluetoothPairing
- type DeviceBluetoothScanParams
- type DeviceBluetoothState
- type DeviceCapabilities
- type DeviceChangedDisplay
- type DeviceChangedNetwork
- type DeviceChangedNotification
- type DeviceChangedPower
- type DeviceChangedTime
- type DeviceController
- type DeviceControllerBattery
- type DeviceControllers
- type DeviceDisplay
- type DeviceInterface
- type DeviceNetwork
- type DevicePower
- type DeviceStatusResponse
- type DeviceStorage
- type DeviceSystem
- type DeviceTime
- type DeviceVolume
- type ErrorData
- type ErrorObject
- type ExtendPlaytimeParams
- type ExtendPlaytimeResponse
- type HealthCheckResponse
- type HistoryResponse
- type HistoryResponseEntry
- type InboxMessage
- type InboxResponse
- type IndexingScanResponse
- type IndexingStatusResponse
- type InputGamepadParams
- type InputKeyboardParams
- type Launcher
- type LauncherRuntime
- type LaunchersParams
- type LaunchersResponse
- type LogDownloadResponse
- type MappingResponse
- type MediaActiveImageParams
- type MediaAssetParams
- type MediaAssetResponse
- type MediaCleanOrphansResponse
- type MediaControlParams
- type MediaHistoryLatestEntry
- type MediaHistoryLatestResponse
- type MediaHistoryParams
- type MediaHistoryResponse
- type MediaHistoryResponseEntry
- type MediaHistoryTopEntry
- type MediaHistoryTopParams
- type MediaHistoryTopResponse
- type MediaImageParams
- type MediaImageResponse
- type MediaIndexParams
- type MediaLookupCandidatesParams
- type MediaLookupCandidatesResponse
- type MediaLookupMatch
- type MediaLookupParams
- type MediaLookupResponse
- type MediaMetaBatchItemResponse
- type MediaMetaBatchResponse
- type MediaMetaMediaResponse
- type MediaMetaParams
- type MediaMetaPropertyItem
- type MediaMetaResponse
- type MediaMetaSystemResponse
- type MediaMetaTitleResponse
- type MediaMetaUpdateParams
- type MediaPlaybackState
- type MediaResponse
- type MediaScrapeParams
- type MediaScrapePath
- type MediaScrapeScope
- type MediaStartedParams
- type MediaStoppedParams
- type MediaTagsChangedNotification
- type MediaTagsUpdateParams
- type MediaTitleParseParams
- type MediaTitleParseResponse
- type MisterCoreInfo
- type NewClientParams
- type NewProfileParams
- type Notification
- type NotificationObject
- type OnlineStatusResponse
- type PaginationInfo
- type PairedClient
- type PlaylistItemInfo
- type PlaylistState
- type PlaylistsChangedParams
- type PlaylistsUpdateParams
- type PlaytimeExtendedParams
- type PlaytimeLimitReachedParams
- type PlaytimeLimitWarningParams
- type PlaytimeLimitsResponse
- type PlaytimeStatusResponse
- type ProfileResponse
- type ProfileVerifyResponse
- type ProfilesActiveNotification
- type ProfilesDataNotification
- type ProfilesResponse
- type QuietClientError
- type RPCID
- func (id *RPCID) Equal(other RPCID) bool
- func (id *RPCID) IsAbsent() bool
- func (id *RPCID) IsAbsentOrNull() bool
- func (id *RPCID) IsNull() bool
- func (id *RPCID) Key() string
- func (id RPCID) MarshalJSON() ([]byte, error)
- func (id *RPCID) String() string
- func (id *RPCID) UnmarshalJSON(data []byte) error
- type ReaderConnection
- type ReaderInfo
- type ReaderResponse
- type ReaderWriteCancelParams
- type ReaderWriteParams
- type ReadersResponse
- type RemoteActivityEntry
- type RemoteActivityParams
- type RemoteActivityResponse
- type RemoteStatusInfo
- type RequestObject
- type ResponseErrorObject
- type ResponseObject
- type ResponseWithCallback
- type RunFailedParams
- type RunParams
- type RunScriptParams
- type ScrapeSystemProgressResponse
- type ScraperInfo
- type ScrapersResponse
- type ScrapingStatusResponse
- type ScreenshotResponse
- type SearchParams
- type SearchResultMedia
- type SearchResults
- type SettingsAuthClaimParams
- type SettingsAuthClaimResponse
- type SettingsAuthLinkParams
- type SettingsAuthStatusParams
- type SettingsAuthStatusResponse
- type SettingsAuthUnlinkResponse
- type SettingsResponse
- type SwitchProfileParams
- type System
- type SystemDefault
- type SystemsParams
- type SystemsResponse
- type TagsResponse
- type TokenResponse
- type TokensResponse
- type TrackInfo
- type UIChoice
- type UIChoiceMedia
- type UIEvent
- type UIEventKind
- type UIOutcome
- type UIResolution
- type UIRespondParams
- type UIResponseAction
- type UIStateResponse
- type UpdateActiveMediaParams
- type UpdateApplyParams
- type UpdateApplyResponse
- type UpdateBlockedBy
- type UpdateCheckResponse
- type UpdateLastResult
- type UpdateMappingParams
- type UpdatePlaytimeLimitsParams
- type UpdateProfileParams
- type UpdateSettingsParams
- type UpdateStateNotification
- type VerifyProfileParams
- type VersionResponse
Constants ¶
const ( ErrorCategoryBusy = "busy" ErrorCategoryMediaNotFound = "media_not_found" ErrorCategoryDisabled = "disabled" ErrorCategoryInvalidScript = "invalid_script" ErrorCategoryBlocked = "blocked" ErrorCategoryPlaytimeLimit = "playtime_limit" ErrorCategoryCancelled = "cancelled" ErrorCategoryTimeout = "timeout" ErrorCategoryExecutionFailed = "execution_failed" ErrorCategoryLaunchRepair = "launch_repair" // ErrorCategoryUnsupported means this device cannot do what was asked. ErrorCategoryUnsupported = "unsupported" // ErrorCategoryNotPermitted means the device could do it but its operating // system refuses Core. ErrorCategoryNotPermitted = "not_permitted" )
Error categories emitted in ErrorData.Category. Clients branch on these values, so add new ones rather than renaming existing ones.
const ( DeviceUnsupported = "unsupported" DeviceSupported = "supported" DeviceNotPermitted = "notPermitted" )
Availability values reported in DeviceCapabilities.
const ( DeviceSectionPower = "power" DeviceSectionNetwork = "network" DeviceSectionBluetooth = "bluetooth" DeviceSectionStorage = "storage" DeviceSectionDisplay = "display" DeviceSectionControllers = "controllers" DeviceSectionTime = "time" DeviceSectionSystem = "system" )
Section names used as keys in DeviceCapabilities.Sections.
const ( BluetoothPairingPairing = "pairing" BluetoothPairingPaired = "paired" BluetoothPairingFailed = "failed" )
Bluetooth pairing states reported in DeviceBluetoothPairing.State.
const ( BluetoothErrorPinRequired = "pinRequired" BluetoothErrorNotPowered = "notPowered" BluetoothErrorTimeout = "timeout" BluetoothErrorRejected = "rejected" BluetoothErrorNotFound = "notFound" BluetoothErrorFailed = "failed" )
Bluetooth pairing failures reported in DeviceBluetoothPairing.Error.
const ( NotificationReadersConnected = "readers.added" NotificationReadersDisconnected = "readers.removed" NotificationRunning = "running" NotificationTokensAdded = "tokens.added" NotificationTokensRemoved = "tokens.removed" NotificationStopped = "media.stopped" NotificationStarted = "media.started" NotificationMediaIndexing = "media.indexing" // TODO: rename to generating NotificationMediaScraping = "media.scraping" NotificationMediaVisibility = "media.visibility" NotificationMediaHistoryChanged = "media.history.changed" NotificationMediaTagsChanged = "media.tags.changed" NotificationTokensStaged = "tokens.staged" NotificationTokensStagedReady = "tokens.staged.ready" //nolint:gosec // not a credential NotificationPlaytimeLimitReached = "playtime.limit.reached" NotificationPlaytimeLimitWarning = "playtime.limit.warning" NotificationPlaytimeExtended = "playtime.extended" NotificationInboxAdded = "inbox.added" NotificationClientsPaired = "clients.paired" NotificationProfilesActive = "profiles.active" NotificationProfilesData = "profiles.data" NotificationDecksChanged = "decks.changed" NotificationUIChanged = "ui.changed" NotificationAuthLinkStatus = "auth.link.status" NotificationBackupState = "backup.state" NotificationUpdateState = "update.state" NotificationRunFailed = "run.failed" NotificationDeviceChanged = "device.changed" NotificationDeviceBluetooth = "device.bluetooth.changed" NotificationPlaylistsChanged = "playlists.changed" NotificationMediaPlayback = "media.playback" )
const ( ProfilesDataApplied = "applied" ProfilesDataDeferred = "deferred" ProfilesDataFailed = "failed" )
Profile data swap statuses reported by the profiles.data notification.
const ( PlaytimeLimitReasonSession = "session" PlaytimeLimitReasonDaily = "daily" // PlaytimeExtendModeDuration adds time to the current session. PlaytimeExtendModeDuration = "duration" // PlaytimeExtendModeToday waives the session limit until midnight. PlaytimeExtendModeToday = "today" )
const ( MethodLaunch = "launch" // DEPRECATED MethodRun = "run" MethodConfirm = "confirm" MethodUI = "ui" MethodUIRespond = "ui.respond" MethodRunScript = "run.script" MethodStop = "stop" MethodTokens = "tokens" MethodMedia = "media" MethodMediaGenerate = "media.generate" MethodMediaGenerateCancel = "media.generate.cancel" MethodMediaGenerateResume = "media.generate.resume" MethodMediaIndex = "media.index" // DEPRECATED MethodMediaSearch = "media.search" MethodMediaTags = "media.tags" MethodMediaTagsUpdate = "media.tags.update" MethodMediaMetaUpdate = "media.meta.update" MethodMediaActive = "media.active" MethodMediaHistory = "media.history" MethodMediaHistoryLatest = "media.history.latest" MethodMediaHistoryTop = "media.history.top" MethodMediaLookup = "media.lookup" MethodMediaLookupCandidates = "media.lookup.candidates" MethodMediaMeta = "media.meta" MethodMediaImage = "media.image" MethodMediaAsset = "media.asset" MethodScrapers = "scrapers" MethodMediaScrape = "media.scrape" MethodMediaScrapeStatus = "media.scrape.status" MethodMediaScrapeCancel = "media.scrape.cancel" MethodMediaScrapeResume = "media.scrape.resume" MethodMediaBrowse = "media.browse" MethodMediaBrowseIndex = "media.browse.index" MethodMediaControl = "media.control" MethodMediaActiveUpdate = "media.active.update" MethodMediaActiveImage = "media.active.image" MethodPlaylistsUpdate = "playlists.update" MethodMediaCleanOrphans = "media.clean.orphans" MethodSettings = "settings" MethodSettingsUpdate = "settings.update" MethodSettingsZapScriptHold = "settings.zapscript.hold" MethodSettingsReload = "settings.reload" MethodSettingsLogsDownload = "settings.logs.download" MethodSettingsBackup = "settings.backup" MethodSettingsBackupList = "settings.backup.list" MethodSettingsBackupInspect = "settings.backup.inspect" MethodSettingsBackupDelete = "settings.backup.delete" MethodSettingsBackupRestore = "settings.backup.restore" MethodSettingsBackupStatus = "settings.backup.status" MethodSettingsBackupRemoteRun = "settings.backup.remote.run" MethodSettingsBackupRemoteList = "settings.backup.remote.list" MethodSettingsBackupRemoteRestore = "settings.backup.remote.restore" MethodPlaytimeLimits = "settings.playtime.limits" MethodPlaytimeLimitsUpdate = "settings.playtime.limits.update" MethodPlaytime = "playtime" MethodPlaytimeExtend = "playtime.extend" MethodClients = "clients" MethodClientsCurrent = "clients.current" MethodClientsDelete = "clients.delete" MethodClientsPairStart = "clients.pair.start" MethodClientsPairCancel = "clients.pair.cancel" MethodProfiles = "profiles" MethodProfilesNew = "profiles.new" MethodProfilesUpdate = "profiles.update" MethodProfilesDelete = "profiles.delete" MethodProfilesActive = "profiles.active" MethodProfilesSwitch = "profiles.switch" MethodDecks = "decks" MethodDecksGet = "decks.get" MethodDecksNew = "decks.new" MethodDecksUpdate = "decks.update" MethodDecksDelete = "decks.delete" MethodDecksOpen = "decks.open" MethodDecksImage = "decks.image" MethodProfilesVerify = "profiles.verify" MethodSystems = "systems" MethodLaunchers = "launchers" MethodLaunchersRefresh = "launchers.refresh" MethodHistory = "tokens.history" MethodMappings = "mappings" MethodMappingsNew = "mappings.new" MethodMappingsDelete = "mappings.delete" MethodMappingsUpdate = "mappings.update" MethodMappingsReload = "mappings.reload" MethodReaders = "readers" MethodReadersWrite = "readers.write" MethodReadersWriteCancel = "readers.write.cancel" MethodVersion = "version" MethodHealthCheck = "health" MethodInbox = "inbox" MethodInboxDelete = "inbox.delete" MethodInboxClear = "inbox.clear" MethodSettingsAuthClaim = "settings.auth.claim" MethodSettingsAuthStatus = "settings.auth.status" MethodSettingsAuthUnlink = "settings.auth.unlink" MethodSettingsAuthLink = "settings.auth.link" MethodSettingsAuthLinkStatus = "settings.auth.link.status" MethodSettingsAuthLinkCancel = "settings.auth.link.cancel" MethodUpdateCheck = "update.check" MethodUpdateStatus = "update.status" MethodUpdateApply = "update.apply" MethodInputKeyboard = "input.keyboard" MethodInputGamepad = "input.gamepad" MethodScreenshot = "screenshot" MethodMediaTitleParse = "media.title.parse" MethodRemoteActivity = "remote.activity" MethodOnlineStatus = "online.status" MethodDeviceStatus = "device.status" MethodDevicePowerReboot = "device.power.reboot" MethodDevicePowerShutdown = "device.power.shutdown" MethodDevicePowerSuspend = "device.power.suspend" MethodDeviceBluetoothDevices = "device.bluetooth.devices" MethodDeviceBluetoothScanStart = "device.bluetooth.scan.start" MethodDeviceBluetoothScanStop = "device.bluetooth.scan.stop" MethodDeviceBluetoothPair = "device.bluetooth.pair" MethodDeviceBluetoothForget = "device.bluetooth.forget" )
const ( DeckCoverKindMedia = "media" DeckCoverKindFile = "file" DeckCoverKindNone = "none" )
Deck cover kinds for decks.update.
const ( // MediaStopReasonFinished means the media reached its natural end. MediaStopReasonFinished = "finished" // MediaStopReasonExited means the media stopped without Core asking it // to, such as a player quitting a game back to the menu. MediaStopReasonExited = "exited" // MediaStopReasonStopped means Core stopped the media on request. MediaStopReasonStopped = "stopped" // MediaStopReasonReplaced means other media took its place. MediaStopReasonReplaced = "replaced" )
MediaStopReason values for MediaStoppedParams.Reason.
const ( BrowseIndexEntryTypeMedia = "media" BrowseIndexEntryTypeDirectory = "directory" )
Entry types a media.browse.index response can describe.
const ( LauncherBackendCommand = "command" LauncherBackendMisterCore = "mister_core" )
Launcher backend identifiers. Reused by pkg/config for custom launcher definitions, so this is the one place the vocabulary is defined.
const ( DecksChangedCreated = "created" DecksChangedUpdated = "updated" DecksChangedDeleted = "deleted" DecksChangedRefreshed = "refreshed" )
Deck change actions carried by the decks.changed notification.
const ( AuthLinkStatusNone = "none" AuthLinkStatusPending = "pending" AuthLinkStatusApproved = "approved" AuthLinkStatusFailed = "failed" AuthLinkStatusCancelled = "cancelled" )
Auth link session statuses (settings.auth.link).
const OnlineFeatureCloudBackup = "cloud_backup"
OnlineFeatureCloudBackup is the account feature that allows remote backups. Core reads it to decide whether remote backups are available.
Variables ¶
var ErrInvalidRPCID = errors.New("JSON-RPC ID cannot be an object or array")
ErrInvalidRPCID is returned when an ID is an object or array.
var NullRPCID = RPCID{RawMessage: []byte("null")}
NullRPCID represents a null JSON-RPC ID.
Functions ¶
func CategorizedDetailErr ¶ added in v2.19.0
func CategorizedDetailErr(category, message, reason string, params map[string]string, err error) error
CategorizedDetailErr wraps err with a stable category, a safe message and the structured detail a client needs to write its own wording. Only categories that document a reason and parameters populate them; everything else keeps using CategorizedErr and sends the category alone.
func CategorizedErr ¶ added in v2.17.0
CategorizedErr wraps err with a stable category and a safe message.
func ClientErrf ¶ added in v2.11.0
ClientErrf creates a new formatted ClientError.
func MethodHasUnboundedRuntime ¶ added in v2.16.0
MethodHasUnboundedRuntime reports whether a method may run without a fixed whole-operation deadline. Full-device backup and restore work is bounded by caller cancellation, shutdown, and per-transfer timeouts instead; both the server request context and the local client wait consult this list so the two cannot disagree.
update.apply belongs here for the same reason: it downloads an archive over whatever connection the device has, and the request context cancelling mid-install would abort the one operation that must either finish or unwind cleanly. Its own stall guard and probe timeouts bound the stages instead.
func QuietClientErr ¶ added in v2.14.0
QuietClientErr wraps an error as a QuietClientError.
func QuietClientErrf ¶ added in v2.14.0
QuietClientErrf creates a formatted QuietClientError that the API server logs at debug level instead of warning level.
Types ¶
type ActiveMedia ¶
type ActiveMedia struct {
Started time.Time `json:"started"`
RelPath *string `json:"relativePath,omitempty"`
PositionMs *int64 `json:"positionMs,omitempty"`
DurationMs *int64 `json:"durationMs,omitempty"`
// Track is what the tags of an audio track played in-process say about
// it, omitted when it has none or they have not been read yet.
Track *TrackInfo `json:"track,omitempty"`
PlaybackState MediaPlaybackState `json:"playbackState,omitempty"`
LauncherID string `json:"launcherId"`
SystemID string `json:"systemId"`
SystemName string `json:"systemName"`
Path string `json:"mediaPath"`
Name string `json:"mediaName"`
Slot string `json:"slot,omitempty"`
LauncherControls []string `json:"launcherControls,omitempty"`
MediaID int64 `json:"mediaId,omitempty"`
}
func NewActiveMedia ¶ added in v2.7.0
func NewActiveMedia(systemID, systemName, path, name, launcherID string) *ActiveMedia
NewActiveMedia creates a new ActiveMedia with the current timestamp.
func (*ActiveMedia) Equal ¶
func (a *ActiveMedia) Equal(with *ActiveMedia) bool
type ActiveMediaQueryParams ¶ added in v2.15.0
type ActiveMediaQueryParams struct {
Slot string `json:"slot,omitempty"`
}
ActiveMediaQueryParams holds the optional filter parameters for the media.active method. Slot selects which slot to read; defaults to primary when empty.
type ActiveMediaResponse ¶ added in v2.9.0
type ActiveMediaResponse struct {
ZapScript string `json:"zapScript"`
ActiveMedia
}
ActiveMediaResponse is the API response type for active media, including ZapScript.
type ActiveProfile ¶ added in v2.16.0
type ActiveProfile struct {
LimitsEnabled *bool `json:"limitsEnabled,omitempty"`
DailyLimit *string `json:"dailyLimit,omitempty"`
SessionLimit *string `json:"sessionLimit,omitempty"`
ProfileID string `json:"profileId"`
Name string `json:"name"`
Role string `json:"role"`
HasPIN bool `json:"hasPin"`
}
ActiveProfile is a snapshot of the device's active profile, held in service state and broadcast on the profiles.active notification. It carries the resolved limit overrides so the playtime hot path never touches the database. Nil limit fields mean "inherit global config".
type AddMappingParams ¶
type AddMappingParams struct {
Label string `json:"label" validate:"max=255"`
Type string `json:"type" validate:"required,oneof=id value data uid text"`
Match string `json:"match" validate:"required,oneof=exact partial regex"`
Pattern string `json:"pattern" validate:"required"`
Override string `json:"override"`
Enabled bool `json:"enabled"`
}
type AllMappingsParams ¶ added in v2.15.0
type AllMappingsParams struct {
// IncludeReadOnly also returns read-only mappings loaded from the mappings
// folder. Defaults to false so older clients keep receiving DB mappings only.
IncludeReadOnly bool `json:"includeReadOnly,omitempty"`
}
type AllMappingsResponse ¶
type AllMappingsResponse struct {
Mappings []MappingResponse `json:"mappings"`
}
type AuthLinkStatusResponse ¶ added in v2.16.0
type AuthLinkStatusResponse struct {
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
Status string `json:"status"`
UserCode string `json:"userCode,omitempty"`
VerificationURL string `json:"verificationUrl,omitempty"`
VerificationURLComplete string `json:"verificationUrlComplete,omitempty"`
Error string `json:"error,omitempty"`
}
AuthLinkStatusResponse is the state of the reverse (QR / user code) device link flow. It is returned by settings.auth.link and settings.auth.link.status, and pushed as the auth.link.status notification on every transition. Notifications omit user codes and verification URLs.
type BackupCategoryStatus ¶ added in v2.16.0
type BackupNameParams ¶ added in v2.16.0
type BackupNameParams struct {
Name string `json:"name" validate:"required"`
}
type BackupRemoteRestoreParams ¶ added in v2.16.0
type BackupRemoteRestoreParams struct {
ID string `json:"id" validate:"required"`
}
type BackupStateNotification ¶ added in v2.16.0
type BackupStateNotification struct {
Operation string `json:"operation,omitempty"`
Paused bool `json:"paused"`
Throttled bool `json:"throttled"`
Finished bool `json:"finished,omitempty"`
}
BackupStateNotification is the payload for the backup.state notification, sent while a backup operation is running whenever its pause/throttle state changes in response to a game starting or stopping, and once with Finished set when the operation ends (whatever its outcome). Operation is the active operation kind from settings.backup.status (e.g. "remote-upload").
type BackupStatusEntry ¶ added in v2.16.0
type BackupStatusEntry struct {
LastRunAt *string `json:"lastRunAt,omitempty"`
LastSuccessAt *string `json:"lastSuccessAt,omitempty"`
LastSnapshotCreatedAt *string `json:"lastSnapshotCreatedAt,omitempty"`
AvailabilityCheckedAt *string `json:"availabilityCheckedAt,omitempty"`
DeviceName *string `json:"deviceName,omitempty"`
LinkedAt *string `json:"linkedAt,omitempty"`
Categories map[string]BackupCategoryStatus `json:"categories,omitempty"`
Schedule string `json:"schedule,omitempty"`
LastError string `json:"lastError,omitempty"`
Availability string `json:"availability,omitempty"`
LastStatus string `json:"lastStatus"`
Warnings []BackupWarning `json:"warnings,omitempty"`
LastBackupSize int64 `json:"lastBackupSize"`
SkippedFiles int `json:"skippedFiles,omitempty"`
Linked bool `json:"linked,omitempty"`
Enabled bool `json:"enabled"`
// LastRunNoChanges marks the most recent successful run as verified-
// unchanged: the server already held an identical snapshot, so nothing
// new was stored. LastSuccessAt still advances on such runs;
// LastSnapshotCreatedAt is when the stored content last changed.
LastRunNoChanges bool `json:"lastRunNoChanges,omitempty"`
}
type BackupStatusResponse ¶ added in v2.16.0
type BackupStatusResponse struct {
ActiveSince *string `json:"activeSince,omitempty"`
ActiveOperation string `json:"activeOperation,omitempty"`
Local BackupStatusEntry `json:"local"`
Remote BackupStatusEntry `json:"remote"`
}
type BackupWarning ¶ added in v2.16.0
type BrowseEntry ¶ added in v2.10.0
type BrowseEntry struct {
SystemID *string `json:"systemId,omitempty"`
RelPath *string `json:"relativePath,omitempty"`
ZapScript *string `json:"zapScript,omitempty"`
FileCount *int `json:"fileCount,omitempty"`
Group *string `json:"group,omitempty"`
Path string `json:"path"`
Type string `json:"type"`
Name string `json:"name"`
// CoverColor is the cover thumbnail's average colour as "#rrggbb".
// Omitted until a thumbnail was built.
CoverColor string `json:"coverColor,omitempty"`
SystemIDs []string `json:"systemIds,omitempty"`
Tags []database.TagInfo `json:"tags,omitempty"`
DisambiguatingTags []database.TagInfo `json:"disambiguatingTags,omitempty"`
MediaID int64 `json:"mediaId,omitempty"`
HasCover bool `json:"hasCover"`
// MultiDisc marks a directory entry that stands for several disc images
// of one game. Its launch fields point at the disc last played from it, or
// the first disc; the others are listed by browsing the entry's path.
MultiDisc bool `json:"multiDisc,omitempty"`
}
type BrowseIndexGroup ¶ added in v2.15.0
type BrowseIndexGroup struct {
Key string `json:"key"`
Label string `json:"label"`
Cursor string `json:"cursor"`
Count int `json:"count"`
Offset int `json:"offset"`
}
BrowseIndexGroup is one first-character section of a browse list. Key is the stable bucket identifier and Label is what to display (equal for the Latin scheme; separated so a future locale scheme can show a glyph differing from the key). Cursor is an opaque media.browse cursor positioned just before the bucket's first row: passing it to media.browse with the same scope returns a continuous page that begins at the bucket. Clients must treat Key and Cursor as opaque. Offset is the 0-based position of the bucket's first item among the scope's media files (excluding any leading directories), for clients that jump to a position in the full list rather than reload from the cursor.
When BrowseIndexResults.EntryType is "directory" the groups describe the scope's directory entries instead: Count is a number of directories and Offset is the position among the directory entries media.browse lists, so no leading-directory count is added to it.
type BrowseIndexResults ¶ added in v2.15.0
type BrowseIndexResults struct {
Scheme string `json:"scheme"`
EntryType string `json:"entryType"`
Groups []BrowseIndexGroup `json:"groups"`
TotalFiles int `json:"totalFiles"`
}
BrowseIndexResults is the response for media.browse.index. Scheme reports the collation used to derive buckets ("latin"), or "none" when no letter rail applies to the scope (non-alphabetical sort, or a root listing); Groups is then empty. Groups is authoritative and already ordered for the active sort; clients render it as-is without assuming any alphabet.
EntryType says what the groups count: "media" for the scope's media files, or "directory" when the scope has no media files of its own and the groups were computed over its directory entries. A Core that predates the field omits it, which a client reads as "media".
type BrowseParams ¶ added in v2.10.0
type BrowseParams struct {
Systems *[]string `json:"systems" validate:"omitempty,dive,min=1"`
FuzzySystem *bool `json:"fuzzySystem,omitempty"`
Path *string `json:"path,omitempty"`
RootView *string `json:"rootView,omitempty" validate:"omitempty,oneof=routes contents"`
MaxResults *int `json:"maxResults,omitempty" validate:"omitempty,gt=0,max=1000"`
Cursor *string `json:"cursor,omitempty"`
Tags *[]string `json:"tags,omitempty" validate:"omitempty,dive,min=1"`
Letter *string `json:"letter,omitempty" validate:"omitempty,letter"`
Sort *string `json:"sort,omitempty" validate:"omitempty,oneof=name-asc name-desc filename-asc filename-desc"`
// Offset starts the page at this absolute position in the listing,
// directories first, then files.
Offset *int `json:"offset,omitempty" validate:"omitempty,gte=0"`
// AnchorPath returns the page holding this path, starting at the largest
// multiple of the page size that is not after the path's position.
AnchorPath *string `json:"anchorPath,omitempty" validate:"omitempty,min=1"`
IncludeHidden bool `json:"includeHidden,omitempty"`
// Live lists Path straight from disk instead of from the media index,
// for folders the index does not cover.
Live bool `json:"live,omitempty"`
}
type BrowseResults ¶ added in v2.10.0
type BrowseResults struct {
Pagination *PaginationInfo `json:"pagination,omitempty"`
// RelPath is the browsed directory's own launcher-relative path. Set
// only for a single-system browse of a folder under that system's
// launcher folders.
RelPath *string `json:"relativePath,omitempty"`
Path string `json:"path"`
Entries []BrowseEntry `json:"entries"`
TotalFiles int `json:"totalFiles"`
TotalDirs int `json:"totalDirs"`
}
type CategorizedError ¶ added in v2.17.0
type CategorizedError struct {
Err error
Params map[string]string
Category string
Message string
Reason string
}
CategorizedError is a client-facing failure with a stable category and a message that is safe to send over the API. Error() returns only the safe message; the underlying cause is reachable through Unwrap for logging and errors.Is, but never reaches the wire because it may contain filesystem paths or token contents.
func (*CategorizedError) Error ¶ added in v2.17.0
func (e *CategorizedError) Error() string
func (*CategorizedError) Unwrap ¶ added in v2.17.0
func (e *CategorizedError) Unwrap() error
type ClientError ¶ added in v2.11.0
type ClientError struct {
Err error
}
ClientError wraps an error to indicate it is an expected client-facing error (bad input, validation failure, expected operational state) rather than an internal server error. The API server uses this to log at Warn level instead of Error, keeping expected failures out of Sentry.
func (*ClientError) Error ¶ added in v2.11.0
func (e *ClientError) Error() string
func (*ClientError) Unwrap ¶ added in v2.11.0
func (e *ClientError) Unwrap() error
type ClientResponse ¶
type ClientsCurrentResponse ¶ added in v2.16.0
type ClientsCurrentResponse struct {
Role *string `json:"role"`
Capabilities []string `json:"capabilities"`
Access string `json:"access"`
Paired bool `json:"paired"`
}
ClientsCurrentResponse describes the current connection's paired identity and effective role capabilities. Role is null when the connection has no paired identity; capabilities remain populated from its legacy grant.
type ClientsDeleteParams ¶ added in v2.11.0
type ClientsDeleteParams struct {
ClientID string `json:"clientId"`
}
ClientsDeleteParams is the parameters object for the clients.delete RPC method.
type ClientsPairStartParams ¶ added in v2.16.0
type ClientsPairStartParams struct {
Role string `json:"role" validate:"omitempty,oneof=admin member"`
}
ClientsPairStartParams configures a new pairing flow. Role is the permission role the paired client will receive ("admin" or "member"); empty defaults to member.
type ClientsPairStartResponse ¶ added in v2.11.0
ClientsPairStartResponse is the response for the clients.pair.start RPC method.
type ClientsPairedNotification ¶ added in v2.11.0
type ClientsPairedNotification struct {
ClientID string `json:"clientId"`
ClientName string `json:"clientName"`
}
ClientsPairedNotification is the payload for the clients.paired notification, broadcast when a client successfully completes the PAKE pairing flow.
type ClientsResponse ¶ added in v2.11.0
type ClientsResponse struct {
Clients []PairedClient `json:"clients"`
}
ClientsResponse is the response for the clients RPC method.
type DeckCardScriptInput ¶ added in v2.18.0
type DeckCardScriptInput struct {
Name string `json:"name"`
ZapScript string `json:"zapscript" validate:"required,max=5000"`
}
DeckCardScriptInput is one script of a card item.
type DeckCoverInput ¶ added in v2.22.0
type DeckCoverInput struct {
Kind string `json:"kind" validate:"required,oneof=media file none"`
System string `json:"system,omitempty"`
Path string `json:"path,omitempty"`
}
DeckCoverInput sets or removes a deck's cover: a game's art (system and path), an image file on the Core host (path), or none.
type DeckItemInput ¶ added in v2.18.0
type DeckItemInput struct {
ID *int64 `json:"id,omitempty"`
MediaID *int64 `json:"mediaId,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Kind string `json:"kind" validate:"omitempty,oneof=media script card"`
Name string `json:"name" validate:"max=100"`
ZapScript string `json:"zapscript" validate:"max=5000"`
CardID string `json:"cardId" validate:"max=64"`
System string `json:"system"`
Path string `json:"path"`
Scripts []DeckCardScriptInput `json:"scripts,omitempty" validate:"omitempty,dive"`
}
DeckItemInput names one deck member as a client supplies it. kind "media" names an indexed game by mediaId or system plus path and is stored as a script item Core composes; "script" carries a name and ZapScript; "card" names an online card by ID with its scripts and metadata as pulled. In the items of decks.update, an input with only an id instead keeps that existing item as it is.
type DeckItemMedia ¶ added in v2.18.0
type DeckItemMedia struct {
System string `json:"system"`
Path string `json:"path"`
Name string `json:"name"`
Tags []string `json:"tags,omitempty"`
// UserTags is the linked file's user utility tags, [] when none is set.
UserTags []database.TagInfo `json:"userTags"`
Available bool `json:"available"`
}
DeckItemMedia is the local file a deck's game item is linked to on this device, and whether that file is currently indexed.
type DeckItemResponse ¶ added in v2.18.0
type DeckItemResponse struct {
Media *DeckItemMedia `json:"media,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Kind string `json:"kind"`
Name string `json:"name"`
ZapScript string `json:"zapscript,omitempty"`
CardID string `json:"cardId,omitempty"`
Scripts []DeckCardScriptInput `json:"scripts,omitempty"`
ID int64 `json:"id"`
Position int `json:"position"`
// HasImage reports card art decks.image can serve for a card item.
HasImage bool `json:"hasImage"`
}
DeckItemResponse is one member of a deck.
type DeckResponse ¶ added in v2.18.0
type DeckResponse struct {
Metadata json.RawMessage `json:"metadata,omitempty"`
DeckID string `json:"deckId"`
Name string `json:"name"`
Description string `json:"description"`
SourceURL string `json:"sourceUrl,omitempty"`
OwnedBy string `json:"ownedBy,omitempty"`
Items []DeckItemResponse `json:"items,omitzero"`
// ContainsItemIDs lists the items linked to the game the decks list was
// asked about, and is omitted when it was asked about none.
ContainsItemIDs []int64 `json:"containsItemIds,omitzero"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
ItemCount int `json:"itemCount"`
Owned bool `json:"owned"`
Locked bool `json:"locked"`
Saved bool `json:"saved"`
// HasImage reports a cover decks.image can serve.
HasImage bool `json:"hasImage"`
}
DeckResponse is a deck. Items is present, as [] for an empty deck, on decks.get, decks.new and decks.update, and omitted by the decks list.
type DecksChangedNotification ¶ added in v2.18.0
type DecksChangedNotification struct {
DeckID string `json:"deckId"`
Action string `json:"action"`
}
DecksChangedNotification is the payload for the decks.changed notification.
type DecksDeleteParams ¶ added in v2.18.0
type DecksDeleteParams struct {
DeckID string `json:"deckId" validate:"required,min=1"`
}
type DecksGetParams ¶ added in v2.18.0
type DecksGetParams struct {
DeckID string `json:"deckId" validate:"required,min=1"`
}
type DecksImageParams ¶ added in v2.22.0
type DecksImageParams struct {
ItemID *int64 `json:"itemId,omitempty"`
MaxSize *int32 `json:"maxSize,omitempty" validate:"omitempty,gt=0,max=8192"`
DeckID string `json:"deckId" validate:"required,min=1"`
Delivery string `json:"delivery,omitempty" validate:"omitempty,oneof=inline localPath"`
}
DecksImageParams asks for a deck's cover, or for a card item's art when ItemID is set. MaxSize and Delivery work as in media.image.
type DecksNewParams ¶ added in v2.18.0
type DecksNewParams struct {
Name string `json:"name" validate:"required,min=1,max=100"`
Description string `json:"description" validate:"max=1000"`
Items []DeckItemInput `json:"items" validate:"max=120,dive"`
}
type DecksOpenParams ¶ added in v2.18.0
type DecksOpenParams struct {
DeckID string `json:"deckId" validate:"required,min=1"`
Slot string `json:"slot"`
}
DecksOpenParams opens a deck as the active playlist. Slot selects the media slot, as the playlist commands' slot argument does.
type DecksParams ¶ added in v2.22.0
type DecksParams struct {
System *string `json:"system" validate:"omitempty,min=1"`
Path *string `json:"path" validate:"omitempty,min=1"`
}
DecksParams lists decks. System and Path name one game, both or neither; when given, every deck reports which of its items are linked to it.
type DecksResponse ¶ added in v2.18.0
type DecksResponse struct {
Decks []DeckResponse `json:"decks"`
}
DecksResponse is the response for the decks RPC method.
type DecksUpdateParams ¶ added in v2.18.0
type DecksUpdateParams struct {
Name *string `json:"name" validate:"omitempty,min=1,max=100"`
Description *string `json:"description" validate:"omitempty,max=1000"`
Items *[]DeckItemInput `json:"items" validate:"omitempty,max=120,dive"`
Cover *DeckCoverInput `json:"cover"`
DeckID string `json:"deckId" validate:"required,min=1"`
AddItems []DeckItemInput `json:"addItems" validate:"omitempty,max=120,dive"`
RemoveItemIDs []int64 `json:"removeItemIds"`
}
DecksUpdateParams edits a deck. items replaces the whole list and may keep existing items by id; addItems appends; removeItemIds drops members by their item id. They are applied as remove, replace, then append.
type DeleteClientParams ¶
type DeleteClientParams struct {
ID string `json:"id" validate:"required,min=1"`
}
type DeleteInboxParams ¶ added in v2.8.0
type DeleteInboxParams struct {
ID int64 `json:"id" validate:"gt=0"`
}
type DeleteMappingParams ¶
type DeleteMappingParams struct {
ID int `json:"id" validate:"gt=0"`
}
type DeleteProfileParams ¶ added in v2.16.0
type DeleteProfileParams struct {
ProfileID string `json:"profileId" validate:"required,min=1"`
}
type DeviceBattery ¶ added in v2.20.0
type DeviceBattery struct {
Percent *int `json:"percent"`
ChargeState *string `json:"chargeState"`
TimeRemaining *int64 `json:"timeRemaining,omitempty"`
ID string `json:"id"`
}
DeviceBattery is one battery the device runs on.
type DeviceBluetooth ¶ added in v2.20.0
type DeviceBluetoothDevice ¶ added in v2.22.0
type DeviceBluetoothDevice struct {
Name *string `json:"name"`
// DisplayName is the device's model name when Core knows its vendor and
// product IDs. Clients fall back to Name.
DisplayName *string `json:"displayName"`
// VendorID and ProductID are four lowercase hex digits, from the device's
// modalias.
VendorID *string `json:"vendorId"`
ProductID *string `json:"productId"`
// ControllerID is the matching device.status controller while the device
// is connected.
ControllerID *string `json:"controllerId"`
ID string `json:"id"`
Paired bool `json:"paired"`
Connected bool `json:"connected"`
Trusted bool `json:"trusted"`
Gamepad bool `json:"gamepad"`
}
DeviceBluetoothDevice is one Bluetooth device. ID is its address.
type DeviceBluetoothDeviceParams ¶ added in v2.22.0
type DeviceBluetoothDeviceParams struct {
ID string `json:"id" validate:"required"`
}
DeviceBluetoothDeviceParams names one Bluetooth device by its address.
type DeviceBluetoothPairing ¶ added in v2.22.0
type DeviceBluetoothPairing struct {
Error *string `json:"error"`
ID string `json:"id"`
State string `json:"state"`
// Attempt numbers pair requests in the order Core accepted them, so a
// client can tell a repeat outcome from the one before it and a reply
// from a later notification.
Attempt int `json:"attempt"`
}
DeviceBluetoothPairing is the latest pairing attempt. Error is set only when State is failed.
type DeviceBluetoothScanParams ¶ added in v2.22.0
type DeviceBluetoothScanParams struct {
TimeoutSeconds *int `json:"timeoutSeconds" validate:"omitempty,min=1,max=120"`
All bool `json:"all"`
}
DeviceBluetoothScanParams starts a Bluetooth scan. Unless All is set, only gamepads and joysticks are listed besides paired devices.
type DeviceBluetoothState ¶ added in v2.22.0
type DeviceBluetoothState struct {
Pairing *DeviceBluetoothPairing `json:"pairing"`
Devices []DeviceBluetoothDevice `json:"devices"`
Powered bool `json:"powered"`
Scanning bool `json:"scanning"`
}
DeviceBluetoothState is the result of the device.bluetooth methods and the payload of device.bluetooth.changed.
type DeviceCapabilities ¶ added in v2.20.0
type DeviceCapabilities struct {
Sections map[string]string `json:"sections"`
Actions map[string]string `json:"actions"`
}
DeviceCapabilities says what this device can report and do. Sections is keyed by section name and Actions by method name. A key that is absent means unsupported, so a client built against a newer Core still reads an older one correctly.
type DeviceChangedDisplay ¶ added in v2.20.0
type DeviceChangedDisplay struct {
Docked *bool `json:"docked"`
}
type DeviceChangedNetwork ¶ added in v2.20.0
type DeviceChangedNotification ¶ added in v2.20.0
type DeviceChangedNotification struct {
Power *DeviceChangedPower `json:"power"`
Network *DeviceChangedNetwork `json:"network"`
Bluetooth *DeviceBluetooth `json:"bluetooth"`
Display *DeviceChangedDisplay `json:"display"`
Controllers *DeviceControllers `json:"controllers"`
Time *DeviceChangedTime `json:"time"`
}
DeviceChangedNotification is the payload of device.changed. It is the whole of the state it covers, never a difference, and it leaves out everything that identifies the device on its network: notifications reach every connected client, including ones on an unencrypted connection.
type DeviceChangedPower ¶ added in v2.20.0
type DeviceChangedTime ¶ added in v2.20.0
type DeviceChangedTime struct {
ClockReliable bool `json:"clockReliable"`
}
type DeviceController ¶ added in v2.20.0
type DeviceController struct {
Name *string `json:"name"`
// DisplayName is the controller's model name when Core knows its vendor
// and product IDs. Clients fall back to Name.
DisplayName *string `json:"displayName"`
VendorID *string `json:"vendorId"`
ProductID *string `json:"productId"`
Battery *DeviceControllerBattery `json:"battery"`
ID string `json:"id"`
Connection string `json:"connection"`
}
type DeviceControllerBattery ¶ added in v2.20.0
type DeviceControllers ¶ added in v2.20.0
type DeviceControllers struct {
Items []DeviceController `json:"items"`
Count int `json:"count"`
}
type DeviceDisplay ¶ added in v2.20.0
type DeviceInterface ¶ added in v2.20.0
type DeviceNetwork ¶ added in v2.20.0
type DeviceNetwork struct {
Interface *string `json:"interface"`
Internet *string `json:"internet"`
Type string `json:"type"`
Interfaces []DeviceInterface `json:"interfaces"`
}
DeviceNetwork is the device's links. Type and Interface describe the link carrying the default route.
type DevicePower ¶ added in v2.20.0
type DevicePower struct {
Percent *int `json:"percent"`
Source *string `json:"source"`
ChargeState *string `json:"chargeState"`
TimeRemaining *int64 `json:"timeRemaining,omitempty"`
Batteries []DeviceBattery `json:"batteries"`
Present bool `json:"present"`
}
DevicePower is the device's battery state. Percent is the lowest readable battery and is reported whether or not the device is charging.
type DeviceStatusResponse ¶ added in v2.20.0
type DeviceStatusResponse struct {
Power *DevicePower `json:"power"`
Network *DeviceNetwork `json:"network"`
Bluetooth *DeviceBluetooth `json:"bluetooth"`
Storage *DeviceStorage `json:"storage"`
Display *DeviceDisplay `json:"display"`
Controllers *DeviceControllers `json:"controllers"`
Time *DeviceTime `json:"time"`
System *DeviceSystem `json:"system"`
Capabilities DeviceCapabilities `json:"capabilities"`
}
DeviceStatusResponse is the result of device.status. Every section is always present; one that is null is either unsupported on this device or has no reading yet, and Capabilities.Sections says which.
type DeviceStorage ¶ added in v2.20.0
type DeviceStorage struct {
Volumes []DeviceVolume `json:"volumes"`
}
type DeviceSystem ¶ added in v2.20.0
type DeviceTime ¶ added in v2.20.0
type DeviceVolume ¶ added in v2.20.0
type ErrorData ¶ added in v2.17.0
type ErrorData struct {
Params map[string]string `json:"params,omitempty"`
Category string `json:"category"`
Reason string `json:"reason,omitempty"`
}
ErrorData is the structured payload placed in ErrorObject.Data for categorized errors. Reason and Params are documented per category and stay absent from the JSON for every category that does not define them, so adding them changes no existing response shape.
type ErrorObject ¶
type ExtendPlaytimeParams ¶ added in v2.17.0
type ExtendPlaytimeParams struct {
// Duration is the time to add, in Go duration format. Required for
// mode "duration" and ignored for "today".
Duration *string `json:"duration" validate:"omitempty,duration"`
// RequestID makes a grant idempotent across retries. Repeating a
// request ID reports the original grant instead of adding more time.
RequestID string `json:"requestId" validate:"omitempty,max=128"`
// Mode is "duration" or "today".
Mode string `json:"mode" validate:"required,oneof=duration today"`
}
ExtendPlaytimeParams asks for extra time on the session currently being limited. The recipient is never named by the caller: a grant always applies to the profile governing playtime right now, so it cannot be aimed at somebody else's session.
type ExtendPlaytimeResponse ¶ added in v2.17.0
type ExtendPlaytimeResponse struct {
Mode string `json:"mode"`
Duration string `json:"duration,omitempty"`
Expires string `json:"expires,omitempty"`
SessionExtension string `json:"sessionExtension,omitempty"`
ProfileID string `json:"profileId,omitempty"`
// Replayed is true when a repeated requestId matched an earlier grant
// and no additional time was added.
Replayed bool `json:"replayed"`
}
ExtendPlaytimeResponse reports what a playtime.extend request granted.
type HealthCheckResponse ¶ added in v2.7.1
type HistoryResponse ¶
type HistoryResponse struct {
Entries []HistoryResponseEntry `json:"entries"`
}
type HistoryResponseEntry ¶
type InboxMessage ¶ added in v2.8.0
type InboxResponse ¶ added in v2.8.0
type InboxResponse struct {
Messages []InboxMessage `json:"messages"`
}
type IndexingScanResponse ¶ added in v2.19.0
IndexingScanResponse is a running folder scan: the files and folders read so far and the folder being read.
type IndexingStatusResponse ¶
type IndexingStatusResponse struct {
TotalSteps *int `json:"totalSteps,omitempty"`
CurrentStep *int `json:"currentStep,omitempty"`
CurrentStepDisplay *string `json:"currentStepDisplay,omitempty"`
TotalFiles *int `json:"totalFiles,omitempty"`
TotalMedia *int `json:"totalMedia,omitempty"`
// MissingMedia is the count of indexed media flagged missing on disk —
// what media.clean.orphans would remove.
MissingMedia *int `json:"missingMedia,omitempty"`
// SystemsCompleted/SystemsTotal report per-system indexing coverage so
// clients can serve partial results while a scan is still running.
SystemsCompleted *int `json:"systemsCompleted,omitempty"`
SystemsTotal *int `json:"systemsTotal,omitempty"`
// Scan reports a system's folder scan while it runs. A scan can take many
// minutes on a large library, and without it nothing visibly moves.
// Absent outside a scan.
Scan *IndexingScanResponse `json:"scan,omitempty"`
Exists bool `json:"exists"`
Indexing bool `json:"indexing"`
Optimizing bool `json:"optimizing"`
Paused bool `json:"paused"`
// Throttled reports that indexing is running at reduced speed while
// media plays.
Throttled bool `json:"throttled,omitempty"`
}
type InputGamepadParams ¶ added in v2.10.0
type InputGamepadParams struct {
Buttons string `json:"buttons" validate:"required,min=1"`
}
type InputKeyboardParams ¶ added in v2.10.0
type InputKeyboardParams struct {
Keys string `json:"keys" validate:"required,min=1"`
}
type Launcher ¶ added in v2.12.0
type Launcher struct {
LauncherRuntime
Detected *bool `json:"detected,omitempty"`
ID string `json:"id"`
SystemID string `json:"systemId,omitempty"`
SystemName string `json:"systemName,omitempty"`
AvailabilityReason string `json:"availabilityReason,omitempty"`
Groups []string `json:"groups,omitempty"`
Available bool `json:"available"`
Default bool `json:"default,omitempty"`
}
type LauncherRuntime ¶ added in v2.17.0
type LauncherRuntime struct {
MisterCore *MisterCoreInfo `json:"misterCore,omitempty"`
Backend string `json:"backend,omitempty"`
}
LauncherRuntime describes what a launcher actually runs, when the platform knows. It is embedded in Launcher so its fields flatten into the JSON response rather than nesting under a "runtime" key. A zero value (empty Backend) means the platform has nothing to say for this launcher.
type LaunchersParams ¶ added in v2.17.0
type LaunchersParams struct {
Systems *[]string `json:"systems,omitempty" validate:"omitempty,dive,min=1"`
FuzzySystem *bool `json:"fuzzySystem,omitempty"`
}
LaunchersParams filters the launchers list. Systems is intentionally not validated against known system IDs: launcher system IDs can be launchable or virtual systems outside systemdefs, and an unmatched filter value should return an empty list rather than a validation error.
type LaunchersResponse ¶ added in v2.12.0
type LaunchersResponse struct {
Launchers []Launcher `json:"launchers"`
}
type LogDownloadResponse ¶
type MappingResponse ¶
type MappingResponse struct {
ID string `json:"id"`
Added string `json:"added"`
Label string `json:"label"`
Type string `json:"type"`
Match string `json:"match"`
Pattern string `json:"pattern"`
Override string `json:"override"`
// Source identifies where the mapping came from: "database" or "file".
Source string `json:"source"`
// ReadOnly is true for mappings that can't be edited via the API (file mappings).
ReadOnly bool `json:"readOnly"`
Enabled bool `json:"enabled"`
}
type MediaActiveImageParams ¶ added in v2.22.0
type MediaActiveImageParams struct {
MaxSize *int32 `json:"maxSize,omitempty" validate:"omitempty,gt=0,max=8192"`
Slot string `json:"slot,omitempty"`
Delivery string `json:"delivery,omitempty" validate:"omitempty,oneof=inline localPath"`
}
MediaActiveImageParams asks for the cover art of the audio track playing in a slot. MaxSize and Delivery work as they do for media.image.
type MediaAssetParams ¶ added in v2.18.0
type MediaAssetParams struct {
MediaID *int64 `json:"mediaId,omitempty"`
Offset *int64 `json:"offset,omitempty"`
Length *int64 `json:"length,omitempty"`
System string `json:"system" validate:"omitempty,min=1"`
Path string `json:"path" validate:"omitempty,min=1"`
AssetType string `json:"assetType"`
ETag string `json:"etag,omitempty"`
}
type MediaAssetResponse ¶ added in v2.18.0
type MediaAssetResponse struct {
NextOffset *int64 `json:"nextOffset,omitempty"`
AssetType string `json:"assetType"`
TypeTag string `json:"typeTag"`
ContentType string `json:"contentType"`
Extension string `json:"extension"`
ETag string `json:"etag"`
Data string `json:"data"`
Size int64 `json:"size"`
Offset int64 `json:"offset"`
Length int64 `json:"length"`
Complete bool `json:"complete"`
}
MediaAssetResponse is one bounded chunk from an indexed media asset.
type MediaCleanOrphansResponse ¶ added in v2.12.0
type MediaCleanOrphansResponse struct {
Deleted int64 `json:"deleted"`
}
type MediaControlParams ¶ added in v2.10.0
type MediaHistoryLatestEntry ¶ added in v2.14.0
type MediaHistoryLatestEntry struct {
RelPath *string `json:"relativePath,omitempty"`
SystemID string `json:"systemId"`
SystemName string `json:"systemName"`
MediaName string `json:"mediaName"`
MediaPath string `json:"mediaPath"`
LauncherID string `json:"launcherId"`
StartedAt string `json:"startedAt"`
}
type MediaHistoryLatestResponse ¶ added in v2.14.0
type MediaHistoryLatestResponse struct {
Entry *MediaHistoryLatestEntry `json:"entry"`
}
type MediaHistoryParams ¶ added in v2.10.0
type MediaHistoryParams struct {
Systems *[]string `json:"systems,omitempty" validate:"omitempty,dive,min=1"`
FuzzySystem *bool `json:"fuzzySystem,omitempty"`
DistinctMedia *bool `json:"distinctMedia,omitempty"`
Limit *int `json:"limit,omitempty" validate:"omitempty,gt=0,max=100"`
Cursor *string `json:"cursor,omitempty"`
}
type MediaHistoryResponse ¶ added in v2.10.0
type MediaHistoryResponse struct {
Pagination *PaginationInfo `json:"pagination,omitempty"`
Entries []MediaHistoryResponseEntry `json:"entries"`
}
type MediaHistoryResponseEntry ¶ added in v2.10.0
type MediaHistoryResponseEntry struct {
RelPath *string `json:"relativePath,omitempty"`
EndedAt *string `json:"endedAt,omitempty"`
// ZapScript is the title command that launches this media. Omitted when
// the media is no longer indexed or enrichment failed.
ZapScript string `json:"zapScript,omitempty"`
SystemID string `json:"systemId"`
SystemName string `json:"systemName"`
MediaName string `json:"mediaName"`
MediaPath string `json:"mediaPath"`
LauncherID string `json:"launcherId"`
StartedAt string `json:"startedAt"`
// SessionSource and SessionConfidence distinguish an externally-timed
// session's evidence from an estimate; a session Core timed itself is
// "active_media", and a row predating this distinction is "unspecified".
SessionSource string `json:"sessionSource"`
SessionConfidence string `json:"sessionConfidence"`
// CoverColor is the cover thumbnail's average colour as "#rrggbb".
// Omitted until a thumbnail was built.
CoverColor string `json:"coverColor,omitempty"`
// Tags is nil when the media is unresolved or tag enrichment failed
// (key omitted) and an empty slice when the media is indexed but
// untagged (serialised as []). omitzero keeps that distinction;
// omitempty would drop the empty array.
Tags []database.TagInfo `json:"tags,omitzero"`
PlayTime int `json:"playTime"`
MediaID int64 `json:"mediaId,omitempty"`
HasCover bool `json:"hasCover"`
}
type MediaHistoryTopEntry ¶ added in v2.10.0
type MediaHistoryTopEntry struct {
RelPath *string `json:"relativePath,omitempty"`
// ZapScript follows the same rule as MediaHistoryResponseEntry.ZapScript.
ZapScript string `json:"zapScript,omitempty"`
SystemID string `json:"systemId"`
SystemName string `json:"systemName"`
MediaName string `json:"mediaName"`
MediaPath string `json:"mediaPath"`
LastPlayedAt string `json:"lastPlayedAt"`
// Tags follows the same nil-omitted / empty-array rule as
// MediaHistoryResponseEntry.Tags.
Tags []database.TagInfo `json:"tags,omitzero"`
TotalPlayTime int `json:"totalPlayTime"`
SessionCount int `json:"sessionCount"`
MediaID int64 `json:"mediaId,omitempty"`
}
type MediaHistoryTopParams ¶ added in v2.10.0
type MediaHistoryTopResponse ¶ added in v2.10.0
type MediaHistoryTopResponse struct {
Entries []MediaHistoryTopEntry `json:"entries"`
}
type MediaImageParams ¶ added in v2.12.0
type MediaImageParams struct {
MediaID *int64 `json:"mediaId,omitempty"`
// MaxSize is a hint for the longest edge (in pixels) of the returned image.
// The server resizes down to fit a MaxSize×MaxSize box and caches the result;
// omit it to receive the full-size image. Requests are snapped to a small set
// of standard sizes server-side, so the returned image may be larger than
// requested — clients should downscale to their final display size.
MaxSize *int32 `json:"maxSize,omitempty" validate:"omitempty,gt=0,max=8192"`
System string `json:"system" validate:"omitempty,min=1"`
Path string `json:"path" validate:"omitempty,min=1"`
Delivery string `json:"delivery,omitempty" validate:"omitempty,oneof=inline localPath"`
ImageTypes []string `json:"imageTypes" validate:"omitempty,dive,min=1"`
}
type MediaImageResponse ¶ added in v2.12.0
type MediaImageResponse struct {
Extension *string `json:"extension,omitempty"`
ContentType string `json:"contentType"`
Data string `json:"data,omitempty"` // base64-encoded blob
Delivery string `json:"delivery"` // "inline" or "localPath"
LocalPath string `json:"localPath,omitempty"` // transient Core-owned thumbnail path
TypeTag string `json:"typeTag"` // e.g. "property:image-boxart"
}
MediaImageResponse is the response for the media.image method. Inline delivery contains Data; local-path delivery contains LocalPath.
type MediaIndexParams ¶
type MediaIndexParams struct {
Systems *[]string `json:"systems" validate:"omitempty,dive,min=1"`
FuzzySystem *bool `json:"fuzzySystem,omitempty"`
// Rebuild discards the media database entirely and indexes from scratch.
// Scraped metadata is lost and must be re-scraped; user data (favourites,
// launcher overrides) lives in UserDB and is re-applied after indexing.
// Incompatible with a systems filter: a fresh database indexed selectively
// would silently drop every other system's media.
Rebuild *bool `json:"rebuild,omitempty"`
}
type MediaLookupCandidatesParams ¶ added in v2.18.0
type MediaLookupCandidatesResponse ¶ added in v2.18.0
type MediaLookupCandidatesResponse struct {
Candidates []database.TitleCandidate `json:"candidates"`
}
type MediaLookupMatch ¶ added in v2.10.0
type MediaLookupMatch struct {
RelPath *string `json:"relativePath,omitempty"`
System System `json:"system"`
Name string `json:"name"`
Path string `json:"path"`
ZapScript string `json:"zapScript"`
Tags []database.TagInfo `json:"tags"`
DisambiguatingTags []database.TagInfo `json:"disambiguatingTags,omitempty"`
MediaID int64 `json:"mediaId,omitempty"`
Confidence float64 `json:"confidence"`
}
type MediaLookupParams ¶ added in v2.10.0
type MediaLookupResponse ¶ added in v2.10.0
type MediaLookupResponse struct {
Match *MediaLookupMatch `json:"match"`
}
type MediaMetaBatchItemResponse ¶ added in v2.12.0
type MediaMetaBatchItemResponse struct {
Media *MediaMetaMediaResponse `json:"media,omitempty"`
Error *string `json:"error,omitempty"`
}
type MediaMetaBatchResponse ¶ added in v2.12.0
type MediaMetaBatchResponse struct {
Items []MediaMetaBatchItemResponse `json:"items"`
}
type MediaMetaMediaResponse ¶ added in v2.12.0
type MediaMetaMediaResponse struct {
Properties map[string]MediaMetaPropertyItem `json:"properties"`
LauncherOverride *string `json:"launcherOverride,omitempty"`
// RelPath is the launcher-relative convenience path, when one can be
// derived.
RelPath *string `json:"relativePath,omitempty"`
Path string `json:"path"`
// ZapScript is the title command that launches this media. Omitted for
// a missing media row.
ZapScript string `json:"zapScript,omitempty"`
ParentDir string `json:"parentDir"`
Tags []database.TagInfo `json:"tags"`
AvailableImageTypes []string `json:"availableImageTypes,omitempty"`
Title MediaMetaTitleResponse `json:"title"`
IsMissing bool `json:"isMissing"`
}
MediaMetaMediaResponse is the top-level Media object in a media.meta response.
type MediaMetaParams ¶ added in v2.12.0
type MediaMetaPropertyItem ¶ added in v2.12.0
type MediaMetaPropertyItem struct {
Extension *string `json:"extension,omitempty"`
Text string `json:"text"`
ContentType string `json:"contentType"`
BlobSize int64 `json:"blobSize,omitempty"`
}
MediaMetaPropertyItem represents a single property value in a media.meta response. Binary payloads are intentionally not included; use media.image to fetch image bytes.
type MediaMetaResponse ¶ added in v2.12.0
type MediaMetaResponse struct {
Media MediaMetaMediaResponse `json:"media"`
}
MediaMetaResponse is the response envelope for the media.meta method.
type MediaMetaSystemResponse ¶ added in v2.12.0
MediaMetaSystemResponse is the System sub-object within a media.meta response. Contains only DB-stored fields (id, name) with no static asset enrichment.
type MediaMetaTitleResponse ¶ added in v2.12.0
type MediaMetaTitleResponse struct {
SecondarySlug *string `json:"secondarySlug,omitempty"`
Properties map[string]MediaMetaPropertyItem `json:"properties"`
System MediaMetaSystemResponse `json:"system"`
Slug string `json:"slug"`
Name string `json:"name"`
Tags []database.TagInfo `json:"tags"`
AvailableImageTypes []string `json:"availableImageTypes,omitempty"`
SlugLength int `json:"slugLength"`
SlugWordCount int `json:"slugWordCount"`
}
MediaMetaTitleResponse is the MediaTitle sub-object within a media.meta response, with its own level-separated tags and properties.
type MediaMetaUpdateParams ¶ added in v2.15.0
type MediaMetaUpdateParams struct {
MediaID *int64 `json:"mediaId,omitempty"`
System string `json:"system" validate:"omitempty,min=1"`
Path string `json:"path" validate:"omitempty,min=1"`
Media json.RawMessage `json:"media,omitempty"`
}
type MediaPlaybackState ¶ added in v2.16.1
type MediaPlaybackState string
const ( MediaPlaybackStatePlaying MediaPlaybackState = "playing" MediaPlaybackStatePaused MediaPlaybackState = "paused" MediaPlaybackStateStopped MediaPlaybackState = "stopped" )
type MediaResponse ¶
type MediaResponse struct {
Database IndexingStatusResponse `json:"database"`
Active []ActiveMediaResponse `json:"active"`
Playlists []PlaylistState `json:"playlists,omitempty"`
}
type MediaScrapeParams ¶ added in v2.12.0
type MediaScrapeParams struct {
Scope *MediaScrapeScope `json:"scope,omitempty"`
ScraperID string `json:"scraperId" validate:"required,min=1"`
Systems []string `json:"systems" validate:"omitempty,dive,min=1"`
Force bool `json:"force"`
}
type MediaScrapePath ¶ added in v2.18.0
type MediaScrapeScope ¶ added in v2.18.0
type MediaScrapeScope struct {
MediaID *int64 `json:"mediaId,omitempty"`
File *MediaScrapePath `json:"file,omitempty"`
Subtree *MediaScrapePath `json:"subtree,omitempty"`
}
MediaScrapeScope selects one indexed item or one filesystem subtree. Selection forms are mutually exclusive; systems remains the legacy form.
func (*MediaScrapeScope) UnmarshalJSON ¶ added in v2.18.0
func (s *MediaScrapeScope) UnmarshalJSON(data []byte) error
UnmarshalJSON rejects unknown selectors instead of silently broadening work.
type MediaStartedParams ¶
type MediaStoppedParams ¶ added in v2.10.0
type MediaStoppedParams struct {
SystemID string `json:"systemId"`
SystemName string `json:"systemName"`
MediaName string `json:"mediaName"`
MediaPath string `json:"mediaPath"`
LauncherID string `json:"launcherId"`
Slot string `json:"slot,omitempty"`
// Reason says why the media stopped; see the MediaStopReason constants.
// Clients written before it existed ignore the field.
Reason string `json:"reason,omitempty"`
Elapsed int `json:"elapsed"`
}
type MediaTagsChangedNotification ¶ added in v2.22.0
type MediaTagsChangedNotification struct {
System string `json:"system"`
Path string `json:"path"`
Tags []database.TagInfo `json:"tags"`
}
MediaTagsChangedNotification is the payload for the media.tags.changed notification: an item's full set of user utility tags after a change.
type MediaTagsUpdateParams ¶ added in v2.12.0
type MediaTagsUpdateParams struct {
MediaID *int64 `json:"mediaId,omitempty"`
System string `json:"system" validate:"omitempty,min=1"`
Path string `json:"path" validate:"omitempty,min=1"`
Add []string `json:"add,omitempty" validate:"omitempty,dive,min=1"`
Remove []string `json:"remove,omitempty" validate:"omitempty,dive,min=1"`
}
type MediaTitleParseParams ¶ added in v2.13.0
type MediaTitleParseResponse ¶ added in v2.13.0
type MisterCoreInfo ¶ added in v2.17.0
type MisterCoreInfo struct {
// Name is the RBF short name, e.g. "3DO".
Name string `json:"name"`
// File is the installed RBF's filename, e.g. "3DO_20250101.rbf". Encodes
// the installed core version; absent from Name and MGLPath.
File string `json:"file"`
// MGLPath is the SD-relative core identity used to launch it, e.g.
// "_Console (Dual SDRAM)/3DO". Never an absolute filesystem path.
MGLPath string `json:"mglPath"`
}
MisterCoreInfo describes the FPGA core a MiSTer launcher loads. Absent when the core is not installed on the SD card; Launcher's Available and AvailabilityReason fields say why.
type NewClientParams ¶
type NewClientParams struct {
Name string `json:"name" validate:"required,min=1,max=255"`
}
type NewProfileParams ¶ added in v2.16.0
type NewProfileParams struct {
PIN *string `json:"pin" validate:"omitempty,numeric,min=4,max=8"`
LimitsEnabled *bool `json:"limitsEnabled"`
DailyLimit *string `json:"dailyLimit" validate:"omitempty,duration"`
SessionLimit *string `json:"sessionLimit" validate:"omitempty,duration"`
Name string `json:"name" validate:"required,min=1,max=255"`
Role string `json:"role" validate:"omitempty,oneof=admin member"`
}
NewProfileParams creates a profile. Nil limit fields inherit the global config; a "0" duration means explicitly unlimited.
type Notification ¶
type Notification struct {
Method string `json:"method"`
// CoalesceKey separates notifications of one method that carry
// independent state, such as one per media slot, so that merging a burst
// for a slow client keeps the latest of each rather than only the latest
// of the method. It is never sent.
CoalesceKey string `json:"-"`
Params json.RawMessage `json:"params"`
}
type NotificationObject ¶ added in v2.9.0
type NotificationObject struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type OnlineStatusResponse ¶ added in v2.22.0
type OnlineStatusResponse struct {
FeaturesCheckedAt *string `json:"featuresCheckedAt"`
DeviceName *string `json:"deviceName,omitempty"`
LinkedAt *string `json:"linkedAt,omitempty"`
Features []string `json:"features"`
Linked bool `json:"linked"`
}
OnlineStatusResponse reports the online account link, the name and link time the Online service knows this device by, and the account features it last listed. Features is never null; FeaturesCheckedAt is null until a check succeeds after linking.
type PaginationInfo ¶ added in v2.7.0
type PaginationInfo struct {
NextCursor *string `json:"nextCursor,omitempty"`
// Offset and AnchorIndex are media.browse only: the absolute position of
// the page's first row and of the requested anchor.
Offset *int `json:"offset,omitempty"`
AnchorIndex *int `json:"anchorIndex,omitempty"`
HasNextPage bool `json:"hasNextPage"`
PageSize int `json:"pageSize"`
}
type PairedClient ¶ added in v2.11.0
type PairedClient struct {
ClientID string `json:"clientId"`
ClientName string `json:"clientName"`
Role string `json:"role"`
CreatedAt int64 `json:"createdAt"`
LastSeenAt int64 `json:"lastSeenAt"`
}
PairedClient represents a client paired via the API encryption flow. PairingKey and AuthToken are intentionally omitted from the public API surface — only the metadata identifying the client is exposed.
type PlaylistItemInfo ¶ added in v2.15.0
PlaylistItemInfo is one entry in a PlaylistState.
type PlaylistState ¶ added in v2.15.0
type PlaylistState struct {
// AdvanceMs, IdleMs and CountdownMs are the playlist's rotation settings in
// milliseconds, omitted when unset. A countdown of 0 is set: it switches
// with no notice.
AdvanceMs *int64 `json:"advanceMs,omitempty"`
IdleMs *int64 `json:"idleMs,omitempty"`
CountdownMs *int64 `json:"countdownMs,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Slot string `json:"slot"`
Repeat string `json:"repeat"`
Items []PlaylistItemInfo `json:"items"`
Index int `json:"index"`
Total int `json:"total"`
Playing bool `json:"playing"`
Unsafe bool `json:"unsafe"`
// Shuffle reports that the items are in a random order. Items lists them
// in the order they play.
Shuffle bool `json:"shuffle"`
// Armed reports an idle playlist that is loaded and waiting for the
// device to go idle before it starts.
Armed bool `json:"armed,omitempty"`
}
PlaylistState describes the current state of a playlist slot as exposed by the media response. Repeat is one of "none", "all", or "one". Unsafe reports the playlist's effective trust: either its items came from a source this device does not trust, or the script that opened it was already untrusted and it inherited that. Either way, commands in its items that drive input or run programs will not run. It is read-only.
type PlaylistsChangedParams ¶ added in v2.22.0
type PlaylistsChangedParams struct {
Playlists []PlaylistState `json:"playlists"`
}
PlaylistsChangedParams is the payload of the playlists.changed notification: every open playlist, in every slot, empty when none is open.
type PlaylistsUpdateParams ¶ added in v2.22.0
type PlaylistsUpdateParams struct {
Shuffle *bool `json:"shuffle,omitempty"`
Repeat *string `json:"repeat,omitempty"`
Slot string `json:"slot,omitempty"`
}
PlaylistsUpdateParams changes the shuffle and repeat of the playlist open in a slot. At least one of Shuffle and Repeat is required.
type PlaytimeExtendedParams ¶ added in v2.17.0
type PlaytimeExtendedParams struct {
Mode string `json:"mode"`
// Duration is what this grant added. Omitted for a day waiver.
Duration string `json:"duration,omitempty"`
// Expires is when a day waiver lapses, RFC3339. Omitted otherwise.
Expires string `json:"expires,omitempty"`
// SessionExtension is the session's accumulated duration grant.
SessionExtension string `json:"sessionExtension,omitempty"`
// ProfileID is the recipient. Empty is the shared profile.
ProfileID string `json:"profileId,omitempty"`
// GrantedBy is the profile that authorized the grant.
GrantedBy string `json:"grantedBy,omitempty"`
}
PlaytimeExtendedParams is the payload of the playtime.extended notification. Profiles are identified by ID only: the switch ID that authorized a card grant is a bearer credential and is never published.
type PlaytimeLimitReachedParams ¶ added in v2.7.0
type PlaytimeLimitReachedParams struct {
Reason string `json:"reason"`
}
type PlaytimeLimitWarningParams ¶ added in v2.7.0
type PlaytimeLimitsResponse ¶ added in v2.7.0
type PlaytimeStatusResponse ¶ added in v2.7.0
type PlaytimeStatusResponse struct {
SessionStarted *string `json:"sessionStarted,omitempty"`
SessionDuration *string `json:"sessionDuration,omitempty"`
SessionCumulativeTime *string `json:"sessionCumulativeTime,omitempty"`
SessionRemaining *string `json:"sessionRemaining,omitempty"`
CooldownRemaining *string `json:"cooldownRemaining,omitempty"`
DailyUsageToday *string `json:"dailyUsageToday,omitempty"`
DailyRemaining *string `json:"dailyRemaining,omitempty"`
// SessionExtension is the time granted on top of the configured session
// limit for the current session. Omitted when nothing was granted.
SessionExtension *string `json:"sessionExtension,omitempty"`
// SessionExtendedUntil is when a session-limit waiver lapses, RFC3339.
// While it is set the session limit is not enforced and
// sessionRemaining is omitted; the daily limit still applies.
SessionExtendedUntil *string `json:"sessionExtendedUntil,omitempty"`
State string `json:"state"`
SessionActive bool `json:"sessionActive"`
LimitsEnabled bool `json:"limitsEnabled"`
}
type ProfileResponse ¶ added in v2.16.0
type ProfileResponse struct {
LimitsEnabled *bool `json:"limitsEnabled,omitempty"`
DailyLimit *string `json:"dailyLimit,omitempty"`
SessionLimit *string `json:"sessionLimit,omitempty"`
LastUsedAt *int64 `json:"lastUsedAt,omitempty"`
ProfileID string `json:"profileId"`
Name string `json:"name"`
Role string `json:"role"`
SwitchID string `json:"switchId,omitempty"`
CreatedAt int64 `json:"createdAt"`
LastUpdatedAt int64 `json:"lastUpdatedAt"`
HasPIN bool `json:"hasPin"`
}
ProfileResponse represents a device profile in API responses. The PIN hash is never exposed — only whether a PIN is set. SwitchID is a bearer credential (presenting it authorizes a PIN-free switch on every path), so it is only included for privileged clients that need it for card-writing UX; for other clients it is omitted.
type ProfileVerifyResponse ¶ added in v2.16.0
type ProfileVerifyResponse struct {
ProfileID string `json:"profileId"`
Name string `json:"name"`
Role string `json:"role"`
HasPIN bool `json:"hasPin"`
}
ProfileVerifyResponse is the response for the profiles.verify RPC method: the identity of the profile whose credential was verified. Verification grants nothing server-side — the client owns whatever it unlocks with it.
type ProfilesActiveNotification ¶ added in v2.16.0
type ProfilesActiveNotification struct {
Profile *ActiveProfile `json:"profile"`
}
ProfilesActiveNotification is the payload for the profiles.active notification. Profile is null when the device has no active profile.
type ProfilesDataNotification ¶ added in v2.16.0
type ProfilesDataNotification struct {
ProfileID string `json:"profileId"`
Status string `json:"status"`
Reason string `json:"reason,omitempty"`
}
ProfilesDataNotification is the payload for the profiles.data notification, reporting the state of profile data swapping (save files etc.) after a profile change. ProfileID is empty for the shared profile. Status is one of the ProfilesData* constants; Reason is a human-readable explanation for failed/unavailable statuses.
type ProfilesResponse ¶ added in v2.16.0
type ProfilesResponse struct {
Profiles []ProfileResponse `json:"profiles"`
}
ProfilesResponse is the response for the profiles RPC method.
type QuietClientError ¶ added in v2.14.0
type QuietClientError struct {
Err error
}
QuietClientError is an expected client-facing error that should not be logged as a warning for every occurrence. Use for high-volume misses where the JSON-RPC error response is still correct, but warning logs would create noise.
func (*QuietClientError) As ¶ added in v2.14.0
func (e *QuietClientError) As(target any) bool
func (*QuietClientError) Error ¶ added in v2.14.0
func (e *QuietClientError) Error() string
func (*QuietClientError) Unwrap ¶ added in v2.14.0
func (e *QuietClientError) Unwrap() error
type RPCID ¶ added in v2.8.0
type RPCID struct {
json.RawMessage
}
RPCID represents a JSON-RPC 2.0 request/response ID. Per spec, ID can be a String, Number, or Null value. We use json.RawMessage to preserve the exact JSON representation, ensuring IDs are echoed back exactly as received.
func NewNumberID ¶ added in v2.8.0
NewNumberID creates an RPCID from an integer value.
func NewStringID ¶ added in v2.8.0
NewStringID creates an RPCID from a string value.
func (*RPCID) IsAbsent ¶ added in v2.8.0
IsAbsent returns true if the ID field was not present in the JSON. This indicates a notification in JSON-RPC 2.0.
func (*RPCID) IsAbsentOrNull ¶ added in v2.8.0
IsAbsentOrNull returns true if the ID is either absent or explicitly null. For JSON-RPC 2.0, absent means notification (no response), while null means request with null ID (must respond). Use IsAbsent() to distinguish.
func (*RPCID) IsNull ¶ added in v2.8.0
IsNull returns true if the ID is explicitly JSON null. Note: This returns false for absent IDs - use IsAbsent() for that.
func (*RPCID) Key ¶ added in v2.8.0
Key returns a string suitable for use as a map key. This is the raw JSON representation of the ID.
func (RPCID) MarshalJSON ¶ added in v2.8.0
MarshalJSON returns the raw JSON bytes of the ID.
func (*RPCID) String ¶ added in v2.8.0
String returns the string representation for logging/debugging. Note: If the ID is a JSON string "foo", this returns "foo" (with quotes).
func (*RPCID) UnmarshalJSON ¶ added in v2.8.0
UnmarshalJSON enforces JSON-RPC 2.0 spec compliance by rejecting objects and arrays as ID values at parse time.
type ReaderConnection ¶ added in v2.9.0
type ReaderConnection struct {
Enabled *bool `json:"enabled,omitempty"`
Driver string `json:"driver" validate:"required,min=1"`
Path string `json:"path"`
IDSource string `json:"idSource,omitempty"`
// ScanMode is validated by the handler rather than by a tag, so it accepts
// the same spellings a config file does ("HOLD", " hold ") and stores the
// canonical one. See config.NormalizeScanMode.
ScanMode string `json:"scanMode,omitempty"`
}
func (ReaderConnection) ConnectionLabel ¶ added in v2.17.0
func (r ReaderConnection) ConnectionLabel() string
ConnectionLabel names this connection for an error message, in the same driver:path form the config file and logs use.
func (ReaderConnection) IsEnabled ¶ added in v2.11.0
func (r ReaderConnection) IsEnabled() bool
IsEnabled returns whether this connection is enabled. nil (omitted) and true both mean enabled; only explicit false disables.
type ReaderInfo ¶
type ReaderResponse ¶
type ReaderWriteCancelParams ¶ added in v2.9.0
type ReaderWriteCancelParams struct {
ReaderID *string `json:"readerId,omitempty"`
}
type ReaderWriteParams ¶
type ReadersResponse ¶
type ReadersResponse struct {
HoldOwnerReaderID string `json:"holdOwnerReaderId,omitempty"`
HoldScanMode string `json:"holdScanMode,omitempty"`
Readers []ReaderInfo `json:"readers"`
}
type RemoteActivityEntry ¶ added in v2.17.0
type RemoteActivityEntry struct {
CreatedAt string `json:"createdAt"`
OperationType string `json:"operationType"`
OriginKind string `json:"originKind"`
OriginKeyName string `json:"originKeyName,omitempty"`
State string `json:"state"`
Status string `json:"status,omitempty"`
ErrorCode string `json:"errorCode,omitempty"`
}
RemoteActivityEntry is one owner-facing row of the remote operations ledger. OriginKind is "first_party" or "api_key"; OriginKeyName is set only for the latter. State reflects the ledger's lifecycle ("executing", "terminal", "void", "expired") for entries that never reached a result.
type RemoteActivityParams ¶ added in v2.17.0
type RemoteActivityParams struct {
Limit *int `json:"limit,omitempty" validate:"omitempty,gt=0,max=100"`
}
RemoteActivityParams requests recent entries from the remote operations ledger. Limit defaults to 20 and is capped at 100.
type RemoteActivityResponse ¶ added in v2.17.0
type RemoteActivityResponse struct {
Status RemoteStatusInfo `json:"status"`
Entries []RemoteActivityEntry `json:"entries"`
}
type RemoteStatusInfo ¶ added in v2.17.0
type RemoteStatusInfo struct {
State string `json:"state"`
LastContactAt string `json:"lastContactAt,omitempty"`
LastErrorCode string `json:"lastErrorCode,omitempty"`
}
RemoteStatusInfo is the remote operations poller's last observation: why the device is or isn't currently reachable for remote commands. State is one of unknown, disabled, unlinked, connecting, waiting, not_remote_device, unavailable, credential_rejected, or error.
type RequestObject ¶
type RequestObject struct {
JSONRPC string `json:"jsonrpc"`
ID RPCID `json:"id,omitempty"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type ResponseErrorObject ¶
type ResponseErrorObject struct {
Error *ErrorObject `json:"error"`
JSONRPC string `json:"jsonrpc"`
ID RPCID `json:"id"`
}
ResponseErrorObject exists for sending errors, so we can omit result from the response, but so nil responses are still returned when using the main ResponseObject.
type ResponseObject ¶
type ResponseObject struct {
Result any `json:"result"`
Error *ErrorObject `json:"error,omitempty"`
JSONRPC string `json:"jsonrpc"`
ID RPCID `json:"id"`
}
ResponseObject carries a method's successful result. Result has no omitempty because JSON-RPC 2.0 §5 requires the key on success, so a method with nothing to return sends "result": null. Void handlers express that with methods.NoContent, which marshals itself as null.
type ResponseWithCallback ¶ added in v2.10.0
type ResponseWithCallback struct {
Result any
AfterWrite func()
}
ResponseWithCallback wraps a method result with a function that should be called after the response has been written to the client. This allows handlers to defer side effects (like triggering a restart) until the client has received the response, without relying on arbitrary sleep timers.
type RunFailedParams ¶ added in v2.18.0
type RunFailedParams struct {
PlaylistIndex *int `json:"playlistIndex,omitempty"`
Source string `json:"source"`
ReaderID string `json:"readerId,omitempty"`
Script string `json:"script,omitempty"`
Command string `json:"command,omitempty"`
Category string `json:"category"`
Message string `json:"message"`
PlaylistID string `json:"playlistId,omitempty"`
}
RunFailedParams is the payload of the run.failed notification, sent once for every ZapScript run that ends in failure whatever started it. Script is the token's own text with credentials redacted, exactly as token history stores it, so it can hold a media path the way history does; Message is the same safe text the run method returns and never carries a path or token contents. PlaylistID and PlaylistIndex are set when the run was a playlist item.
type RunScriptParams ¶
type RunScriptParams struct {
Name *string `json:"name"`
Cmds []zapscript.ZapScriptCmd `json:"cmds"`
ZapScript int `json:"zapscript"`
Unsafe bool `json:"unsafe"`
}
type ScrapeSystemProgressResponse ¶ added in v2.14.0
type ScraperInfo ¶ added in v2.12.0
type ScraperInfo struct {
ID string `json:"id"`
Name string `json:"name"`
SupportedSystems []string `json:"supportedSystems"`
}
ScraperInfo is one entry in the ScrapersResponse list.
type ScrapersResponse ¶ added in v2.12.0
type ScrapersResponse struct {
Scrapers []ScraperInfo `json:"scrapers"`
}
ScrapersResponse is the result returned by the "scrapers" RPC method.
type ScrapingStatusResponse ¶ added in v2.12.0
type ScrapingStatusResponse struct {
CurrentStep *int `json:"currentStep,omitempty"`
CurrentStepDisplay *string `json:"currentStepDisplay,omitempty"`
TotalSteps *int `json:"totalSteps,omitempty"`
CurrentSystem *ScrapeSystemProgressResponse `json:"currentSystem,omitempty"`
ScraperID string `json:"scraperId,omitempty"`
SystemID string `json:"systemId,omitempty"`
State string `json:"state,omitempty"`
Error string `json:"error,omitempty"`
Processed int `json:"processed"`
Total int `json:"total"`
Matched int `json:"matched"`
Skipped int `json:"skipped"`
TotalScraped int `json:"totalScraped"`
Scraping bool `json:"scraping"`
Done bool `json:"done"`
Paused bool `json:"paused"`
// Throttled reports that scraping is running at reduced speed while
// media plays.
Throttled bool `json:"throttled,omitempty"`
Force bool `json:"force"`
}
ScrapingStatusResponse is broadcast as a "media.scraping" notification for each ScrapeUpdate received from the scraper and on completion/cancellation.
type ScreenshotResponse ¶ added in v2.10.0
type SearchParams ¶
type SearchParams struct {
Systems *[]string `json:"systems" validate:"omitempty,dive,min=1"`
FuzzySystem *bool `json:"fuzzySystem,omitempty"`
PathPrefix *string `json:"pathPrefix,omitempty"`
MaxResults *int `json:"maxResults" validate:"omitempty,gt=0,max=1000"`
Cursor *string `json:"cursor,omitempty"`
Tags *[]string `json:"tags,omitempty" validate:"omitempty,dive,min=1"`
Letter *string `json:"letter,omitempty" validate:"omitempty,letter"`
Sort *string `json:"sort,omitempty" validate:"omitempty,oneof=name-asc name-desc filename-asc filename-desc added-desc"`
Query *string `json:"query"`
GroupBy *string `json:"groupBy,omitempty" validate:"omitempty,oneof=title"`
TitleID *int64 `json:"titleId,omitempty" validate:"omitempty,gt=0"`
IncludeHidden bool `json:"includeHidden,omitempty"`
}
type SearchResultMedia ¶
type SearchResultMedia struct {
RelPath *string `json:"relativePath,omitempty"`
// VersionCount is set by a search grouped by title: how many versions of
// the title matched, across the whole search rather than this page.
VersionCount *int `json:"versionCount,omitempty"`
System System `json:"system"`
Name string `json:"name"`
Path string `json:"path"`
ZapScript string `json:"zapScript"`
// CoverColor is the cover thumbnail's average colour as "#rrggbb", for a
// placeholder while the image loads. Omitted until a thumbnail was built.
CoverColor string `json:"coverColor,omitempty"`
Tags []database.TagInfo `json:"tags"`
DisambiguatingTags []database.TagInfo `json:"disambiguatingTags,omitempty"`
MediaID int64 `json:"mediaId,omitempty"`
// TitleID identifies the media's title for a titleId search, which lists
// its versions. Valid until the next media index.
TitleID int64 `json:"titleId,omitempty"`
HasCover bool `json:"hasCover"`
}
type SearchResults ¶
type SearchResults struct {
Pagination *PaginationInfo `json:"pagination,omitempty"`
Results []SearchResultMedia `json:"results"`
Total int `json:"total"`
}
type SettingsAuthClaimParams ¶ added in v2.10.0
type SettingsAuthClaimResponse ¶ added in v2.10.0
type SettingsAuthClaimResponse struct {
Domains []string `json:"domains"`
}
type SettingsAuthLinkParams ¶ added in v2.16.0
type SettingsAuthLinkParams struct {
// URL overrides the auth server base URL; defaults to the official
// Zaparoo API.
URL string `json:"url,omitempty" validate:"omitempty,url"`
}
type SettingsAuthStatusParams ¶ added in v2.16.0
type SettingsAuthStatusParams struct {
URL string `json:"url,omitempty" validate:"omitempty,url"`
}
type SettingsAuthStatusResponse ¶ added in v2.16.0
type SettingsAuthStatusResponse struct {
Linked bool `json:"linked"`
}
type SettingsAuthUnlinkResponse ¶ added in v2.16.0
type SettingsAuthUnlinkResponse struct {
Domains []string `json:"domains"`
}
SettingsAuthUnlinkResponse lists the domains whose credentials were removed by settings.auth.unlink.
type SettingsResponse ¶
type SettingsResponse struct {
BackupRemoteEnabled *bool `json:"backupRemoteEnabled,omitempty"`
PlaytimeSyncEnabled *bool `json:"playtimeSyncEnabled,omitempty"`
LibrarySyncEnabled *bool `json:"librarySyncEnabled,omitempty"`
RemoteControlEnabled *bool `json:"remoteControlEnabled,omitempty"`
BackupRemoteSchedule *string `json:"backupRemoteSchedule,omitempty"`
OnlineBaseURL *string `json:"onlineBaseUrl,omitempty"`
MediaImageDir *string `json:"mediaImageDir,omitempty"`
UpdateChannel string `json:"updateChannel"`
AudioMidiSoundFont string `json:"audioMidiSoundFont"`
ReadersScanMode string `json:"readersScanMode"`
ReadersScanIgnoreSystem []string `json:"readersScanIgnoreSystems"`
ReadersConnect []ReaderConnection `json:"readersConnect"`
SystemDefaults []SystemDefault `json:"systemDefaults"`
LauncherPreference []string `json:"launcherPreference"`
AudioVolume int `json:"audioVolume"`
AudioMusicVolume int `json:"audioMusicVolume"`
MediaThumbCacheMaxMB int `json:"mediaThumbCacheMaxMb"`
LaunchGuardTimeout float32 `json:"launchGuardTimeout"`
LaunchGuardDelay float32 `json:"launchGuardDelay"`
ReadersScanExitDelay float32 `json:"readersScanExitDelay"`
RunZapScript bool `json:"runZapScript"`
DebugLogging bool `json:"debugLogging"`
AudioScanFeedback bool `json:"audioScanFeedback"`
AudioMusicAutoplay bool `json:"audioMusicAutoplay"`
AudioNormalize bool `json:"audioNormalize"`
AudioMusicPauseOnLaunch bool `json:"audioMusicPauseOnLaunch"`
ReadersAutoDetect bool `json:"readersAutoDetect"`
ErrorReporting bool `json:"errorReporting"`
Encryption bool `json:"encryption"`
LaunchGuardEnabled bool `json:"launchGuardEnabled"`
LaunchGuardRequireConfirm bool `json:"launchGuardRequireConfirm"`
ProfilesRequireForLaunch bool `json:"profilesRequireForLaunch"`
ProfilesSwapData bool `json:"profilesSwapData"`
UpdateCheck bool `json:"updateCheck"`
UpdateInstall bool `json:"updateInstall"`
}
type SwitchProfileParams ¶ added in v2.16.0
type SwitchProfileParams struct {
ProfileID *string `json:"profileId"`
SwitchID *string `json:"switchId"`
PIN *string `json:"pin"`
}
SwitchProfileParams switches the device's active profile. Exactly one of ProfileID or SwitchID selects the target; both omitted (or null) means deactivate. PIN is required when the target profile has one set.
type System ¶
type System struct {
ReleaseDate *string `json:"releaseDate,omitempty"`
Manufacturer *string `json:"manufacturer,omitempty"`
MediaCount *int `json:"mediaCount,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Category string `json:"category,omitempty"`
ZapScript string `json:"zapScript,omitempty"`
Categories []string `json:"categories,omitempty"`
}
type SystemDefault ¶ added in v2.12.0
type SystemsParams ¶ added in v2.16.0
type SystemsResponse ¶
type SystemsResponse struct {
Systems []System `json:"systems"`
}
type TagsResponse ¶ added in v2.7.0
type TokenResponse ¶
type TokensResponse ¶
type TokensResponse struct {
Last *TokenResponse `json:"last,omitempty"`
Active []TokenResponse `json:"active"`
}
type TrackInfo ¶ added in v2.22.0
type TrackInfo struct {
Title string `json:"title,omitempty"`
Artist string `json:"artist,omitempty"`
Album string `json:"album,omitempty"`
AlbumArtist string `json:"albumArtist,omitempty"`
Genre string `json:"genre,omitempty"`
Year int `json:"year,omitempty"`
TrackNumber int `json:"trackNumber,omitempty"`
TrackTotal int `json:"trackTotal,omitempty"`
DiscNumber int `json:"discNumber,omitempty"`
DiscTotal int `json:"discTotal,omitempty"`
// HasArt reports cover art that media.active.image can return.
HasArt bool `json:"hasArt,omitempty"`
}
TrackInfo is the tag metadata of an audio track. Fields the track does not have are omitted.
type UIChoice ¶ added in v2.16.0
type UIChoice struct {
Media *UIChoiceMedia `json:"media,omitempty"`
ID string `json:"id"`
Label string `json:"label"`
// Current marks the choice standing for what is open now, such as the
// playing item of a playlist. Host widgets mark it; API clients get the
// initial selection from selectedChoiceId instead.
Current bool `json:"-"`
}
type UIChoiceMedia ¶ added in v2.22.0
type UIChoiceMedia struct {
System string `json:"system"`
Path string `json:"path"`
Name string `json:"name"`
}
UIChoiceMedia names the local game a picker choice stands for, so a client can show the choice as that game.
type UIEvent ¶ added in v2.16.0
type UIEvent struct {
CreatedAt time.Time `json:"createdAt"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
ID string `json:"id"`
Kind UIEventKind `json:"kind"`
Title string `json:"title,omitempty"`
Message string `json:"message,omitempty"`
SelectedChoiceID string `json:"selectedChoiceId,omitempty"`
Choices []UIChoice `json:"choices,omitempty"`
Dismissible bool `json:"dismissible"`
}
type UIEventKind ¶ added in v2.16.0
type UIEventKind string
const ( UIEventKindNotice UIEventKind = "notice" UIEventKindLoader UIEventKind = "loader" UIEventKindPicker UIEventKind = "picker" UIEventKindConfirm UIEventKind = "confirm" )
type UIOutcome ¶ added in v2.16.0
type UIOutcome string
const ( UIOutcomeConfirmed UIOutcome = "confirmed" UIOutcomeSelected UIOutcome = "selected" UIOutcomeDismissed UIOutcome = "dismissed" UIOutcomeTimedOut UIOutcome = "timed_out" UIOutcomeCompleted UIOutcome = "completed" UIOutcomeSuperseded UIOutcome = "superseded" UIOutcomeCancelled UIOutcome = "cancelled" )
type UIResolution ¶ added in v2.16.0
type UIRespondParams ¶ added in v2.16.0
type UIRespondParams struct {
ID string `json:"id" validate:"required"`
Action UIResponseAction `json:"action" validate:"required,oneof=dismiss select confirm"`
ChoiceID string `json:"choiceId,omitempty"`
}
type UIResponseAction ¶ added in v2.16.0
type UIResponseAction string
const ( UIResponseActionDismiss UIResponseAction = "dismiss" UIResponseActionSelect UIResponseAction = "select" UIResponseActionConfirm UIResponseAction = "confirm" )
type UIStateResponse ¶ added in v2.16.0
type UIStateResponse struct {
Events []UIEvent `json:"events"`
Resolved []UIResolution `json:"resolved"`
Revision uint64 `json:"revision"`
}
type UpdateActiveMediaParams ¶
type UpdateApplyParams ¶ added in v2.17.0
type UpdateApplyParams struct {
Force bool `json:"force"`
}
UpdateApplyParams are the optional arguments to update.apply. Force lets a person go ahead while something is playing that a restart will close; it does not get past anything that would risk their data.
type UpdateApplyResponse ¶ added in v2.10.0
type UpdateBlockedBy ¶ added in v2.17.0
type UpdateBlockedBy struct {
Reason string `json:"reason"`
Message string `json:"message"`
Forceable bool `json:"forceable"`
}
UpdateBlockedBy is what the device is busy with that stops an update being installed. Forceable means a person may go ahead anyway by passing force to update.apply, which is true for things that only cost them their session and false for anything that risks their data.
type UpdateCheckResponse ¶ added in v2.10.0
type UpdateCheckResponse struct {
DeferredSince *time.Time `json:"deferredSince,omitempty"`
LastResult *UpdateLastResult `json:"lastResult,omitempty"`
BlockedBy *UpdateBlockedBy `json:"blockedBy,omitempty"`
CheckedAt *time.Time `json:"checkedAt,omitempty"`
CurrentVersion string `json:"currentVersion"`
ReleaseNotes string `json:"releaseNotes,omitempty"`
Channel string `json:"channel,omitempty"`
Eligibility string `json:"eligibility,omitempty"`
DeferredReason string `json:"deferredReason,omitempty"`
LatestVersion string `json:"latestVersion,omitempty"`
UpdateAvailable bool `json:"updateAvailable"`
RolloutHeld bool `json:"rolloutHeld,omitempty"`
AutoInstall bool `json:"autoInstall"`
}
type UpdateLastResult ¶ added in v2.17.0
type UpdateLastResult struct {
At time.Time `json:"at"`
Outcome string `json:"outcome"`
FromVersion string `json:"fromVersion,omitempty"`
ToVersion string `json:"toVersion,omitempty"`
Detail string `json:"detail,omitempty"`
}
UpdateLastResult is how the previous update finished.
type UpdateMappingParams ¶
type UpdateMappingParams struct {
Label *string `json:"label" validate:"omitempty,max=255"`
Enabled *bool `json:"enabled"`
Type *string `json:"type" validate:"omitempty,oneof=id value data uid text"`
Match *string `json:"match" validate:"omitempty,oneof=exact partial regex"`
Pattern *string `json:"pattern" validate:"omitempty,min=1"`
Override *string `json:"override"`
ID int `json:"id" validate:"gt=0"`
}
type UpdatePlaytimeLimitsParams ¶ added in v2.7.0
type UpdatePlaytimeLimitsParams struct {
Enabled *bool `json:"enabled"`
Daily *string `json:"daily" validate:"omitempty,duration"`
Session *string `json:"session" validate:"omitempty,duration"`
SessionReset *string `json:"sessionReset" validate:"omitempty,duration"`
Warnings *[]string `json:"warnings" validate:"omitempty,dive,duration"`
Retention *int `json:"retention" validate:"omitempty,gte=0"`
}
type UpdateProfileParams ¶ added in v2.16.0
type UpdateProfileParams struct {
Name *string `json:"name" validate:"omitempty,min=1,max=255"`
PIN *string `json:"pin" validate:"omitempty,numeric,min=4,max=8"`
LimitsEnabled *bool `json:"limitsEnabled"`
DailyLimit *string `json:"dailyLimit" validate:"omitempty,duration"`
SessionLimit *string `json:"sessionLimit" validate:"omitempty,duration"`
Role *string `json:"role" validate:"omitempty,oneof=admin member"`
ProfileID string `json:"profileId" validate:"required,min=1"`
ClearPIN bool `json:"clearPin"`
ClearLimits bool `json:"clearLimits"`
RegenerateSwitchID bool `json:"regenerateSwitchId"`
}
UpdateProfileParams updates a profile. Omitted fields are unchanged. ClearPIN removes the PIN; ClearLimits resets all limit overrides back to inheriting global config before any limit fields in the same request are applied (clear-then-set); RegenerateSwitchID issues a new switch ID (lost-card replacement).
type UpdateSettingsParams ¶
type UpdateSettingsParams struct {
RunZapScript *bool `json:"runZapScript"`
DebugLogging *bool `json:"debugLogging"`
AudioScanFeedback *bool `json:"audioScanFeedback"`
ReadersAutoDetect *bool `json:"readersAutoDetect"`
ErrorReporting *bool `json:"errorReporting"`
Encryption *bool `json:"encryption"`
BackupRemoteEnabled *bool `json:"backupRemoteEnabled"`
PlaytimeSyncEnabled *bool `json:"playtimeSyncEnabled"`
LibrarySyncEnabled *bool `json:"librarySyncEnabled"`
RemoteControlEnabled *bool `json:"remoteControlEnabled"`
UpdateChannel *string `json:"updateChannel" validate:"omitempty,oneof=stable beta"`
BackupRemoteSchedule *string `json:"backupRemoteSchedule" validate:"omitempty,oneof=daily weekly manual"`
ReadersScanMode *string `json:"readersScanMode" validate:"omitempty,oneof=tap hold"`
AudioMidiSoundFont *string `json:"audioMidiSoundFont" validate:"omitempty,max=4096"`
ReadersScanExitDelay *float32 `json:"readersScanExitDelay" validate:"omitempty,gte=0"`
ReadersScanIgnoreSystem *[]string `json:"readersScanIgnoreSystems" validate:"omitempty,dive,system"`
// dive is what makes the tags on ReaderConnection run at all: without it
// the validator stops at the slice and every element goes unchecked.
ReadersConnect *[]ReaderConnection `json:"readersConnect,omitempty" validate:"omitempty,dive"`
SystemDefaults *[]SystemDefault `json:"systemDefaults,omitempty" validate:"omitempty,dive"`
LauncherPreference *[]string `json:"launcherPreference,omitempty" validate:"omitempty,dive,required"`
AudioVolume *int `json:"audioVolume" validate:"omitempty,gte=0,lte=200"`
AudioMusicVolume *int `json:"audioMusicVolume" validate:"omitempty,gte=0,lte=200"`
AudioMusicAutoplay *bool `json:"audioMusicAutoplay"`
AudioNormalize *bool `json:"audioNormalize"`
AudioMusicPauseOnLaunch *bool `json:"audioMusicPauseOnLaunch"`
LaunchGuardEnabled *bool `json:"launchGuardEnabled"`
LaunchGuardTimeout *float32 `json:"launchGuardTimeout" validate:"omitempty,gte=-1"`
LaunchGuardDelay *float32 `json:"launchGuardDelay" validate:"omitempty,gte=0"`
LaunchGuardRequireConfirm *bool `json:"launchGuardRequireConfirm"`
ProfilesRequireForLaunch *bool `json:"profilesRequireForLaunch"`
ProfilesSwapData *bool `json:"profilesSwapData"`
UpdateCheck *bool `json:"updateCheck"`
UpdateInstall *bool `json:"updateInstall"`
// MediaImageDir is [media] image_dir; "" restores the default.
MediaImageDir *string `json:"mediaImageDir" validate:"omitempty,max=4096"`
// MediaThumbCacheMaxMB is [media] thumb_cache_max_mb; 0 restores the default.
MediaThumbCacheMaxMB *int `json:"mediaThumbCacheMaxMb" validate:"omitempty,gte=0,lte=1048576"`
}
type UpdateStateNotification ¶ added in v2.17.0
type UpdateStateNotification struct {
Stage string `json:"stage"`
Version string `json:"version,omitempty"`
Trigger string `json:"trigger,omitempty"`
Error string `json:"error,omitempty"`
BytesDownloaded int64 `json:"bytesDownloaded,omitempty"`
BytesTotal int64 `json:"bytesTotal,omitempty"`
}
UpdateStateNotification is the payload for the update.state notification, sent while an update is being applied. The stages after the restart — confirming, succeeded and rolledBack — happen before any client is back, so they are reported by update.check's lastResult rather than here.
type VerifyProfileParams ¶ added in v2.16.0
type VerifyProfileParams struct {
ProfileID *string `json:"profileId"`
SwitchID *string `json:"switchId"`
PIN *string `json:"pin"`
}
VerifyProfileParams verifies a profile credential without switching. Exactly one of ProfileID (with PIN when the profile has one) or SwitchID (a bearer credential) must be given.