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- }
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+
75+ /// <summary>
76+ /// Adds the update event details by admin endpoint
77+ /// </summary>
78+ /// <param name="app"><see cref="WebApplication"/> instance.</param>
79+ /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
80+ public static RouteHandlerBuilder AddUpdateAdminEvents ( this WebApplication app )
81+ {
82+ // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
83+ // Need authorization by admin
84+ var builder = app . MapPut ( AdminEndpointUrls . AdminEventDetails , (
85+ [ FromRoute ] string eventId ,
86+ [ FromBody ] AdminEventDetails payload ) =>
87+ {
88+ // Todo: Issue #203 https://github.com/aliencube/azure-openai-sdk-proxy/issues/203
89+ return Results . Ok ( ) ;
90+ } )
91+ . Accepts < AdminEventDetails > ( contentType : "application/json" )
92+ . Produces < AdminEventDetails > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
93+ . Produces ( statusCode : StatusCodes . Status401Unauthorized )
94+ . Produces ( statusCode : StatusCodes . Status404NotFound )
95+ . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
96+ . WithTags ( "admin" )
97+ . WithName ( "UpdateAdminEventDetails" )
98+ . WithOpenApi ( operation =>
99+ {
100+ operation . Summary = "Updates event details from the given event ID" ;
101+ operation . Description = "This endpoint updates the event details from the given event ID." ;
102+
103+ return operation ;
104+ } ) ;
105+
106+ return builder ;
107+ }
74108}
0 commit comments