Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, security, statusSchema, tags,} from '../../chunks.ts';
const base = buildingBase('Park');
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
const viewResultSchema = (description: string) => ({ ...response200(description, { type: 'object', required: ['building', 'status', 'party'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), party: { type: 'object', properties: { seconds_remaining: { type: 'integer' }, happiness: { type: 'integer' }, can_throw: { type: 'integer', enum: [1, 0] }, }, required: [], }, }, }), ...response500(),});
export const park = { ...buildingCommonMethods(base), ...buildingView(base, { party: { type: 'object', properties: { seconds_remaining: { type: 'integer' }, happiness: { type: 'integer' }, can_throw: { type: 'integer', enum: [1, 0] }, }, required: [], }, }),
[`${base}/throw_a_party`]: { post: { ...tags(base), ...security(), ...operation( 'Throw a party.', 'Spends 10,000 food to throw a day-long party generating happiness. Returns the building view.' ), ...buildingIdRequestBody, responses: viewResultSchema( 'Spends 10,000 food to throw a day-long party generating happiness. Returns the building view.' ), }, },
[`${base}/subsidize_party`]: { post: { ...tags(base), ...security(), ...operation( 'Subsidize party.', 'Spends 2 essentia to complete the current party immediately. Returns the building view.' ), ...buildingIdRequestBody, responses: viewResultSchema( 'Spends 2 essentia to complete the current party immediately. Returns the building view.' ), }, },};