# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Union, Optional
from typing_extensions import Literal, Required, TypedDict

from .output_options_param import OutputOptionsParam

__all__ = ["JobCreateParams"]


class JobCreateParams(TypedDict, total=False):
    destination_conf: Required[str]
    """Uniquely identifies a resource (such as an s3 bucket) where data.

    will be pushed. Additional configuration parameters supported by the destination
    may be included.
    """

    account_id: str
    """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""

    zone_id: str
    """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""

    dataset: Optional[
        Literal[
            "access_requests",
            "audit_logs",
            "audit_logs_v2",
            "biso_user_actions",
            "casb_findings",
            "device_posture_results",
            "dex_application_tests",
            "dex_device_state_events",
            "dlp_forensic_copies",
            "dns_firewall_logs",
            "dns_logs",
            "email_security_alerts",
            "firewall_events",
            "gateway_dns",
            "gateway_http",
            "gateway_network",
            "http_requests",
            "ipsec_logs",
            "magic_ids_detections",
            "nel_reports",
            "network_analytics_logs",
            "page_shield_events",
            "sinkhole_http_logs",
            "spectrum_events",
            "ssh_logs",
            "warp_config_changes",
            "warp_toggle_changes",
            "workers_trace_events",
            "zaraz_events",
            "zero_trust_network_sessions",
        ]
    ]
    """Name of the dataset.

    A list of supported datasets can be found on the
    [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
    """

    enabled: bool
    """Flag that indicates if the job is enabled."""

    filter: Optional[str]
    """The filters to select the events to include and/or remove from your logs.

    For more information, refer to
    [Filters](https://developers.cloudflare.com/logs/reference/filters/).
    """

    frequency: Optional[Literal["high", "low"]]
    """This field is deprecated.

    Please use `max_upload_*` parameters instead. . The frequency at which
    Cloudflare sends batches of logs to your destination. Setting frequency to high
    sends your logs in larger quantities of smaller files. Setting frequency to low
    sends logs in smaller quantities of larger files.
    """

    kind: Literal["", "edge"]
    """
    The kind parameter (optional) is used to differentiate between Logpush and Edge
    Log Delivery jobs (when supported by the dataset).
    """

    logpull_options: Optional[str]
    """This field is deprecated.

    Use `output_options` instead. Configuration string. It specifies things like
    requested fields and timestamp formats. If migrating from the logpull api, copy
    the url (full url or just the query string) of your call here, and logpush will
    keep on making this call for you, setting start and end times appropriately.
    """

    max_upload_bytes: Union[Literal[0], int, None]
    """The maximum uncompressed file size of a batch of logs.

    This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note
    that you cannot set a minimum file size; this means that log files may be much
    smaller than this batch size.
    """

    max_upload_interval_seconds: Union[Literal[0], int, None]
    """The maximum interval in seconds for log batches.

    This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable
    it. Note that you cannot specify a minimum interval for log batches; this means
    that log files may be sent in shorter intervals than this.
    """

    max_upload_records: Union[Literal[0], int, None]
    """The maximum number of log lines per batch.

    This setting must be between 1000 and 1,000,000 lines, or `0` to disable it.
    Note that you cannot specify a minimum number of log lines per batch; this means
    that log files may contain many fewer lines than this.
    """

    name: Optional[str]
    """Optional human readable job name.

    Not unique. Cloudflare suggests. that you set this to a meaningful string, like
    the domain name, to make it easier to identify your job.
    """

    output_options: Optional[OutputOptionsParam]
    """The structured replacement for `logpull_options`.

    When including this field, the `logpull_option` field will be ignored.
    """

    ownership_challenge: str
    """Ownership challenge token to prove destination ownership."""
