create method

Future<Team> create({
  1. required String teamId,
  2. required String name,
  3. List<String>? roles,
})

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 path = '/teams';

  final Map<String, dynamic> params = {
    'teamId': teamId,
    'name': name,
    'roles': roles,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.post,
      path: path, params: params, headers: headers);

  return models.Team.fromMap(res.data);
}