mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 20:04:56 +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 PepperDash.Core;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
using System;
|
||||
using Serilog.Events;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,6 +4,7 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
using Serilog.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,7 +14,15 @@ using System.Threading.Tasks;
|
||||
|
||||
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()
|
||||
: base(true)
|
||||
|
||||
@@ -3,9 +3,19 @@ using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,9 +2,19 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,9 +2,19 @@
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,9 +3,19 @@ using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,9 +2,21 @@
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
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) { }
|
||||
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
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) { }
|
||||
|
||||
|
||||
@@ -2,9 +2,19 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,9 +2,18 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,9 +3,20 @@ using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using PepperDash.Essentials.Core.Web.Attributes;
|
||||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user