createAppointment method

Future<AppointmentModel> createAppointment(
  1. NewAppointmentModel newAppointment, {
  2. required Object authorization,
})

Parameters:

Implementation

Future<AppointmentModel> createAppointment(
  NewAppointmentModel newAppointment, {
  required Object authorization,
}) async {
  final response = await createAppointmentWithHttpInfo(
    newAppointment,
    authorization: authorization,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  return await apiClient.deserializeAsync(
    await _decodeBodyBytes(response),
    'AppointmentModel',
  ) as AppointmentModel;
}