mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
Add OpenAPI attributes to all remaining request handlers
Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
This commit is contained in:
@@ -2,12 +2,22 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
using System;
|
using System;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[HttpPost]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "AppDebug",
|
||||||
|
Description = "Get or set application debug level settings",
|
||||||
|
OperationId = "appDebug")]
|
||||||
|
[OpenApiRequestBody(Description = "Debug level configuration")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
public class AppDebugRequestHandler : WebApiBaseRequestHandler
|
public class AppDebugRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -13,7 +14,15 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
public class DebugSessionRequestHandler : WebApiBaseRequestHandler
|
[HttpGet]
|
||||||
|
[HttpPost]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "DebugSession",
|
||||||
|
Description = "Start or stop a WebSocket debug session",
|
||||||
|
OperationId = "debugSession")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
public class DebugSessionRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
public DebugSessionRequestHandler()
|
public DebugSessionRequestHandler()
|
||||||
: base(true)
|
: base(true)
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ using Crestron.SimplSharp.WebScripting;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "DevMethods",
|
||||||
|
Description = "Retrieve available methods for a specific device",
|
||||||
|
OperationId = "getDeviceMethods")]
|
||||||
|
[OpenApiParameter("deviceKey", Description = "The key of the device")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Device not found")]
|
||||||
public class DevMethodsRequestHandler : WebApiBaseRequestHandler
|
public class DevMethodsRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -2,9 +2,19 @@
|
|||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "DevProps",
|
||||||
|
Description = "Retrieve properties for a specific device",
|
||||||
|
OperationId = "getDeviceProperties")]
|
||||||
|
[OpenApiParameter("deviceKey", Description = "The key of the device")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Device not found")]
|
||||||
public class DevPropsRequestHandler : WebApiBaseRequestHandler
|
public class DevPropsRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpPost]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "DisableAllStreamDebug",
|
||||||
|
Description = "Disable stream debugging for all devices",
|
||||||
|
OperationId = "disableAllStreamDebug")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response")]
|
||||||
public class DisableAllStreamDebugRequestHandler : WebApiBaseRequestHandler
|
public class DisableAllStreamDebugRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -2,9 +2,19 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[HttpPost]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "DoNotLoadConfigOnNextBoot",
|
||||||
|
Description = "Get or set flag to prevent configuration loading on next boot",
|
||||||
|
OperationId = "doNotLoadConfigOnNextBoot")]
|
||||||
|
[OpenApiRequestBody(Description = "Configuration loading flag")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
public class DoNotLoadConfigOnNextBootRequestHandler : WebApiBaseRequestHandler
|
public class DoNotLoadConfigOnNextBootRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ using Crestron.SimplSharp.WebScripting;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "GetJoinMapsForBridgeKey",
|
||||||
|
Description = "Retrieve all join maps for a specific bridge",
|
||||||
|
OperationId = "getJoinMapForBridge")]
|
||||||
|
[OpenApiParameter("bridgeKey", Description = "The key of the bridge")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Bridge not found")]
|
||||||
public class GetJoinMapForBridgeKeyRequestHandler : WebApiBaseRequestHandler
|
public class GetJoinMapForBridgeKeyRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -2,9 +2,21 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "GetJoinMapsForDeviceKey",
|
||||||
|
Description = "Retrieve join map for a specific device within a bridge",
|
||||||
|
OperationId = "getJoinMapForDevice")]
|
||||||
|
[OpenApiParameter("bridgeKey", Description = "The key of the bridge")]
|
||||||
|
[OpenApiParameter("deviceKey", Description = "The key of the device")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Bridge not found")]
|
||||||
|
[OpenApiResponse(500, Description = "Device join map not found")]
|
||||||
public class GetJoinMapForDeviceKeyRequestHandler : WebApiBaseRequestHandler
|
public class GetJoinMapForDeviceKeyRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
public class GetRoutingPortsHandler : WebApiBaseRequestHandler
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "Get Routing Ports for a device",
|
||||||
|
Description = "Retrieve routing input and output ports for a specific device",
|
||||||
|
OperationId = "getDeviceRoutingPorts")]
|
||||||
|
[OpenApiParameter("deviceKey", Description = "The key of the device")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Device not found")]
|
||||||
|
public class GetRoutingPortsHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
public GetRoutingPortsHandler() : base(true) { }
|
public GetRoutingPortsHandler() : base(true) { }
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
public class GetTieLinesRequestHandler : WebApiBaseRequestHandler
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "Get TieLines",
|
||||||
|
Description = "Retrieve a list of all tie lines in the system",
|
||||||
|
OperationId = "getTieLines")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
public class GetTieLinesRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
public GetTieLinesRequestHandler() : base(true) { }
|
public GetTieLinesRequestHandler() : base(true) { }
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,19 @@
|
|||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "GetTypesByFilter",
|
||||||
|
Description = "Retrieve device types filtered by a specific category",
|
||||||
|
OperationId = "getDeviceTypesByFilter")]
|
||||||
|
[OpenApiParameter("filter", Description = "The filter criteria for device types")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Filtered device types not found")]
|
||||||
public class GetTypesByFilterRequestHandler : WebApiBaseRequestHandler
|
public class GetTypesByFilterRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -2,9 +2,18 @@
|
|||||||
using Crestron.SimplSharp.WebScripting;
|
using Crestron.SimplSharp.WebScripting;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "GetTypes",
|
||||||
|
Description = "Retrieve a list of all available device types",
|
||||||
|
OperationId = "getDeviceTypes")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response", ContentType = "application/json")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Device factory not found")]
|
||||||
public class GetTypesRequestHandler : WebApiBaseRequestHandler
|
public class GetTypesRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -3,9 +3,20 @@ using Crestron.SimplSharp.WebScripting;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Core.Web.RequestHandlers;
|
using PepperDash.Core.Web.RequestHandlers;
|
||||||
|
using PepperDash.Essentials.Core.Web.Attributes;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||||
{
|
{
|
||||||
|
[HttpPost]
|
||||||
|
[OpenApiOperation(
|
||||||
|
Summary = "SetDeviceStreamDebug",
|
||||||
|
Description = "Configure stream debugging settings for a device",
|
||||||
|
OperationId = "setDeviceStreamDebug")]
|
||||||
|
[OpenApiRequestBody(Description = "Device stream debug configuration")]
|
||||||
|
[OpenApiResponse(200, Description = "Successful response")]
|
||||||
|
[OpenApiResponse(400, Description = "Bad Request")]
|
||||||
|
[OpenApiResponse(404, Description = "Device not found")]
|
||||||
|
[OpenApiResponse(500, Description = "Internal Server Error")]
|
||||||
public class SetDeviceStreamDebugRequestHandler : WebApiBaseRequestHandler
|
public class SetDeviceStreamDebugRequestHandler : WebApiBaseRequestHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user