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

from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal

from ...._models import BaseModel
from .issue_type import IssueType

__all__ = ["IssueListResponse", "Issue", "IssuePayload"]


class IssuePayload(BaseModel):
    detection_method: Optional[str] = None
    """Describes the method used to detect insight."""

    zone_tag: Optional[str] = None


class Issue(BaseModel):
    id: Optional[str] = None

    dismissed: Optional[bool] = None

    has_extended_context: Optional[bool] = None
    """
    Indicates whether the insight has a large payload that requires fetching via the
    context endpoint.
    """

    issue_class: Optional[str] = None

    issue_type: Optional[IssueType] = None

    payload: Optional[IssuePayload] = None

    resolve_link: Optional[str] = None

    resolve_text: Optional[str] = None

    severity: Optional[Literal["Low", "Moderate", "Critical"]] = None

    since: Optional[datetime] = None

    status: Optional[Literal["active", "resolved"]] = None
    """The current status of the insight."""

    subject: Optional[str] = None

    timestamp: Optional[datetime] = None

    user_classification: Optional[Literal["false_positive", "accept_risk", "other"]] = None
    """User-defined classification for the insight.

    Can be 'false_positive', 'accept_risk', 'other', or null.
    """


class IssueListResponse(BaseModel):
    count: Optional[int] = None
    """Indicates the total number of results."""

    issues: Optional[List[Issue]] = None

    page: Optional[int] = None
    """Specifies the current page within paginated list of results."""

    per_page: Optional[int] = None
    """Sets the number of results per page of results."""
