def METHOD_NAME(
    key_id: Optional[str],
    issuer_id: Optional[str],
    private_key: Optional[str],
    vendor_number: Optional[str],
    date: Optional[datetime],
    table: Optional[str],
):
    """Import Apple Subscriber report into BigQuery."""
    auth_options = (key_id, issuer_id, private_key, vendor_number)
    if any(auth_options) and not all(auth_options):
        raise click.ClickException(
            "Must set all of --key-id, --issuer-id, --private-key, and "
            "--vendor-number or none of them"
        )
    if (table or key_id) and not date:
        raise click.ClickException("must specify --date")
    if table and date:
        table = f"{table}${date:%Y%m%d}"
    with TemporaryFile(mode="w+b") if table else sys.stdout.buffer as file_obj:
        has_rows = False
        report_date = f"{date:%F}\t".encode("UTF-8")
        for line in _get_lines(key_id, issuer_id, private_key, vendor_number, date):
            file_obj.write(report_date)  # prefix lines with report date column
            file_obj.write(line)
            has_rows = True
        if not has_rows:
            raise click.ClickException("no rows returned")
        elif table:
            if file_obj.writable():
                file_obj.seek(0)
            warnings.filterwarnings("ignore", module="google.auth._default")
            job = bigquery.Client().load_table_from_file(
                file_obj=file_obj,
                destination=table,
                job_config=bigquery.LoadJobConfig(
                    allow_jagged_rows=False,
                    field_delimiter="\t",
                    ignore_unknown_values=False,
                    schema=SUBSCRIBER_SCHEMA,  # only report type supported
                    schema_update_options=[
                        bigquery.SchemaUpdateOption.ALLOW_FIELD_ADDITION
                    ],
                    skip_leading_rows=1,
                    source_format=bigquery.SourceFormat.CSV,
                    time_partitioning=bigquery.TimePartitioning(field="report_date"),
                    write_disposition=bigquery.WriteDisposition.WRITE_TRUNCATE,
                ),
            )
            try:
                click.echo(f"Waiting for {job.job_id}", file=sys.stderr)
                job.result()
            except Exception as e:
                message = f"{job.job_id} failed: {e}"
                for error in job.errors or ():
                    error_message = error.get("message")
                    if error_message and error_message != getattr(e, "message", None):
                        message += f"\n{error_message}"
                raise click.ClickException(message)
            else:
                click.echo(f"{job.job_id} succeeded", file=sys.stderr)