createEmployee method

Future<EmployeeModel> createEmployee(
  1. NewEmployeeModel employeeModel, {
  2. required Object authorization,
})

Parameters:

Implementation

Future<EmployeeModel> createEmployee(
  NewEmployeeModel employeeModel, {
  required Object authorization,
}) async {
  final response = await _createEmployeeWithHttpInfo(
    employeeModel,
    authorization: authorization,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }

  return await apiClient.deserializeAsync(
    await _decodeBodyBytes(response),
    'EmployeeModel',
  ) as EmployeeModel;
}