55namespace AzureOpenAIProxy . ApiApp . Endpoints ;
66
77/// <summary>
8- /// This represents the endpoint entity for get event details by admin
8+ /// This represents the endpoint entity for event details by admin
99/// </summary>
1010public static class AdminEventEndpoints
1111{
1212 /// <summary>
13- /// Adds the get event details by admin endpoint
13+ /// Adds the admin event endpoint
1414 /// </summary>
1515 /// <param name="app"><see cref="WebApplication"/> instance.</param>
1616 /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
17- public static RouteHandlerBuilder AddAdminEvents ( this WebApplication app )
17+ public static RouteHandlerBuilder AddNewAdminEvent ( this WebApplication app )
1818 {
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 ) =>
19+ var builder = app . MapPost ( AdminEndpointUrls . AdminEvents , async (
20+ [ FromBody ] AdminEventDetails payload ,
21+ HttpRequest request ) =>
2322 {
24- // Todo: Issue #208 https://github.com/aliencube/azure-openai-sdk-proxy/issues/208
25- return Results . Ok ( ) ;
26- // Todo: Issue #208
23+ return await Task . FromResult ( Results . Ok ( ) ) ;
2724 } )
25+ // TODO: Check both request/response payloads
26+ . Accepts < AdminEventDetails > ( contentType : "application/json" )
2827 . Produces < AdminEventDetails > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
28+ // TODO: Check both request/response payloads
29+ . Produces ( statusCode : StatusCodes . Status400BadRequest )
2930 . Produces ( statusCode : StatusCodes . Status401Unauthorized )
3031 . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
3132 . WithTags ( "admin" )
32- . WithName ( "GetAdminEventDetails " )
33+ . WithName ( "CreateAdminEvent " )
3334 . WithOpenApi ( operation =>
3435 {
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. " ;
36+ operation . Summary = "Create admin event" ;
37+ operation . Description = "Create admin event" ;
3738
3839 return operation ;
3940 } ) ;
@@ -46,7 +47,7 @@ public static RouteHandlerBuilder AddAdminEvents(this WebApplication app)
4647 /// </summary>
4748 /// <param name="app"><see cref="WebApplication"/> instance.</param>
4849 /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
49- public static RouteHandlerBuilder AddAdminEventList ( this WebApplication app )
50+ public static RouteHandlerBuilder AddListAdminEvents ( this WebApplication app )
5051 {
5152 // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
5253 // Need authorization by admin
@@ -73,65 +74,64 @@ public static RouteHandlerBuilder AddAdminEventList(this WebApplication app)
7374 }
7475
7576 /// <summary>
76- /// Adds the update event details by admin endpoint
77+ /// Adds the get event details by admin endpoint
7778 /// </summary>
7879 /// <param name="app"><see cref="WebApplication"/> instance.</param>
7980 /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
80- public static RouteHandlerBuilder AddUpdateAdminEvents ( this WebApplication app )
81+ public static RouteHandlerBuilder AddGetAdminEvent ( this WebApplication app )
8182 {
8283 // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
8384 // Need authorization by admin
84- var builder = app . MapPut ( AdminEndpointUrls . AdminEventDetails , (
85- [ FromRoute ] string eventId ,
86- [ FromBody ] AdminEventDetails payload ) =>
85+ var builder = app . MapGet ( AdminEndpointUrls . AdminEventDetails , (
86+ [ FromRoute ] string eventId ) =>
8787 {
88- // Todo: Issue #203 https://github.com/aliencube/azure-openai-sdk-proxy/issues/203
88+ // Todo: Issue #208 https://github.com/aliencube/azure-openai-sdk-proxy/issues/208
8989 return Results . Ok ( ) ;
90+ // Todo: Issue #208
9091 } )
91- . Accepts < AdminEventDetails > ( contentType : "application/json" )
9292 . Produces < AdminEventDetails > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
9393 . Produces ( statusCode : StatusCodes . Status401Unauthorized )
94- . Produces ( statusCode : StatusCodes . Status404NotFound )
9594 . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
9695 . WithTags ( "admin" )
97- . WithName ( "UpdateAdminEventDetails " )
96+ . WithName ( "GetAdminEvent " )
9897 . WithOpenApi ( operation =>
9998 {
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." ;
99+ operation . Summary = "Gets event details from the given event ID" ;
100+ operation . Description = "This endpoint gets the event details from the given event ID." ;
102101
103102 return operation ;
104103 } ) ;
105104
106105 return builder ;
107106 }
108-
107+
109108 /// <summary>
110- /// Adds the admin event endpoint
109+ /// Adds the update event details by admin endpoint
111110 /// </summary>
112111 /// <param name="app"><see cref="WebApplication"/> instance.</param>
113112 /// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns>
114- public static RouteHandlerBuilder CreateAdminEvent ( this WebApplication app )
113+ public static RouteHandlerBuilder AddUpdateAdminEvent ( this WebApplication app )
115114 {
116- var builder = app . MapPost ( AdminEndpointUrls . AdminEvents , async (
117- [ FromBody ] AdminEventDetails payload ,
118- HttpRequest request ) =>
115+ // Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19
116+ // Need authorization by admin
117+ var builder = app . MapPut ( AdminEndpointUrls . AdminEventDetails , (
118+ [ FromRoute ] string eventId ,
119+ [ FromBody ] AdminEventDetails payload ) =>
119120 {
120- return await Task . FromResult ( Results . Ok ( ) ) ;
121+ // Todo: Issue #203 https://github.com/aliencube/azure-openai-sdk-proxy/issues/203
122+ return Results . Ok ( ) ;
121123 } )
122- // TODO: Check both request/response payloads
123124 . Accepts < AdminEventDetails > ( contentType : "application/json" )
124125 . Produces < AdminEventDetails > ( statusCode : StatusCodes . Status200OK , contentType : "application/json" )
125- // TODO: Check both request/response payloads
126- . Produces ( statusCode : StatusCodes . Status400BadRequest )
127126 . Produces ( statusCode : StatusCodes . Status401Unauthorized )
127+ . Produces ( statusCode : StatusCodes . Status404NotFound )
128128 . Produces < string > ( statusCode : StatusCodes . Status500InternalServerError , contentType : "text/plain" )
129129 . WithTags ( "admin" )
130- . WithName ( "CreateAdminEvent " )
130+ . WithName ( "UpdateAdminEvent " )
131131 . WithOpenApi ( operation =>
132132 {
133- operation . Summary = "Create admin event" ;
134- operation . Description = "Create admin event" ;
133+ operation . Summary = "Updates event details from the given event ID " ;
134+ operation . Description = "This endpoint updates the event details from the given event ID. " ;
135135
136136 return operation ;
137137 } ) ;
0 commit comments