diff options
| author | Cody Robibero <cody@robibe.ro> | 2023-06-10 07:28:21 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-10 07:28:21 -0600 |
| commit | 9a0dfc00f1e36092476f62984ba66886032f4f89 (patch) | |
| tree | 935482bc811b30913944703fb7b980a78294fc17 /MediaBrowser.Controller/Net/WebSocketMessageOfT.cs | |
| parent | 81cf798430a3d8c5504bc30b2d59af26fe5e2b9f (diff) | |
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
Diffstat (limited to 'MediaBrowser.Controller/Net/WebSocketMessageOfT.cs')
| -rw-r--r-- | MediaBrowser.Controller/Net/WebSocketMessageOfT.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Net/WebSocketMessageOfT.cs b/MediaBrowser.Controller/Net/WebSocketMessageOfT.cs new file mode 100644 index 000000000..7c35c8010 --- /dev/null +++ b/MediaBrowser.Controller/Net/WebSocketMessageOfT.cs @@ -0,0 +1,33 @@ +#pragma warning disable SA1649 // File name must equal class name. + +namespace MediaBrowser.Controller.Net; + +/// <summary> +/// Class WebSocketMessage. +/// </summary> +/// <typeparam name="T">The type of the data.</typeparam> +// TODO make this abstract, remove empty ctor. +public class WebSocketMessage<T> : WebSocketMessage +{ + /// <summary> + /// Initializes a new instance of the <see cref="WebSocketMessage{T}"/> class. + /// </summary> + public WebSocketMessage() + { + } + + /// <summary> + /// Initializes a new instance of the <see cref="WebSocketMessage{T}"/> class. + /// </summary> + /// <param name="data">The data to send.</param> + protected WebSocketMessage(T data) + { + Data = data; + } + + /// <summary> + /// Gets or sets the data. + /// </summary> + // TODO make this set only. + public T? Data { get; set; } +} |
