importTeam method
Import a Team from other application
Import a team into a existing team. Import users, channels, posts, hooks. ##### Permissions Must have permission_import_team
permission.
Parameters:
Implementation
Future<MmImportTeam200Response?> importTeam(
String teamId,
MultipartFile file,
int filesize,
String importFrom,
) async {
final response = await importTeamWithHttpInfo(
teamId,
file,
filesize,
importFrom,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw MmApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'MmImportTeam200Response',
) as MmImportTeam200Response;
}
return null;
}