"""
Pydantic models for credoai.

Auto-generated from OpenAPI specification.
Generated: 2026-01-28T01:42:33.414545+00:00
Source: 0.1.0
"""

from __future__ import annotations

from datetime import datetime
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


# Base models with proper Pydantic configuration
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 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 (bool, optional): Example: False
        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[bool] = Field(False, description="Example: False")

    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 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 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):
    """

    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)


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 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 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_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_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_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")


# 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 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 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 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"


# 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 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 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 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 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
