mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
Add all websocket messages to generated openapi spec (#9682)
* Add all websocket messages to generated openapi spec * Use oneOf * JsonIgnore ServerId * Oops * Add discriminators * Add WebSocketMessage container for Inbound and Outbound messages
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log entry start message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryStartMessage : WebSocketMessage<IReadOnlyCollection<ActivityLogEntry>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of activity log entries.</param>
|
||||
public ActivityLogEntryStartMessage(IReadOnlyCollection<ActivityLogEntry> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntryStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntryStart;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log entry stop message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryStopMessage : WebSocketMessage<IReadOnlyCollection<ActivityLogEntry>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryStopMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of activity log entries.</param>
|
||||
public ActivityLogEntryStopMessage(IReadOnlyCollection<ActivityLogEntry> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntryStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntryStop;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info start message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoStartMessage : WebSocketMessage<IReadOnlyCollection<TaskInfo>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of task info.</param>
|
||||
public ScheduledTasksInfoStartMessage(IReadOnlyCollection<TaskInfo> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfoStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfoStart;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info stop message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoStopMessage : WebSocketMessage<IReadOnlyCollection<TaskInfo>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoStopMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of task info.</param>
|
||||
public ScheduledTasksInfoStopMessage(IReadOnlyCollection<TaskInfo> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfoStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfoStop;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions start message.
|
||||
/// </summary>
|
||||
public class SessionsStartMessage : WebSocketMessage<SessionInfo>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Session info.</param>
|
||||
public SessionsStartMessage(SessionInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SessionsStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SessionsStart;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions stop message.
|
||||
/// </summary>
|
||||
public class SessionsStopMessage : WebSocketMessage<SessionInfo>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsStopMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Session info.</param>
|
||||
public SessionsStopMessage(SessionInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SessionsStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SessionsStop;
|
||||
}
|
||||
Reference in New Issue
Block a user