function getFileToBuild(request, data, inlineLastModified = false) {
    const _isSystemXML = isSystemXML(request.objectKey);
    const fileToBuild = _isSystemXML ? data?.SystemInfo
        : data?.CapacityInfo;
    if (!fileToBuild) {
        return { error: errors.NoSuchKey };
    }
    const modified = fileToBuild.LastModified || (new Date()).toISOString();
    const fieldName = _isSystemXML ? 'SystemInfo' : 'CapacityInfo';
    if (inlineLastModified) {
        fileToBuild.LastModified = modified;
        return {
            value: {
                [fieldName]: fileToBuild,
            },
            fieldName,
        };
    } else {
        delete fileToBuild.LastModified;
        return {
            value: {
                [fieldName]: fileToBuild,
                LastModified: modified,
            },
            fieldName,
        };
    }
}
Helper to extract the file from the bucket metadata

@param {object} request - incoming request
@param {object} data - the bucket metadata or input data
@param {boolean} inlineLastModified - true if LastModified should be in the returned object
or as another standalone field
@returns {error | object} - error if file does not exist, or
the associated metadata