create method
Create team
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
Implementation
Future<models.Team> create(
{required String teamId,
required String name,
List<String>? roles}) async {
const String apiPath = '/teams';
final Map<String, dynamic> apiParams = {
'teamId': teamId,
'name': name,
'roles': roles,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.post,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.Team.fromMap(res.data);
}