def METHOD_NAME(cls, data):
    image = data.get("image")
    media_url = data.get("media_url")
    if not image and not media_url:
        raise ValidationError(
            {
                "input": ValidationError(
                    "Image or external URL is required.",
                    code=ProductErrorCode.REQUIRED.value,
                )
            }
        )
    if image and media_url:
        raise ValidationError(
            {
                "input": ValidationError(
                    "Either image or external URL is required.",
                    code=ProductErrorCode.DUPLICATED_INPUT_ITEM.value,
                )
            }
        )