def METHOD_NAME(
    data: dict,
    settings: provider_utils.Settings,
    ctx: dict,
) -> models.ShipmentDetails:
    shipment = lib.to_object(shipping.ShipmentResponseType, data)
    query = urllib.parse.urlencode(ctx["label"])
    label = lib.failsafe(
        lambda: lib.request(
            url=f"{settings.base_url}/Shipments/{shipment.ShipmentId}/labels?{query}",
            decoder=lambda _: lib.decode(base64.encodebytes(_)),
        )
    )
    return models.ShipmentDetails(
        carrier_id=settings.carrier_id,
        carrier_name=settings.carrier_name,
        tracking_number=str(shipment.ShipmentId),
        shipment_identifier=str(shipment.ShipmentId),
        label_type=ctx["label"]["type"],
        docs=models.Documents(label=label),
        meta=dict(
            tracking_numbers=shipment.ParcelIds,
        ),
    )