1- using AzureOpenAIProxy . ApiApp . Models ;
2-
3- using Microsoft . AspNetCore . Mvc ;
4-
5- namespace AzureOpenAIProxy . ApiApp . Endpoints ;
6-
7- /// <summary>
8- /// This represents the endpoint entity for get event details by admin
9- /// </summary>
10- public static class AdminEventEndpoints
11- {
12- /// <summary>
13- /// Adds the get event details by admin endpoint
14- /// </summary>
15- /// <param name="app"><see cref="WebApplication"/> instance.</param>
16- /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
17- public static RouteHandlerBuilder AddAdminEvents ( this WebApplication app )
18- {
19- // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
20- // Need authorization by admin
21- var builder = app . MapGet ( AdminEndpointUrls . AdminEventDetails , (
22- [ FromRoute ] string eventId ) =>
23- {
24- // Todo: Issue #208 https://github.com/aliencube/azure-openai-sdk-proxy/issues/208
25- return Results . Ok ( ) ;
26- // Todo: Issue #208
27- } )
28- . Produces < AdminEventDetails > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
29- . Produces ( statusCode : StatusCodes . Status401Unauthorized )
30- . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
31- . WithTags ( "admin" )
32- . WithName ( "GetAdminEventDetails" )
33- . WithOpenApi ( operation =>
34- {
35- operation . Summary = "Gets event details from the given event ID" ;
36- operation . Description = "This endpoint gets the event details from the given event ID." ;
37-
38- return operation ;
39- } ) ;
40-
41- return builder ;
42- }
43- }
1+ using AzureOpenAIProxy . ApiApp . Models ;
2+
3+ using Microsoft . AspNetCore . Mvc ;
4+
5+ namespace AzureOpenAIProxy . ApiApp . Endpoints ;
6+
7+ /// <summary>
8+ /// This represents the endpoint entity for get event details by admin
9+ /// </summary>
10+ public static class AdminEventEndpoints
11+ {
12+ /// <summary>
13+ /// Adds the get event details by admin endpoint
14+ /// </summary>
15+ /// <param name="app"><see cref="WebApplication"/> instance.</param>
16+ /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
17+ public static RouteHandlerBuilder AddAdminEvents ( this WebApplication app )
18+ {
19+ // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
20+ // Need authorization by admin
21+ var builder = app . MapGet ( AdminEndpointUrls . AdminEventDetails , (
22+ [ FromRoute ] string eventId ) =>
23+ {
24+ // Todo: Issue #208 https://github.com/aliencube/azure-openai-sdk-proxy/issues/208
25+ return Results . Ok ( ) ;
26+ // Todo: Issue #208
27+ } )
28+ . Produces < AdminEventDetails > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
29+ . Produces ( statusCode : StatusCodes . Status401Unauthorized )
30+ . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
31+ . WithTags ( "admin" )
32+ . WithName ( "GetAdminEventDetails" )
33+ . WithOpenApi ( operation =>
34+ {
35+ operation . Summary = "Gets event details from the given event ID" ;
36+ operation . Description = "This endpoint gets the event details from the given event ID." ;
37+
38+ return operation ;
39+ } ) ;
40+
41+ return builder ;
42+ }
43+
44+ /// <summary>
45+ /// Adds the get event lists by admin endpoint
46+ /// </summary>
47+ /// <param name="app"><see cref="WebApplication"/> instance.</param>
48+ /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
49+ public static RouteHandlerBuilder AddAdminEventList ( this WebApplication app )
50+ {
51+ // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
52+ // Need authorization by admin
53+ var builder = app . MapGet ( AdminEndpointUrls . AdminEvents , ( ) =>
54+ {
55+ // Todo: Issue #218 https://github.com/aliencube/azure-openai-sdk-proxy/issues/218
56+ return Results . Ok ( ) ;
57+ // Todo: Issue #218
58+ } )
59+ . Produces < List < AdminEventDetails > > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
60+ . Produces ( statusCode : StatusCodes . Status401Unauthorized )
61+ . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
62+ . WithTags ( "admin" )
63+ . WithName ( "GetAdminEvents" )
64+ . WithOpenApi ( operation =>
65+ {
66+ operation . Summary = "Gets all events" ;
67+ operation . Description = "This endpoint gets all events" ;
68+
69+ return operation ;
70+ } ) ;
71+
72+ return builder ;
73+ }
74+ }
0 commit comments