namespace _zeitbild.api { /** */ export function register_calendar_event_get( rest_subject : lib_plankton.rest.type_rest ) : void { register< null, ( _zeitbild.type_event_object | string ) >( rest_subject, lib_plankton.http.enum_method.get, "/calendar/:calendar_id/event/:event_id", { "description": "gibt die Daten eines Termins aus", "output_schema": () => ({ "type": "object", "properties": { "name": { "nullable": false, "type": "string" }, "begin": _zeitbild.api.datetime_type( { "nullable": false, } ), "end": _zeitbild.api.datetime_type( { "nullable": true, } ), "location": { "type": "string", "nullable": true, }, "link": { "type": "string", "nullable": true, }, "description": { "type": "string", "nullable": true, }, }, "required": [ "name", "begin", "end", "location", "description", ], "additionalProperties": false }), "restriction": restriction_logged_in, "execution": async (stuff) => { const session : {key : string; value : lib_plankton.session.type_session;} = await session_from_stuff(stuff); const user_id : _zeitbild.type_user_id = await _zeitbild.service.user.identify(session.value.name); return ( _zeitbild.service.calendar.event_get( parseInt(stuff.path_parameters["calendar_id"]), parseInt(stuff.path_parameters["event_id"]), user_id ) .then( (event_object) => Promise.resolve({ "status_code": 200, "data": event_object, }) ) .catch( (reason) => Promise.resolve({ "status_code": 403, "data": String(reason), }) ) ); } } ); } }