convertBotToUserWithHttpInfo method

Future<Response> convertBotToUserWithHttpInfo(
  1. String botUserId,
  2. MmConvertBotToUserRequest mmConvertBotToUserRequest, {
  3. bool? setSystemAdmin,
})

Convert a bot into a user

Convert a bot into a user. Minimum server version: 5.26 ##### Permissions Must have manage_system permission.

Note: This method returns the HTTP Response.

Parameters:

  • String botUserId (required): Bot user ID

  • MmConvertBotToUserRequest mmConvertBotToUserRequest (required): Data to be used in the user creation

  • bool setSystemAdmin: Whether to give the user the system admin role.

Implementation

Future<Response> convertBotToUserWithHttpInfo(
  String botUserId,
  MmConvertBotToUserRequest mmConvertBotToUserRequest, {
  bool? setSystemAdmin,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/bots/{bot_user_id}/convert_to_user'.replaceAll('{bot_user_id}', botUserId);

  // ignore: prefer_final_locals
  Object? postBody = mmConvertBotToUserRequest;

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

  if (setSystemAdmin != null) {
    queryParams.addAll(_queryParams('', 'set_system_admin', setSystemAdmin));
  }

  const contentTypes = <String>['application/json'];

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