postTeamFilesByWorkspaceWithHttpInfo method
Upload a file into a workspace
Stores one file in a workspace's blob store and answers the blob id it is addressable by, as plain text — the front discards that body, it is there for a caller driving this by hand. The body is a multipart form with a file part, and THAT PART'S FILENAME IS THE BLOB ID: the client mints it (a uuid v4) and the server stores under it, so a part whose filename is not a uuid is refused rather than assigned one. A file over 100 MiB is 413 and an empty one is 400. The caller must hold a verified session or workspace token AND be a member of the workspace; an unknown workspace, another tenant's workspace and a workspace the caller is not in all answer the same 404, so a probe learns nothing about what exists. The stored key embeds the verified org and the workspace, so an upload cannot land in another tenant's box whatever id it names. A storage backend that is unavailable fails closed with 502 rather than reporting a write it never made.
Note: This method returns the HTTP Response.
Parameters:
-
String workspace (required):
-
MultipartFilebody:
Implementation
Future<Response> postTeamFilesByWorkspaceWithHttpInfo(String workspace, { MultipartFile? body, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/team/files/{workspace}'
.replaceAll('{workspace}', workspace);
// ignore: prefer_final_locals
Object? postBody = body;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/octet-stream'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}