def METHOD_NAME(
    variants_id: set,
    channel_id: int,
    error_code: str,
):
    """Validate available variants in specific channel."""
    (
        not_available_variants,
        not_available_graphql_ids,
    ) = get_not_available_variants_in_channel(variants_id, channel_id)
    if not_available_variants:
        raise ValidationError(
            {
                "lines": ValidationError(
                    "Cannot add lines with unavailable variants.",
                    code=error_code,
                    params={"variants": not_available_graphql_ids},
                )
            }
        )