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:
Cody Robibero
2023-06-10 07:28:21 -06:00
committed by GitHub
parent 81cf798430
commit 9a0dfc00f1
51 changed files with 1193 additions and 92 deletions

View File

@@ -1,42 +1,30 @@
using System;
namespace MediaBrowser.Model.SyncPlay
namespace MediaBrowser.Model.SyncPlay;
/// <summary>
/// Group update without data.
/// </summary>
public abstract class GroupUpdate
{
/// <summary>
/// Class GroupUpdate.
/// Initializes a new instance of the <see cref="GroupUpdate"/> class.
/// </summary>
/// <typeparam name="T">The type of the data of the message.</typeparam>
public class GroupUpdate<T>
/// <param name="groupId">The group identifier.</param>
protected GroupUpdate(Guid groupId)
{
/// <summary>
/// Initializes a new instance of the <see cref="GroupUpdate{T}"/> class.
/// </summary>
/// <param name="groupId">The group identifier.</param>
/// <param name="type">The update type.</param>
/// <param name="data">The update data.</param>
public GroupUpdate(Guid groupId, GroupUpdateType type, T data)
{
GroupId = groupId;
Type = type;
Data = data;
}
/// <summary>
/// Gets the group identifier.
/// </summary>
/// <value>The group identifier.</value>
public Guid GroupId { get; }
/// <summary>
/// Gets the update type.
/// </summary>
/// <value>The update type.</value>
public GroupUpdateType Type { get; }
/// <summary>
/// Gets the update data.
/// </summary>
/// <value>The update data.</value>
public T Data { get; }
GroupId = groupId;
}
/// <summary>
/// Gets the group identifier.
/// </summary>
/// <value>The group identifier.</value>
public Guid GroupId { get; }
/// <summary>
/// Gets the update type.
/// </summary>
/// <value>The update type.</value>
public GroupUpdateType Type { get; init; }
}