docs: def prepare_replicant_order_object(manager, snapshot_schedule, location,
                                     tier, volume, volume_type):
      """Prepare the order object which is submitted to the placeOrder() method
  
      :param manager: The File or Block manager calling this function
      :param snapshot_schedule: The primary volume's snapshot
                                schedule to use for replication
      :param location: The location for the ordered replicant volume
      :param tier: The tier (IOPS per GB) of the primary volume
      :param volume: The primary volume as a SoftLayer_Network_Storage object
      :param volume_type: The type of the primary volume ('file' or 'block')
      :return: Returns the order object for the
               Product_Order service's placeOrder() method
      """
      # Ensure the primary volume and snapshot space are not set for cancellation
      if 'billingItem' not in volume\
              or volume['billingItem']['cancellationDate'] != '':
          raise exceptions.SoftLayerError(
              'This volume is set for cancellation; '
              'unable to order replicant volume')
  
      for child in volume['billingItem']['activeChildren']:
          if child['categoryCode'] == 'storage_snapshot_space'\
                  and child['cancellationDate'] != '':
              raise exceptions.SoftLayerError(
                  'The snapshot space for this volume is set for '
                  'cancellation; unable to order replicant volume')
  
      # Find the ID for the requested location
      try:
          location_id = get_location_id(manager, location)
      except ValueError:
          raise exceptions.SoftLayerError(
              "Invalid datacenter name specified. "
              "Please provide the lower case short name (e.g.: dal09)")
  
      # Get sizes and properties needed for the order
      volume_size = int(volume['capacityGb'])
  
      billing_item_category_code = volume['billingItem']['categoryCode']
      if billing_item_category_code == 'storage_as_a_service':
          order_type_is_saas = True
      elif billing_item_category_code == 'storage_service_enterprise':
          order_type_is_saas = False
      else:
          raise exceptions.SoftLayerError(
              "A replicant volume cannot be ordered for a primary volume with a "
              "billing item category code of '%s'" % billing_item_category_code)
  
      if 'snapshotCapacityGb' in volume:
          snapshot_size = int(volume['snapshotCapacityGb'])
      else:
          raise exceptions.SoftLayerError(
              "Snapshot capacity not found for the given primary volume")
  
      snapshot_schedule_id = find_snapshot_schedule_id(
          volume,
          'SNAPSHOT_' + snapshot_schedule
      )
  
      # Use the volume's billing item category code to get the product package
      package = get_package(manager, billing_item_category_code)
  
      # Find prices based on the primary volume's type and billing item category
      if order_type_is_saas:  # 'storage_as_a_service' package
          complex_type = 'SoftLayer_Container_Product_Order_'\
                         'Network_Storage_AsAService'
          volume_storage_type = volume['storageType']['keyName']
          if 'ENDURANCE' in volume_storage_type:
              volume_is_performance = False
              if tier is None:
                  tier = find_endurance_tier_iops_per_gb(volume)
              prices = [
                  find_price_by_category(package, billing_item_category_code),
                  find_price_by_category(package, 'storage_' + volume_type),
                  find_saas_endurance_space_price(package, volume_size, tier),
                  find_saas_endurance_tier_price(package, tier),
                  find_saas_snapshot_space_price(
                      package, snapshot_size, tier=tier),
                  find_saas_replication_price(package, tier=tier)
              ]
          elif 'PERFORMANCE' in volume_storage_type:
              if not _staas_version_is_v2_or_above(volume):
                  raise exceptions.SoftLayerError(
                      "A replica volume cannot be ordered for this performance "
                      "volume since it does not support Encryption at Rest.")
              volume_is_performance = True
              iops = int(volume['provisionedIops'])
              prices = [
                  find_price_by_category(package, billing_item_category_code),
                  find_price_by_category(package, 'storage_' + volume_type),
                  find_saas_perform_space_price(package, volume_size),
                  find_saas_perform_iops_price(package, volume_size, iops),
                  find_saas_snapshot_space_price(
                      package, snapshot_size, iops=iops),
                  find_saas_replication_price(package, iops=iops)
              ]
          else:
              raise exceptions.SoftLayerError(
                  "Storage volume does not have a valid storage type "
                  "(with an appropriate keyName to indicate the "
                  "volume is a PERFORMANCE or an ENDURANCE volume)")
      else:  # 'storage_service_enterprise' package
          complex_type = 'SoftLayer_Container_Product_Order_'\
                         'Network_Storage_Enterprise'
          volume_is_performance = False
          if tier is None:
              tier = find_endurance_tier_iops_per_gb(volume)
          prices = [
              find_price_by_category(package, billing_item_category_code),
              find_price_by_category(package, 'storage_' + volume_type),
              find_ent_space_price(package, 'endurance', volume_size, tier),
              find_ent_endurance_tier_price(package, tier),
              find_ent_space_price(package, 'snapshot', snapshot_size, tier),
              find_ent_space_price(package, 'replication', volume_size, tier)
          ]
  
      # Determine if hourly billing should be used
      hourly_billing_flag = utils.lookup(volume, 'billingItem', 'hourlyFlag')
      if hourly_billing_flag is None:
          hourly_billing_flag = False
  
      # Build and return the order object
      replicant_order = {
          'complexType': complex_type,
          'packageId': package['id'],
          'prices': prices,
          'quantity': 1,
          'location': location_id,
          'originVolumeId': volume['id'],
          'originVolumeScheduleId': snapshot_schedule_id,
          'useHourlyPricing': hourly_billing_flag
      }
  
      if order_type_is_saas:
          replicant_order['volumeSize'] = volume_size
          if volume_is_performance:
              replicant_order['iops'] = iops
  
      return replicant_order