setTeamIconWithHttpInfo method

Future<Response> setTeamIconWithHttpInfo(
  1. String teamId,
  2. MultipartFile image
)

Sets the team icon

Sets the team icon for the team. Minimum server version: 4.9 ##### Permissions Must be authenticated and have the manage_team permission.

Note: This method returns the HTTP Response.

Parameters:

  • String teamId (required): Team GUID

  • MultipartFile image (required): The image to be uploaded

Implementation

Future<Response> setTeamIconWithHttpInfo(
  String teamId,
  MultipartFile image,
) async {
  // ignore: prefer_const_declarations
  final path = r'/teams/{team_id}/image'.replaceAll('{team_id}', teamId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['multipart/form-data'];

  bool hasFields = false;
  final mp = MultipartRequest('POST', Uri.parse(path));
  if (image != null) {
    hasFields = true;
    mp.fields[r'image'] = image.field;
    mp.files.add(image);
  }
  if (hasFields) {
    postBody = mp;
  }

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}