api.reservations.reservation_to_input_format
Converts a reservation dictionary, usually from the context, into input for a workflow trigger reservation task.
Arguments:
def api.reservations.reservation_to_input_format(
reservation: dict = None, # The reservation to convert to input format
):
Returns a dict that can be passed to the workflow trigger reservation task. Will contain the original reservation_id
, so passing this to the task as is will result in a modification. If you want to duplicate a reservation, add + { 'reservation_id': None }
to remove the reservation ID.
Examples:
resv_as_input = api.reservations.reservation_to_input_format(reservation=reservation)
resv_as_input = resv_as_input + { 'units': 2 } # Update the units to 2