code: def encode_to_json(order_list):
      
      rowsets = []
      for items_in_region_list in order_list._orders.values():
          region_id = items_in_region_list.region_id
          type_id = items_in_region_list.type_id
          generated_at = gen_iso_datetime_str(items_in_region_list.generated_at)
  
          rows = []
          for order in items_in_region_list.orders:
              issue_date = gen_iso_datetime_str(order.order_issue_date)
  
              # The order in which these values are added is crucial. It must
              # match STANDARD_ENCODED_COLUMNS.
              rows.append([
                  order.price,
                  order.volume_remaining,
                  order.order_range,
                  order.order_id,
                  order.volume_entered,
                  order.minimum_volume,
                  order.is_bid,
                  issue_date,
                  order.order_duration,
                  order.station_id,
                  order.solar_system_id,
              ])
  
          rowsets.append(dict(
              generatedAt = generated_at,
              regionID = region_id,
              typeID = type_id,
              rows = rows,
          ))
  
      json_dict = {
          'resultType': 'orders',
          'version': '0.1',
          'uploadKeys': order_list.upload_keys,
          'generator': order_list.order_generator,
          'currentTime': gen_iso_datetime_str(now_dtime_in_utc()),
          # This must match the order of the values in the row assembling portion
          # above this.
          'columns': STANDARD_ENCODED_COLUMNS,
          'rowsets': rowsets,
      }
  
      return json.dumps(json_dict)
docs: Encodes this list of MarketOrder instances to a JSON string.
  
      :param MarketOrderList order_list: The order list to serialize.
      :rtype: str