def METHOD_NAME(
    payload: models.RateRequest, settings: provider_utils.Settings
) -> lib.Serializable:
    packages = lib.to_packages(payload.parcels)
    service = (
        provider_units.Services(payload.services, provider_units.Service).first
        or provider_units.Service.dicom_ground_delivery.value
    ).value
    options = lib.to_shipping_options(
        payload.options,
        package_options=packages.options,
        initializer=provider_units.shipping_options_initializer,
    )
    request = DicomRateRequest(
        category="Parcel",
        paymentType=provider_units.PaymentType.prepaid.value,
        deliveryType=service,
        unitOfMeasurement=provider_units.UnitOfMeasurement.KC.value,
        sender=Address(
            postalCode=payload.shipper.postal_code,
            provinceCode=payload.shipper.state_code,
            countryCode=payload.shipper.country_code,
            name=(payload.shipper.company_name or payload.shipper.person_name),
        ),
        consignee=Address(
            postalCode=payload.recipient.postal_code,
            provinceCode=payload.recipient.state_code,
            countryCode=payload.recipient.country_code,
            name=(payload.recipient.company_name or payload.recipient.person_name),
        ),
        parcels=[
            Parcel(
                quantity=1,
                parcelType=provider_units.ParcelType[
                    package.packaging_type or "dicom_box"
                ].value,
                id=None,
                weight=package.weight.KG,
                length=package.height.CM,
                depth=package.length.CM,
                width=package.width.CM,
                note=None,
                status=None,
                FCA_Class=None,
                hazmat=None,
                requestReturnLabel=None,
                returnWaybill=None,
            )
            for package in packages
        ],
        billing=settings.billing_account,
        promoCodes=None,
        surcharges=[
            Surcharge(
                type=option.code,
                value=lib.to_money(option.state),
            )
            for _, option in options.items()
        ],
        appointment=None,
    )
    return lib.Serializable(request, lib.to_dict)