"""
Pydantic models for credoai.

Auto-generated from OpenAPI specification.
"""

from __future__ import annotations

from enum import Enum
from typing import (
    TYPE_CHECKING,
    Any,
    Dict,
    Generic,
    List,
    Literal,
    Optional,
    TypeVar,
    Union,
)

from pydantic import BaseModel, ConfigDict, Field

T = TypeVar("T")


class PaginationInfo(BaseModel):
    """Pagination metadata for navigating through results.

    Attributes:
        next_cursor: Opaque cursor token for fetching the next page.
            None if there are no more results.
        has_more: Whether there are more results available after this page.
    """

    next_cursor: Optional[str] = Field(
        default=None, description="Cursor token for the next page of results"
    )
    has_more: bool = Field(
        default=False, description="Whether more results are available"
    )


class PaginatedResponse(BaseModel, Generic[T]):
    """Generic paginated response wrapper.

    Wraps a list of items with pagination metadata for cursor-based navigation.

    Attributes:
        items: List of items in the current page.
        pagination: Pagination metadata including cursor for next page.
    """

    items: List[T] = Field(description="List of items in the current page")
    pagination: PaginationInfo = Field(description="Pagination metadata")


# Forward references for circular imports
if TYPE_CHECKING:
    pass


# Enums
class WorkflowStageStep(str, Enum):
    """Workflow stage step enumeration for use case progression.

    Defines the allowed values for WorkflowStageStep.
    Available values:
        ASSESSMENT: "assessment"
        EVIDENCE_COLLECTION: "evidence_collection"
        CLEAR: "clear"
        REJECTED: "rejected"
    """

    ASSESSMENT = "assessment"
    EVIDENCE_COLLECTION = "evidence_collection"
    CLEAR = "clear"
    REJECTED = "rejected"


class WorkflowStageType(str, Enum):
    """Workflow stage type enumeration.

    Defines the allowed values for WorkflowStageType.
    Available values:
        START: "start"
        INTERMEDIATE: "intermediate"
        END: "end"
    """

    START = "start"
    INTERMEDIATE = "intermediate"
    END = "end"


# Base models with proper Pydantic configuration
class CustomPolicyControlInfo(BaseModel):
    """Nested info object for custom policy control details.

    Attributes:
        description (Any, optional)
        long_description (Any, optional)
        control_type (Any, optional)
        author (Any, optional)
        implementation_guidance (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    description: Optional[Any] = Field(None)
    long_description: Optional[Any] = Field(None)
    control_type: Optional[Any] = Field(None)
    author: Optional[Any] = Field(None)
    implementation_guidance: Optional[Any] = Field(None)


class EvidenceRequirement(BaseModel):
    """Evidence requirement definition for a policy control.

    Attributes:
        type (str)
        description (Any, optional)
        required (bool, optional): Example: False
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    type: str
    description: Optional[Any] = Field(None)
    required: Optional[bool] = Field(False, description="Example: False")


class HTTPValidationError(BaseModel):
    """

    Attributes:
        detail (List[ValidationError], optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    detail: Optional["List[ValidationError]"] = Field(None)


class HealthResponse(BaseModel):
    """Response model for health check endpoints.

    Attributes:
        message: Boolean indicating the health status (True = healthy).

        Attributes:
            message (bool)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    message: bool


class ModelCreate(BaseModel):
    """Schema for creating a model.

    Attributes:
        name (str)
        summary (Any, optional)
        source (Any, optional)
        questionnaire_ids (List[str], optional)
        status (Any, optional): Example: 'none'
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: str
    summary: Optional[Any] = Field(None)
    source: Optional[Any] = Field(None)
    questionnaire_ids: Optional[List[str]] = Field(None)
    status: Optional[Any] = Field("none", description="Example: 'none'")


class ModelResponse(BaseModel):
    """Schema for a model response.

    Attributes:
        id (str)
        name (str)
        summary (Any, optional)
        source (Any, optional)
        status (str)
        questionnaire_ids (List[str], optional)
        custom (bool, optional): Example: True
        has_use_cases (bool, optional): Example: False
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    name: str
    summary: Optional[Any] = Field(None)
    source: Optional[Any] = Field(None)
    status: str
    questionnaire_ids: Optional[List[str]] = Field(None)
    custom: Optional[bool] = Field(True, description="Example: True")
    has_use_cases: Optional[bool] = Field(False, description="Example: False")


class ModelUpdate(BaseModel):
    """Schema for updating a model.

    Attributes:
        name (Any, optional)
        summary (Any, optional)
        source (Any, optional)
        questionnaire_ids (Any, optional)
        status (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None)
    summary: Optional[Any] = Field(None)
    source: Optional[Any] = Field(None)
    questionnaire_ids: Optional[Any] = Field(None)
    status: Optional[Any] = Field(None)


class PingResponse(BaseModel):
    """

    Attributes:
        message (str)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    message: str


