docs: def generate_order(self, package_keyname, location, item_keynames, complex_type=None,
                         hourly=True, preset_keyname=None, extras=None, quantity=1):
          """Generates an order with the given package and prices.
  
          This function takes in parameters needed for an order and generates an order
          dictionary. This dictionary can then be used in either verify or placeOrder().
  
          :param str package_keyname: The keyname for the package being ordered
          :param str location: The datacenter location string for ordering (Ex: DALLAS13)
          :param list item_keynames: The list of item keyname strings to order. To see list of
                                     possible keynames for a package, use list_items()
                                     (or `slcli order item-list`)
          :param str complex_type: The complex type to send with the order. Typically begins
                                   with `SoftLayer_Container_Product_Order_`.
          :param bool hourly: If true, uses hourly billing, otherwise uses monthly billing
          :param string preset_keyname: If needed, specifies a preset to use for that package.
                                        To see a list of possible keynames for a package, use
                                        list_preset() (or `slcli order preset-list`)
          :param dict extras: The extra data for the order in dictionary format.
                              Example: A VSI order requires hostname and domain to be set, so
                              extras will look like the following:
                              {'virtualGuests': [{'hostname': 'test', 'domain': 'softlayer.com'}]}
          :param int quantity: The number of resources to order
  
          """
          container = {}
          order = {}
          extras = extras or {}
  
          package = self.get_package_by_key(package_keyname, mask='id')
  
          # if there was extra data given for the order, add it to the order
          # example: VSIs require hostname and domain set on the order, so
          # extras will be {'virtualGuests': [{'hostname': 'test',
          #                                    'domain': 'softlayer.com'}]}
          order.update(extras)
          order['packageId'] = package['id']
          order['quantity'] = quantity
          order['location'] = self.get_location_id(location)
          order['useHourlyPricing'] = hourly
  
          preset_core = None
          if preset_keyname:
              preset_id = self.get_preset_by_key(package_keyname, preset_keyname)['id']
              preset_items = self.get_preset_prices(preset_id)
              for item in preset_items['prices']:
                  if item['item']['itemCategory']['categoryCode'] == "guest_core":
                      preset_core = item['item']['capacity']
              order['presetId'] = preset_id
  
          if not complex_type:
              raise exceptions.SoftLayerError("A complex type must be specified with the order")
          order['complexType'] = complex_type
  
          price_ids = self.get_price_id_list(package_keyname, item_keynames, preset_core)
          order['prices'] = [{'id': price_id} for price_id in price_ids]
  
          container['orderContainers'] = [order]
  
          return container