Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, security, statusSchema, tags,} from '../../chunks.ts';
const base = buildingBase('DistributionCenter');
const reserveSchema = { type: 'object', properties: { can: { type: 'integer', enum: [1, 0] }, seconds_remaining: { type: 'integer', description: 'Time until reserved resources will automatically be released.', }, max_reserve_duration: { type: 'integer', description: 'Max length resources can be kept in reserve.', }, max_reserve_size: { type: 'integer', description: 'Max amount of resources that can be reserved.', }, resources: { type: 'array', description: 'Resources currently in reserve.', items: { type: 'object', properties: { type: { type: 'string' }, quantity: { type: 'integer' } }, required: ['type', 'quantity'], }, }, }, required: ['can', 'seconds_remaining', 'max_reserve_duration', 'max_reserve_size', 'resources'],};
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
export const distributionCenter = { ...buildingCommonMethods(base), ...buildingView(base, { reserve: reserveSchema }, ['reserve']),
[`${base}/reserve`]: { post: { ...tags(base), ...security(), ...operation( 'Reserve resources.', 'Reserves resources so they are held until the timer expires or manually released. Returns the building view. Throws 1009, 1010, and 1011.' ), ...requestBodySchema({ type: 'object', required: ['building_id', 'resources'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, resources: { type: 'array', description: "Resources to reserve so they don't get automatically spent.", items: { type: 'object', properties: { type: { type: 'string' }, quantity: { type: 'integer', description: 'How many to process. Defaults to 1.' }, }, required: ['type', 'quantity'], }, }, }, }), responses: { ...response200( 'Reserves resources so they are held until the timer expires or manually released. Returns the building view. Throws 1009, 1010, and 1011.', { type: 'object', required: ['building', 'status', 'reserve'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), reserve: reserveSchema, }, } ), ...response500(), }, }, },
[`${base}/release_reserve`]: { post: { ...tags(base), ...security(), ...operation('Release reserve.', 'Returns the resources held in reserve back to the planet.'), ...buildingIdRequestBody, responses: { ...response200('Returns the resources held in reserve back to the planet.', { type: 'object', required: ['status'], properties: { status: statusSchema() }, }), ...response500(), }, }, },
[`${base}/get_stored_resources`]: { post: { ...tags(base), ...security(), ...operation( 'Get stored resources.', 'Returns a list of the resources you have stored, to make it easier to identify what you want to store.' ), ...buildingIdRequestBody, responses: { ...response200( 'Returns a list of the resources you have stored, to make it easier to identify what you want to store.', { type: 'object', required: ['status', 'cargo_space_used_each', 'resources'], properties: { status: statusSchema(), cargo_space_used_each: { type: 'integer' }, resources: { type: 'object', description: 'Keyed by resource type.', additionalProperties: { type: 'integer' }, }, }, } ), ...response500(), }, }, },};