class PolicyControlBaseCreate(BaseModel):
    """Schema for creating a policy control base.

    Attributes:
        id (str): Unique identifier for the policy control base
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str = Field(..., description="Unique identifier for the policy control base")


class PolicyControlBaseResponse(BaseModel):
    """Schema for a policy control base response.

    Attributes:
        id (str)
        archived (Any, optional)
        deprecated (Any, optional)
        ownership_type (Any, optional)
        transferred_at (Any, optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    archived: Optional[Any] = Field(None)
    deprecated: Optional[Any] = Field(None)
    ownership_type: Optional[Any] = Field(None)
    transferred_at: Optional[Any] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class PolicyControlBaseUpdate(BaseModel):
    """Schema for updating a policy control base.

    Attributes:
        archived (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    archived: Optional[Any] = Field(None)


class PolicyControlInfo(BaseModel):
    """Nested info object for policy control details.

    Attributes:
        name (Any, optional)
        description (Any, optional)
        long_description (Any, optional)
        control_type (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None)
    description: Optional[Any] = Field(None)
    long_description: Optional[Any] = Field(None)
    control_type: Optional[Any] = Field(None)


class PolicyControlResponse(BaseModel):
    """Schema for a policy control definition response.

    Attributes:
        key (str)
        version (str)
        info (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    version: str
    info: Optional[Any] = Field(None)


class PolicyControlVersionCreate(BaseModel):
    """Schema for creating a policy control version.

    Attributes:
        draft (bool, optional): Whether this version is a draft. Example: True
        info (Any, optional)
        risk_type_ids (List[str], optional)
        evidence_requirements (List[EvidenceRequirement], optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    draft: Optional[bool] = Field(
        True, description="Whether this version is a draft. Example: True"
    )
    info: Optional[Any] = Field(None)
    risk_type_ids: Optional[List[str]] = Field(None)
    evidence_requirements: Optional[List[EvidenceRequirement]] = Field(None)


class PolicyControlVersionResponse(BaseModel):
    """Schema for a policy control version response.

    Attributes:
        id (str)
        base_id (str)
        version (int)
        draft (bool, optional): Example: True
        info (Any, optional)
        risk_type_ids (List[str], optional)
        evidence_requirements (List[EvidenceRequirement], optional)
        archived (Any, optional)
        deprecated (Any, optional)
        ownership_type (Any, optional)
        transferred_at (Any, optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    base_id: str
    version: int
    draft: Optional[bool] = Field(True, description="Example: True")
    info: Optional[Any] = Field(None)
    risk_type_ids: Optional[List[str]] = Field(None)
    evidence_requirements: Optional[List[EvidenceRequirement]] = Field(None)
    archived: Optional[Any] = Field(None)
    deprecated: Optional[Any] = Field(None)
    ownership_type: Optional[Any] = Field(None)
    transferred_at: Optional[Any] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class PolicyControlVersionUpdate(BaseModel):
    """Schema for updating a policy control version.

    Note: Versions can only be updated when in draft state.

        Attributes:
            draft (Any, optional)
            info (Any, optional)
            risk_type_ids (Any, optional)
            evidence_requirements (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    draft: Optional[Any] = Field(None)
    info: Optional[Any] = Field(None)
    risk_type_ids: Optional[Any] = Field(None)
    evidence_requirements: Optional[Any] = Field(None)


class PolicyPackAttachment(BaseModel):
    """Schema for attaching a policy pack to an entity.

    Attributes:
        key (str)
        version (int)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    version: int


class PolicyPackAttachmentResponse(BaseModel):
    """Schema for a policy pack attachment response.

    Attributes:
        id (str)
        use_case_id (Any, optional)
        entity_id (Any, optional)
        key (str)
        version (int)
        due_date (Any, optional)
        timezone (Any, optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    use_case_id: Optional[Any] = Field(None)
    entity_id: Optional[Any] = Field(None)
    key: str
    version: int
    due_date: Optional[Any] = Field(None)
    timezone: Optional[Any] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class PolicyPackAttachmentUpdate(BaseModel):
    """Schema for updating a policy pack attachment.

    Attributes:
        version (Any, optional)
        due_date (Any, optional)
        timezone (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    version: Optional[Any] = Field(None)
    due_date: Optional[Any] = Field(None)
    timezone: Optional[Any] = Field(None)


class PolicyPackBaseResponse(BaseModel):
    """Schema for a policy pack base response (without version content).

    Attributes:
        id (str)
        key (Any, optional)
        archived (Any, optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    key: Optional[Any] = Field(None)
    archived: Optional[Any] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class PolicyPackCreate(BaseModel):
    """Schema for creating a policy pack base.

    Attributes:
        key (str)
        info (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    info: Optional[Any] = Field(None)


class PolicyPackDuplicate(BaseModel):
    """Schema for duplicating a policy pack.

    Attributes:
        key (str)
        name (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    name: Optional[Any] = Field(None)


class PolicyPackInfo(BaseModel):
    """Nested info object for policy pack details.

    Attributes:
        name (str)
        description (Any, optional)
        company (Any, optional)
        logo_url (Any, optional)
        provider (Any, optional)
        domains (List[str], optional)
        industries (List[str], optional)
        regions (List[str], optional)
        tags (List[str], optional)
        vendor_component (Any, optional)
        contact (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: str
    description: Optional[Any] = Field(None)
    company: Optional[Any] = Field(None)
    logo_url: Optional[Any] = Field(None)
    provider: Optional[Any] = Field(None)
    domains: Optional[List[str]] = Field(None)
    industries: Optional[List[str]] = Field(None)
    regions: Optional[List[str]] = Field(None)
    tags: Optional[List[str]] = Field(None)
    vendor_component: Optional[Any] = Field(None)
    contact: Optional[Any] = Field(None)


class PolicyPackResponse(BaseModel):
    """Schema for a policy pack response.

    Attributes:
        id (str)
        key (str)
        version (int)
        spec (Any, optional)
        kind (Any, optional)
        info (Any, optional)
        controls (List[Dict[str, Any]], optional)
        report_template (Any, optional)
        metadata (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    key: str
    version: int
    spec: Optional[Any] = Field(None)
    kind: Optional[Any] = Field(None)
    info: Optional[Any] = Field(None)
    controls: Optional[List[Dict[str, Any]]] = Field(None)
    report_template: Optional[Any] = Field(None)
    metadata: Optional[Any] = Field(None)


class PolicyPackUpdate(BaseModel):
    """Schema for updating a policy pack base.

    Attributes:
        info (Any, optional)
        archived (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    info: Optional[Any] = Field(None)
    archived: Optional[Any] = Field(None)


class QuestionEvidenceCreate(BaseModel):
    """Schema for creating question evidence.

    Attributes:
        question_id (str)
        questionnaire_id (str)
        section_id (str)
        value (Any)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    question_id: str
    questionnaire_id: str
    section_id: str
    value: Any


class QuestionEvidenceUpdate(BaseModel):
    """Schema for updating question evidence.

    Attributes:
        questionnaire_id (str)
        section_id (str)
        question_id (str)
        value (Any)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    questionnaire_id: str
    section_id: str
    question_id: str
    value: Any


class QuestionnaireAttachment(BaseModel):
    """Schema for attaching a questionnaire to an entity.

    Attributes:
        key (str)
        version (int)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    version: int


class QuestionnaireAttachmentResponse(BaseModel):
    """Schema for a questionnaire attachment response.

    Attributes:
        id (str)
        use_case_id (Any, optional)
        vendor_id (Any, optional)
        model_id (Any, optional)
        entity_id (Any, optional)
        key (str)
        version (int)
        due_date (Any, optional)
        timezone (Any, optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    use_case_id: Optional[Any] = Field(None)
    vendor_id: Optional[Any] = Field(None)
    model_id: Optional[Any] = Field(None)
    entity_id: Optional[Any] = Field(None)
    key: str
    version: int
    due_date: Optional[Any] = Field(None)
    timezone: Optional[Any] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class QuestionnaireAttachmentUpdate(BaseModel):
    """Schema for updating a questionnaire attachment.

    Attributes:
        version (Any, optional)
        due_date (Any, optional)
        timezone (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    version: Optional[Any] = Field(None)
    due_date: Optional[Any] = Field(None)
    timezone: Optional[Any] = Field(None)


class QuestionnaireBaseResponse(BaseModel):
    """Schema for a questionnaire base response (without version content).

    Attributes:
        id (str)
        key (Any, optional)
        name (str)
        target (Any, optional)
        archived (Any, optional)
        show_on_create (bool, optional): Example: False
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    key: Optional[Any] = Field(None)
    name: str
    target: Optional[Any] = Field(None)
    archived: Optional[Any] = Field(None)
    show_on_create: Optional[bool] = Field(False, description="Example: False")
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class QuestionnaireCreate(BaseModel):
    """Schema for creating a questionnaire base.

    Attributes:
        key (str)
        name (str)
        target (str)
        info (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    name: str
    target: str
    info: Optional[Any] = Field(None)


class QuestionnaireDuplicate(BaseModel):
    """Schema for duplicating a questionnaire.

    Attributes:
        key (str)
        name (str)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    key: str
    name: str


class QuestionnaireInfo(BaseModel):
    """Nested info object for questionnaire metadata.

    Attributes:
        description (Any, optional)
        introduction (Any, optional)
        logo_url (Any, optional)
        show_on_create (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    description: Optional[Any] = Field(None)
    introduction: Optional[Any] = Field(None)
    logo_url: Optional[Any] = Field(None)
    show_on_create: Optional[Any] = Field(None)


class QuestionnaireResponse(BaseModel):
    """Schema for a questionnaire response.

    Attributes:
        id (str)
        key (str)
        name (str)
        description (Any, optional)
        version (int)
        target (Any, optional)
        is_published (bool, optional): Example: False
        sections (List[Dict[str, Any]], optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    key: str
    name: str
    description: Optional[Any] = Field(None)
    version: int
    target: Optional[Any] = Field(None)
    is_published: Optional[bool] = Field(False, description="Example: False")
    sections: Optional[List[Dict[str, Any]]] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class QuestionnaireUpdate(BaseModel):
    """Schema for updating a questionnaire base.

    Attributes:
        name (Any, optional)
        archived (Any, optional)
        info (Any, optional)
        show_on_create (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None)
    archived: Optional[Any] = Field(None)
    info: Optional[Any] = Field(None)
    show_on_create: Optional[Any] = Field(None)


class RelationshipAdd(BaseModel):
    """Schema for adding a relationship to an entity.

    Attributes:
        id (str): ID of the entity to add to the relationship
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str = Field(..., description="ID of the entity to add to the relationship")


class RiskControlLinkCreate(BaseModel):
    """Schema for creating a risk control link.

    Attributes:
        risk_id (str): ID of the use case risk scenario
        control_key (str): Key of the policy control to link
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    risk_id: str = Field(..., description="ID of the use case risk scenario")
    control_key: str = Field(..., description="Key of the policy control to link")


class RiskControlLinkResponse(BaseModel):
    """Schema for a risk control link response.

    Attributes:
        id (str): Unique identifier for the link
        use_case_id (str): Parent use case ID
        risk_id (str): ID of the use case risk scenario
        control_key (str): Key of the linked policy control
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str = Field(..., description="Unique identifier for the link")
    use_case_id: str = Field(..., description="Parent use case ID")
    risk_id: str = Field(..., description="ID of the use case risk scenario")
    control_key: str = Field(..., description="Key of the linked policy control")


class RiskScenarioResponse(BaseModel):
    """Schema for a risk scenario (library) response.

    Attributes:
        id (str): Unique identifier for the risk scenario
        name (str): Name of the risk scenario
        description (Any, optional): Description of the risk scenario
        risk_type_ids (List[str], optional): Associated risk type IDs
        author (str, optional): Author of the risk scenario. Example: ''
        domains (List[str], optional): Applicable domains
        industries (List[str], optional): Applicable industries
        regions (List[str], optional): Applicable regions
        ownership_type (str, optional): Ownership type (e.g., 'ootb', 'custom'). Example: ''
        archived (Any, optional): Whether the scenario is archived
        deprecated (Any, optional): Whether the scenario is deprecated
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str = Field(..., description="Unique identifier for the risk scenario")
    name: str = Field(..., description="Name of the risk scenario")
    description: Optional[Any] = Field(
        None, description="Description of the risk scenario"
    )
    risk_type_ids: Optional[List[str]] = Field(
        None, description="Associated risk type IDs"
    )
    author: Optional[str] = Field(
        "", description="Author of the risk scenario. Example: ''"
    )
    domains: Optional[List[str]] = Field(None, description="Applicable domains")
    industries: Optional[List[str]] = Field(None, description="Applicable industries")
    regions: Optional[List[str]] = Field(None, description="Applicable regions")
    ownership_type: Optional[str] = Field(
        "", description="Ownership type (e.g., 'ootb', 'custom'). Example: ''"
    )
    archived: Optional[Any] = Field(
        None, description="Whether the scenario is archived"
    )
    deprecated: Optional[Any] = Field(
        None, description="Whether the scenario is deprecated"
    )


class RiskTypeCreate(BaseModel):
    """Schema for creating a custom risk type.

    Attributes:
        name (str): Name of the risk type
        description (str, optional): Description of the risk type. Example: ''
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: str = Field(..., description="Name of the risk type")
    description: Optional[str] = Field(
        "", description="Description of the risk type. Example: ''"
    )


class RiskTypeResponse(BaseModel):
    """Schema for a risk type response.

    Attributes:
        id (str): Unique identifier for the risk type
        name (str): Name of the risk type
        description (Any, optional): Description of the risk type
        custom (bool, optional): Whether this is a custom (tenant-created) risk type. Example: False
        hidden (bool, optional): Whether this risk type is hidden. Example: False
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str = Field(..., description="Unique identifier for the risk type")
    name: str = Field(..., description="Name of the risk type")
    description: Optional[Any] = Field(None, description="Description of the risk type")
    custom: Optional[bool] = Field(
        False,
        description="Whether this is a custom (tenant-created) risk type. Example: False",
    )
    hidden: Optional[bool] = Field(
        False, description="Whether this risk type is hidden. Example: False"
    )


class RiskTypeUpdate(BaseModel):
    """Schema for updating a risk type.

    For custom risk types: name and description can be updated.
    For OOTB risk types: only hidden can be updated.

        Attributes:
            name (Any, optional): Name of the risk type
            description (Any, optional): Description of the risk type
            hidden (Any, optional): Whether the risk type is hidden
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None, description="Name of the risk type")
    description: Optional[Any] = Field(None, description="Description of the risk type")
    hidden: Optional[Any] = Field(None, description="Whether the risk type is hidden")


class TokenResponse(BaseModel):
    """Response model for token exchange.

    Attributes:
        access_token (Any)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    access_token: Any


class UseCaseControlCompliance(BaseModel):
    """Compliance information for a use case control.

    Attributes:
        id (str)
        key (Any, optional)
        status (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    key: Optional[Any] = Field(None)
    status: Optional[Any] = Field(None)


class UseCaseControlResponse(BaseModel):
    """Schema for a control attached to a use case.

    Attributes:
        id (str)
        use_case_id (str)
        control_key (str)
        policy_pack_key (Any, optional)
        control_version (int)
        status (Any, optional)
        due_date (Any, optional)
        timezone (Any, optional)
        compliances (List[UseCaseControlCompliance], optional)
        inserted_at (Any, optional)
        updated_at (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    use_case_id: str
    control_key: str
    policy_pack_key: Optional[Any] = Field(None)
    control_version: int
    status: Optional[Any] = Field(None)
    due_date: Optional[Any] = Field(None)
    timezone: Optional[Any] = Field(None)
    compliances: Optional[List[UseCaseControlCompliance]] = Field(None)
    inserted_at: Optional[Any] = Field(None)
    updated_at: Optional[Any] = Field(None)


class UseCaseControlUpdate(BaseModel):
    """Schema for updating a use case control.

    Attributes:
        due_date (Any, optional)
        timezone (Any, optional)
        user_ids (Any, optional)
        team_ids (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    due_date: Optional[Any] = Field(None)
    timezone: Optional[Any] = Field(None)
    user_ids: Optional[Any] = Field(None)
    team_ids: Optional[Any] = Field(None)


class UseCaseCreate(BaseModel):
    """Schema for creating a use case.

    Attributes:
        name (str)
        description (str, optional): Example: ''
        questionnaire_ids (List[str], optional)
        custom_fields (List[UseCaseCustomField], optional)
        questions (List[QuestionEvidenceCreate], optional)
        source (Any, optional)
        user (str, optional): Example: ''
        owner (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: str
    description: Optional[str] = Field("", description="Example: ''")
    questionnaire_ids: Optional[List[str]] = Field(None)
    custom_fields: Optional["List[UseCaseCustomField]"] = Field(None)
    questions: Optional["List[QuestionEvidenceCreate]"] = Field(None)
    source: Optional[Any] = Field(None)
    user: Optional[str] = Field("", description="Example: ''")
    owner: Optional[Any] = Field(None)


class UseCaseCustomField(BaseModel):
    """Schema for a use case custom field.

    Attributes:
        custom_field_id (str)
        value (Any)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    custom_field_id: str
    value: Any


class UseCaseResponse(BaseModel):
    """Schema for a use case response.

    Attributes:
        id (str)
        name (str)
        description (Any, optional): Example: ''
        questionnaire_ids (List[str])
        creator_id (Any, optional)
        workflow_stage_id (Any, optional)
        workflow_stage_step (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    name: str
    description: Optional[Any] = Field("", description="Example: ''")
    questionnaire_ids: List[str]
    creator_id: Optional[Any] = Field(None)
    workflow_stage_id: Optional[Any] = Field(None)
    workflow_stage_step: Optional[Any] = Field(None)


class UseCaseRiskScenarioCreate(BaseModel):
    """Schema for creating a use case risk scenario.

    Either risk_scenario_id (to link from library) or name (for ad-hoc)
    should be provided.

        Attributes:
            risk_scenario_id (Any, optional): ID of a library risk scenario to link from
            name (Any, optional): Name for an ad-hoc risk scenario
            description (Any, optional): Description of the risk scenario
            risk_type_ids (List[str], optional): Associated risk type IDs
            inherent_risk_likelihood (Any, optional): Inherent risk likelihood (1-5)
            inherent_risk_impact (Any, optional): Inherent risk impact (1-5)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    risk_scenario_id: Optional[Any] = Field(
        None, description="ID of a library risk scenario to link from"
    )
    name: Optional[Any] = Field(None, description="Name for an ad-hoc risk scenario")
    description: Optional[Any] = Field(
        None, description="Description of the risk scenario"
    )
    risk_type_ids: Optional[List[str]] = Field(
        None, description="Associated risk type IDs"
    )
    inherent_risk_likelihood: Optional[Any] = Field(
        None, description="Inherent risk likelihood (1-5)"
    )
    inherent_risk_impact: Optional[Any] = Field(
        None, description="Inherent risk impact (1-5)"
    )


class UseCaseRiskScenarioResponse(BaseModel):
    """Schema for a use case risk scenario response.

    Attributes:
        id (str): Unique identifier
        use_case_id (str): Parent use case ID
        risk_scenario_id (Any, optional): Linked library risk scenario ID
        name (str): Name of the risk scenario
        description (str, optional): Description of the risk scenario. Example: ''
        risk_type_ids (List[str], optional): Associated risk type IDs
        inherent_risk_likelihood (Any, optional): Inherent risk likelihood (1-5)
        inherent_risk_impact (Any, optional): Inherent risk impact (1-5)
        residual_risk_likelihood (Any, optional): Residual risk likelihood (1-5)
        residual_risk_impact (Any, optional): Residual risk impact (1-5)
        inherent_risk (str, optional): Computed inherent risk level (unknown|low|medium|high). Example: 'unknown'
        residual_risk (str, optional): Computed residual risk level (unknown|low|medium|high). Example: 'unknown'
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str = Field(..., description="Unique identifier")
    use_case_id: str = Field(..., description="Parent use case ID")
    risk_scenario_id: Optional[Any] = Field(
        None, description="Linked library risk scenario ID"
    )
    name: str = Field(..., description="Name of the risk scenario")
    description: Optional[str] = Field(
        "", description="Description of the risk scenario. Example: ''"
    )
    risk_type_ids: Optional[List[str]] = Field(
        None, description="Associated risk type IDs"
    )
    inherent_risk_likelihood: Optional[Any] = Field(
        None, description="Inherent risk likelihood (1-5)"
    )
    inherent_risk_impact: Optional[Any] = Field(
        None, description="Inherent risk impact (1-5)"
    )
    residual_risk_likelihood: Optional[Any] = Field(
        None, description="Residual risk likelihood (1-5)"
    )
    residual_risk_impact: Optional[Any] = Field(
        None, description="Residual risk impact (1-5)"
    )
    inherent_risk: Optional[str] = Field(
        "unknown",
        description="Computed inherent risk level (unknown|low|medium|high). Example: 'unknown'",
    )
    residual_risk: Optional[str] = Field(
        "unknown",
        description="Computed residual risk level (unknown|low|medium|high). Example: 'unknown'",
    )


class UseCaseRiskScenarioUpdate(BaseModel):
    """Schema for updating a use case risk scenario.

    Attributes:
        name (Any, optional): Name of the risk scenario
        description (Any, optional): Description of the risk scenario
        risk_type_ids (Any, optional): Associated risk type IDs
        inherent_risk_likelihood (Any, optional): Inherent risk likelihood (1-5)
        inherent_risk_impact (Any, optional): Inherent risk impact (1-5)
        residual_risk_likelihood (Any, optional): Residual risk likelihood (1-5)
        residual_risk_impact (Any, optional): Residual risk impact (1-5)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None, description="Name of the risk scenario")
    description: Optional[Any] = Field(
        None, description="Description of the risk scenario"
    )
    risk_type_ids: Optional[Any] = Field(None, description="Associated risk type IDs")
    inherent_risk_likelihood: Optional[Any] = Field(
        None, description="Inherent risk likelihood (1-5)"
    )
    inherent_risk_impact: Optional[Any] = Field(
        None, description="Inherent risk impact (1-5)"
    )
    residual_risk_likelihood: Optional[Any] = Field(
        None, description="Residual risk likelihood (1-5)"
    )
    residual_risk_impact: Optional[Any] = Field(
        None, description="Residual risk impact (1-5)"
    )


class UseCaseUpdate(BaseModel):
    """Schema for updating a use case.

    Attributes:
        name (Any, optional)
        description (Any, optional)
        custom_fields (List[UseCaseCustomField], optional)
        questions (List[QuestionEvidenceUpdate], optional)
        source (Any, optional)
        user (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None)
    description: Optional[Any] = Field(None)
    custom_fields: Optional["List[UseCaseCustomField]"] = Field(None)
    questions: Optional["List[QuestionEvidenceUpdate]"] = Field(None)
    source: Optional[Any] = Field(None)
    user: Optional[Any] = Field(None)


class UseCaseWorkflowResponse(BaseModel):
    """Schema for use case workflow status response.

    Attributes:
        use_case_id (str)
        workflow_stage_id (Any, optional)
        workflow_stage_step (Any, optional)
        workflow_stage (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    use_case_id: str
    workflow_stage_id: Optional[Any] = Field(None)
    workflow_stage_step: Optional[Any] = Field(None)
    workflow_stage: Optional[Any] = Field(None)


class UseCaseWorkflowUpdate(BaseModel):
    """Schema for updating a use case's workflow stage and step.

    Attributes:
        workflow_stage_id (str): ID of the workflow stage to move the use case to
        workflow_stage_step (Any, optional): Step within the workflow stage
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    workflow_stage_id: str = Field(
        ..., description="ID of the workflow stage to move the use case to"
    )
    workflow_stage_step: Optional[Any] = Field(
        None, description="Step within the workflow stage"
    )


class ValidationError(BaseModel):
    """

    Attributes:
        loc (List[Any])
        msg (str)
        type (str)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    loc: List[Any]
    msg: str
    type: str


class VendorCreate(BaseModel):
    """Schema for creating a vendor.

    Attributes:
        name (str)
        description (Any, optional)
        questionnaire_ids (List[str], optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: str
    description: Optional[Any] = Field(None)
    questionnaire_ids: Optional[List[str]] = Field(None)


class VendorResponse(BaseModel):
    """Schema for a vendor response.

    Attributes:
        id (str)
        name (str)
        description (Any, optional)
        status (str, optional): Example: 'none'
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    name: str
    description: Optional[Any] = Field(None)
    status: Optional[str] = Field("none", description="Example: 'none'")


class VendorUpdate(BaseModel):
    """Schema for updating a vendor.

    Attributes:
        name (Any, optional)
        description (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None)
    description: Optional[Any] = Field(None)


class WorkflowStageCreate(BaseModel):
    """Schema for creating a workflow stage.

    Note: Only intermediate stages can be created via the API.
    Start and end stages are system-managed.

        Attributes:
            name (str)
            description (Any, optional)
            assessment_required (bool, optional): Example: False
            evidence_collection_required (bool, optional): Example: False
            parent_id (str): ID of the parent stage (new stage will be inserted after this)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: str
    description: Optional[Any] = Field(None)
    assessment_required: Optional[bool] = Field(False, description="Example: False")
    evidence_collection_required: Optional[bool] = Field(
        False, description="Example: False"
    )
    parent_id: str = Field(
        ...,
        description="ID of the parent stage (new stage will be inserted after this)",
    )


class WorkflowStageResponse(BaseModel):
    """Schema for a workflow stage response.

    Attributes:
        id (str)
        name (str)
        description (Any, optional)
        type (WorkflowStageType)
        assessment_required (bool, optional): Example: False
        evidence_collection_required (bool, optional): Example: False
        parent_id (Any, optional)
        child_id (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    id: str
    name: str
    description: Optional[Any] = Field(None)
    type: WorkflowStageType
    assessment_required: Optional[bool] = Field(False, description="Example: False")
    evidence_collection_required: Optional[bool] = Field(
        False, description="Example: False"
    )
    parent_id: Optional[Any] = Field(None)
    child_id: Optional[Any] = Field(None)


class WorkflowStageUpdate(BaseModel):
    """Schema for updating a workflow stage.

    Note: Stage type cannot be changed after creation.
    Start and end stages cannot be modified.

        Attributes:
            name (Any, optional)
            description (Any, optional)
            assessment_required (Any, optional)
            evidence_collection_required (Any, optional)
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    name: Optional[Any] = Field(None)
    description: Optional[Any] = Field(None)
    assessment_required: Optional[Any] = Field(None)
    evidence_collection_required: Optional[Any] = Field(None)


class PaginatedResponse_ModelResponse_(BaseModel):
    """

    Attributes:
        items (List[ModelResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[ModelResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_PolicyControlBaseResponse_(BaseModel):
    """

    Attributes:
        items (List[PolicyControlBaseResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[PolicyControlBaseResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_PolicyControlResponse_(BaseModel):
    """

    Attributes:
        items (List[PolicyControlResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[PolicyControlResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_PolicyControlVersionResponse_(BaseModel):
    """

    Attributes:
        items (List[PolicyControlVersionResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[PolicyControlVersionResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_PolicyPackAttachmentResponse_(BaseModel):
    """

    Attributes:
        items (List[PolicyPackAttachmentResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[PolicyPackAttachmentResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_PolicyPackResponse_(BaseModel):
    """

    Attributes:
        items (List[PolicyPackResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[PolicyPackResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_QuestionnaireAttachmentResponse_(BaseModel):
    """

    Attributes:
        items (List[QuestionnaireAttachmentResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[QuestionnaireAttachmentResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_QuestionnaireResponse_(BaseModel):
    """

    Attributes:
        items (List[QuestionnaireResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[QuestionnaireResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_RiskControlLinkResponse_(BaseModel):
    """

    Attributes:
        items (List[RiskControlLinkResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[RiskControlLinkResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_RiskScenarioResponse_(BaseModel):
    """

    Attributes:
        items (List[RiskScenarioResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[RiskScenarioResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_RiskTypeResponse_(BaseModel):
    """

    Attributes:
        items (List[RiskTypeResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[RiskTypeResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_UseCaseControlResponse_(BaseModel):
    """

    Attributes:
        items (List[UseCaseControlResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[UseCaseControlResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_UseCaseResponse_(BaseModel):
    """

    Attributes:
        items (List[UseCaseResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[UseCaseResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_UseCaseRiskScenarioResponse_(BaseModel):
    """

    Attributes:
        items (List[UseCaseRiskScenarioResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[UseCaseRiskScenarioResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_VendorResponse_(BaseModel):
    """

    Attributes:
        items (List[VendorResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[VendorResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


class PaginatedResponse_WorkflowStageResponse_(BaseModel):
    """

    Attributes:
        items (List[WorkflowStageResponse]): List of items in the current page
        pagination (PaginationInfo): Pagination metadata
    """

    model_config = ConfigDict(
        extra="ignore",
        validate_assignment=True,
        use_enum_values=True,
        populate_by_name=True,
    )
    items: List[WorkflowStageResponse] = Field(
        ..., description="List of items in the current page"
    )
    pagination: PaginationInfo = Field(..., description="Pagination metadata")


# JSON:API Resource models for structured client responses
class JsonApiResourceBase(BaseModel):
    """Base class for JSON:API resource responses.

    This follows the JSON:API specification (https://jsonapi.org/) for
    consistent resource representation across the API.

    Attributes:
        id: Unique resource identifier
        type: Resource type identifier (e.g., "use_cases", "users")
    """

    model_config = ConfigDict(extra="ignore", validate_assignment=True)

    id: str = Field(..., description="Unique resource identifier")
    type: str = Field(..., description="Resource type identifier")


class JsonApiUseCaseResource(JsonApiResourceBase):
    """JSON:API formatted use case resource.

    Represents a use case resource in JSON:API format with type-safe attributes.
    """

    type: Literal["use_cases"] = "use_cases"
    attributes: "UseCaseResponse" = Field(..., description="Use case data attributes")


class JsonApiUserResource(JsonApiResourceBase):
    """JSON:API formatted user resource.

    Represents a user resource in JSON:API format.
    """

    type: Literal["users"] = "users"
    attributes: Dict[str, Any] = Field(..., description="User data attributes")


class JsonApiResponse(BaseModel):
    """Standard JSON:API response wrapper.

    Provides a consistent structure for all API responses following the
    JSON:API specification. Supports both single resources and collections.

    Attributes:
        data: Primary response data (single resource or array of resources)
        included: Optional included resources for compound documents
        meta: Optional metadata about the response
    """

    model_config = ConfigDict(extra="ignore")

    data: Union[Dict[str, Any], List[Dict[str, Any]]] = Field(
        ..., description="Primary response data"
    )
    included: Optional[List[Dict[str, Any]]] = Field(
        None, description="Included resources for compound documents"
    )
    meta: Optional[Dict[str, Any]] = Field(
        None, description="Non-standard metadata about the response"
    )


# Client request/response wrappers with validation
class ClientRequest(BaseModel):
    """Base class for client requests with validation and JSON:API support.

    This base class provides common functionality for all API request models,
    including validation, serialization, and JSON:API format conversion.

    Methods:
        to_dict(): Convert to dictionary for API requests
        to_jsonapi(): Convert to JSON:API format for requests
    """

    model_config = ConfigDict(
        extra="forbid", validate_assignment=True, use_enum_values=True
    )

    def to_dict(self) -> Dict[str, Any]:
        """Convert to dictionary for API requests.

        Returns:
            Dict representation excluding unset values and using field aliases.
        """
        return self.model_dump(exclude_unset=True, by_alias=True)

    def to_jsonapi(self) -> Dict[str, Any]:
        """Convert to JSON:API format for requests.

        Returns:
            JSON:API formatted request body with data and type fields.
        """
        return {
            "data": {"type": self._get_resource_type(), "attributes": self.to_dict()}
        }

    def _get_resource_type(self) -> str:
        """Get the JSON:API resource type.

        Override in subclasses to provide the correct resource type.

        Returns:
            Resource type string for JSON:API format.
        """
        return "unknown"


class ClientResponse(BaseModel):
    """Base class for client responses with metadata.

    Provides a consistent structure for all API response wrappers,
    including status information and request tracing.

    Attributes:
        status_code: HTTP status code from the response
        headers: Response headers as a dictionary
        request_id: Optional request ID for distributed tracing
    """

    model_config = ConfigDict(extra="allow", validate_assignment=True)

    status_code: int = Field(..., description="HTTP response status code")
    headers: Dict[str, str] = Field(
        default_factory=dict, description="HTTP response headers"
    )
    request_id: Optional[str] = Field(
        None, description="Unique request identifier for tracing"
    )

    @classmethod
    def from_httpx_response(cls, response, data: Any = None):
        """Create ClientResponse from httpx Response object.

        Args:
            response: httpx Response object
            data: Optional response data to include

        Returns:
            ClientResponse instance with metadata from the HTTP response.
        """
        return cls(
            status_code=response.status_code,
            headers=dict(response.headers),
            request_id=response.headers.get("X-Request-ID"),
            **{"data": data} if data is not None else {},
        )


# Typed request classes for each endpoint
class ModelCreateRequest(ClientRequest, ModelCreate):
    """Request wrapper for ModelCreate with validation and JSON:API support.

    Combines the ModelCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return "model_cases" if "UseCase" in "ModelCreate" else "models"


class PolicyControlBaseCreateRequest(ClientRequest, PolicyControlBaseCreate):
    """Request wrapper for PolicyControlBaseCreate with validation and JSON:API support.

    Combines the PolicyControlBaseCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "policycontrolbase_cases"
            if "UseCase" in "PolicyControlBaseCreate"
            else "policycontrolbases"
        )


class PolicyControlVersionCreateRequest(ClientRequest, PolicyControlVersionCreate):
    """Request wrapper for PolicyControlVersionCreate with validation and JSON:API support.

    Combines the PolicyControlVersionCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "policycontrolversion_cases"
            if "UseCase" in "PolicyControlVersionCreate"
            else "policycontrolversions"
        )


class PolicyPackCreateRequest(ClientRequest, PolicyPackCreate):
    """Request wrapper for PolicyPackCreate with validation and JSON:API support.

    Combines the PolicyPackCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return "policypack_cases" if "UseCase" in "PolicyPackCreate" else "policypacks"


class QuestionEvidenceCreateRequest(ClientRequest, QuestionEvidenceCreate):
    """Request wrapper for QuestionEvidenceCreate with validation and JSON:API support.

    Combines the QuestionEvidenceCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "questionevidence_cases"
            if "UseCase" in "QuestionEvidenceCreate"
            else "questionevidences"
        )


class QuestionnaireCreateRequest(ClientRequest, QuestionnaireCreate):
    """Request wrapper for QuestionnaireCreate with validation and JSON:API support.

    Combines the QuestionnaireCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "questionnaire_cases"
            if "UseCase" in "QuestionnaireCreate"
            else "questionnaires"
        )


class RiskControlLinkCreateRequest(ClientRequest, RiskControlLinkCreate):
    """Request wrapper for RiskControlLinkCreate with validation and JSON:API support.

    Combines the RiskControlLinkCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "riskcontrollink_cases"
            if "UseCase" in "RiskControlLinkCreate"
            else "riskcontrollinks"
        )


class RiskTypeCreateRequest(ClientRequest, RiskTypeCreate):
    """Request wrapper for RiskTypeCreate with validation and JSON:API support.

    Combines the RiskTypeCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return "risktype_cases" if "UseCase" in "RiskTypeCreate" else "risktypes"


class UseCaseCreateRequest(ClientRequest, UseCaseCreate):
    """Request wrapper for UseCaseCreate with validation and JSON:API support.

    Combines the UseCaseCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return "usecase_cases" if "UseCase" in "UseCaseCreate" else "usecases"


class UseCaseRiskScenarioCreateRequest(ClientRequest, UseCaseRiskScenarioCreate):
    """Request wrapper for UseCaseRiskScenarioCreate with validation and JSON:API support.

    Combines the UseCaseRiskScenarioCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "usecaseriskscenario_cases"
            if "UseCase" in "UseCaseRiskScenarioCreate"
            else "usecaseriskscenarios"
        )


class VendorCreateRequest(ClientRequest, VendorCreate):
    """Request wrapper for VendorCreate with validation and JSON:API support.

    Combines the VendorCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return "vendor_cases" if "UseCase" in "VendorCreate" else "vendors"


class WorkflowStageCreateRequest(ClientRequest, WorkflowStageCreate):
    """Request wrapper for WorkflowStageCreate with validation and JSON:API support.

    Combines the WorkflowStageCreate data model with client request functionality,
    providing automatic validation and JSON:API format conversion for API requests.
    """

    def _get_resource_type(self) -> str:
        """Get the appropriate JSON:API resource type for this request.

        Returns:
            Resource type string for JSON:API format.
        """
        return (
            "workflowstage_cases"
            if "UseCase" in "WorkflowStageCreate"
            else "workflowstages"
        )


# Typed response classes for each endpoint
class HealthResponseWrapper(ClientResponse):
    """Response wrapper for HealthResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to HealthResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as HealthResponse
        health: Convenience property to access the data
    """

    data: HealthResponse = Field(..., description="Validated response data")

    @property
    def health(self) -> HealthResponse:
        """Convenience property to access the main response data.

        Returns:
            The HealthResponse data from the response.
        """
        return self.data


class ModelResponseWrapper(ClientResponse):
    """Response wrapper for ModelResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to ModelResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as ModelResponse
        model: Convenience property to access the data
    """

    data: ModelResponse = Field(..., description="Validated response data")

    @property
    def model(self) -> ModelResponse:
        """Convenience property to access the main response data.

        Returns:
            The ModelResponse data from the response.
        """
        return self.data


class PingResponseWrapper(ClientResponse):
    """Response wrapper for PingResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PingResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PingResponse
        ping: Convenience property to access the data
    """

    data: PingResponse = Field(..., description="Validated response data")

    @property
    def ping(self) -> PingResponse:
        """Convenience property to access the main response data.

        Returns:
            The PingResponse data from the response.
        """
        return self.data


class PolicyControlBaseResponseWrapper(ClientResponse):
    """Response wrapper for PolicyControlBaseResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PolicyControlBaseResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PolicyControlBaseResponse
        policycontrolbase: Convenience property to access the data
    """

    data: PolicyControlBaseResponse = Field(..., description="Validated response data")

    @property
    def policycontrolbase(self) -> PolicyControlBaseResponse:
        """Convenience property to access the main response data.

        Returns:
            The PolicyControlBaseResponse data from the response.
        """
        return self.data


class PolicyControlResponseWrapper(ClientResponse):
    """Response wrapper for PolicyControlResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PolicyControlResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PolicyControlResponse
        policycontrol: Convenience property to access the data
    """

    data: PolicyControlResponse = Field(..., description="Validated response data")

    @property
    def policycontrol(self) -> PolicyControlResponse:
        """Convenience property to access the main response data.

        Returns:
            The PolicyControlResponse data from the response.
        """
        return self.data


class PolicyControlVersionResponseWrapper(ClientResponse):
    """Response wrapper for PolicyControlVersionResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PolicyControlVersionResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PolicyControlVersionResponse
        policycontrolversion: Convenience property to access the data
    """

    data: PolicyControlVersionResponse = Field(
        ..., description="Validated response data"
    )

    @property
    def policycontrolversion(self) -> PolicyControlVersionResponse:
        """Convenience property to access the main response data.

        Returns:
            The PolicyControlVersionResponse data from the response.
        """
        return self.data


class PolicyPackAttachmentResponseWrapper(ClientResponse):
    """Response wrapper for PolicyPackAttachmentResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PolicyPackAttachmentResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PolicyPackAttachmentResponse
        policypackattachment: Convenience property to access the data
    """

    data: PolicyPackAttachmentResponse = Field(
        ..., description="Validated response data"
    )

    @property
    def policypackattachment(self) -> PolicyPackAttachmentResponse:
        """Convenience property to access the main response data.

        Returns:
            The PolicyPackAttachmentResponse data from the response.
        """
        return self.data


class PolicyPackBaseResponseWrapper(ClientResponse):
    """Response wrapper for PolicyPackBaseResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PolicyPackBaseResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PolicyPackBaseResponse
        policypackbase: Convenience property to access the data
    """

    data: PolicyPackBaseResponse = Field(..., description="Validated response data")

    @property
    def policypackbase(self) -> PolicyPackBaseResponse:
        """Convenience property to access the main response data.

        Returns:
            The PolicyPackBaseResponse data from the response.
        """
        return self.data


class PolicyPackResponseWrapper(ClientResponse):
    """Response wrapper for PolicyPackResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to PolicyPackResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as PolicyPackResponse
        policypack: Convenience property to access the data
    """

    data: PolicyPackResponse = Field(..., description="Validated response data")

    @property
    def policypack(self) -> PolicyPackResponse:
        """Convenience property to access the main response data.

        Returns:
            The PolicyPackResponse data from the response.
        """
        return self.data


class QuestionnaireAttachmentResponseWrapper(ClientResponse):
    """Response wrapper for QuestionnaireAttachmentResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to QuestionnaireAttachmentResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as QuestionnaireAttachmentResponse
        questionnaireattachment: Convenience property to access the data
    """

    data: QuestionnaireAttachmentResponse = Field(
        ..., description="Validated response data"
    )

    @property
    def questionnaireattachment(self) -> QuestionnaireAttachmentResponse:
        """Convenience property to access the main response data.

        Returns:
            The QuestionnaireAttachmentResponse data from the response.
        """
        return self.data


class QuestionnaireBaseResponseWrapper(ClientResponse):
    """Response wrapper for QuestionnaireBaseResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to QuestionnaireBaseResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as QuestionnaireBaseResponse
        questionnairebase: Convenience property to access the data
    """

    data: QuestionnaireBaseResponse = Field(..., description="Validated response data")

    @property
    def questionnairebase(self) -> QuestionnaireBaseResponse:
        """Convenience property to access the main response data.

        Returns:
            The QuestionnaireBaseResponse data from the response.
        """
        return self.data


class QuestionnaireResponseWrapper(ClientResponse):
    """Response wrapper for QuestionnaireResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to QuestionnaireResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as QuestionnaireResponse
        questionnaire: Convenience property to access the data
    """

    data: QuestionnaireResponse = Field(..., description="Validated response data")

    @property
    def questionnaire(self) -> QuestionnaireResponse:
        """Convenience property to access the main response data.

        Returns:
            The QuestionnaireResponse data from the response.
        """
        return self.data


class RiskControlLinkResponseWrapper(ClientResponse):
    """Response wrapper for RiskControlLinkResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to RiskControlLinkResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as RiskControlLinkResponse
        riskcontrollink: Convenience property to access the data
    """

    data: RiskControlLinkResponse = Field(..., description="Validated response data")

    @property
    def riskcontrollink(self) -> RiskControlLinkResponse:
        """Convenience property to access the main response data.

        Returns:
            The RiskControlLinkResponse data from the response.
        """
        return self.data


class RiskScenarioResponseWrapper(ClientResponse):
    """Response wrapper for RiskScenarioResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to RiskScenarioResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as RiskScenarioResponse
        riskscenario: Convenience property to access the data
    """

    data: RiskScenarioResponse = Field(..., description="Validated response data")

    @property
    def riskscenario(self) -> RiskScenarioResponse:
        """Convenience property to access the main response data.

        Returns:
            The RiskScenarioResponse data from the response.
        """
        return self.data


class RiskTypeResponseWrapper(ClientResponse):
    """Response wrapper for RiskTypeResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to RiskTypeResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as RiskTypeResponse
        risktype: Convenience property to access the data
    """

    data: RiskTypeResponse = Field(..., description="Validated response data")

    @property
    def risktype(self) -> RiskTypeResponse:
        """Convenience property to access the main response data.

        Returns:
            The RiskTypeResponse data from the response.
        """
        return self.data


class TokenResponseWrapper(ClientResponse):
    """Response wrapper for TokenResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to TokenResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as TokenResponse
        token: Convenience property to access the data
    """

    data: TokenResponse = Field(..., description="Validated response data")

    @property
    def token(self) -> TokenResponse:
        """Convenience property to access the main response data.

        Returns:
            The TokenResponse data from the response.
        """
        return self.data


class UseCaseControlResponseWrapper(ClientResponse):
    """Response wrapper for UseCaseControlResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to UseCaseControlResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as UseCaseControlResponse
        usecasecontrol: Convenience property to access the data
    """

    data: UseCaseControlResponse = Field(..., description="Validated response data")

    @property
    def usecasecontrol(self) -> UseCaseControlResponse:
        """Convenience property to access the main response data.

        Returns:
            The UseCaseControlResponse data from the response.
        """
        return self.data


class UseCaseResponseWrapper(ClientResponse):
    """Response wrapper for UseCaseResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to UseCaseResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as UseCaseResponse
        usecase: Convenience property to access the data
    """

    data: UseCaseResponse = Field(..., description="Validated response data")

    @property
    def usecase(self) -> UseCaseResponse:
        """Convenience property to access the main response data.

        Returns:
            The UseCaseResponse data from the response.
        """
        return self.data


class UseCaseRiskScenarioResponseWrapper(ClientResponse):
    """Response wrapper for UseCaseRiskScenarioResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to UseCaseRiskScenarioResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as UseCaseRiskScenarioResponse
        usecaseriskscenario: Convenience property to access the data
    """

    data: UseCaseRiskScenarioResponse = Field(
        ..., description="Validated response data"
    )

    @property
    def usecaseriskscenario(self) -> UseCaseRiskScenarioResponse:
        """Convenience property to access the main response data.

        Returns:
            The UseCaseRiskScenarioResponse data from the response.
        """
        return self.data


class UseCaseWorkflowResponseWrapper(ClientResponse):
    """Response wrapper for UseCaseWorkflowResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to UseCaseWorkflowResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as UseCaseWorkflowResponse
        usecaseworkflow: Convenience property to access the data
    """

    data: UseCaseWorkflowResponse = Field(..., description="Validated response data")

    @property
    def usecaseworkflow(self) -> UseCaseWorkflowResponse:
        """Convenience property to access the main response data.

        Returns:
            The UseCaseWorkflowResponse data from the response.
        """
        return self.data


class VendorResponseWrapper(ClientResponse):
    """Response wrapper for VendorResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to VendorResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as VendorResponse
        vendor: Convenience property to access the data
    """

    data: VendorResponse = Field(..., description="Validated response data")

    @property
    def vendor(self) -> VendorResponse:
        """Convenience property to access the main response data.

        Returns:
            The VendorResponse data from the response.
        """
        return self.data


class WorkflowStageResponseWrapper(ClientResponse):
    """Response wrapper for WorkflowStageResponse with metadata and validation.

    Extends ClientResponse to provide type-safe access to WorkflowStageResponse data
    along with HTTP response metadata.

    Attributes:
        data: The validated response data as WorkflowStageResponse
        workflowstage: Convenience property to access the data
    """

    data: WorkflowStageResponse = Field(..., description="Validated response data")

    @property
    def workflowstage(self) -> WorkflowStageResponse:
        """Convenience property to access the main response data.

        Returns:
            The WorkflowStageResponse data from the response.
        """
        return self.data
