# generated by fastapi-codegen:
#   filename:  /Users/ivasylen/Code/contracts/guardicore/connector
#   timestamp: 2026-01-26T10:59:30+00:00

from __future__ import annotations

from enum import Enum
from typing import List, Optional

from pydantic import BaseModel, ConfigDict, Field

from centra_sdk.utils.gc_serializer import GcSerializer


class Connector(Enum):
    CLOUD_AZURE = 'cloud_azure'
    CLOUD_AWS = 'cloud_aws'
    PACKETFENCE = 'packetfence'
    ALGOSEC = 'algosec'
    PENSANDO = 'pensando'
    PLATFORM = 'platform'
    AGENTLESS = 'agentless'


class Detail(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    field: Optional[str] = Field(
        None,
        description='The field or parameter that caused the error',
        examples=['revision'],
    )
    issue: Optional[str] = Field(
        None,
        description='Description of the specific issue',
        examples=['Revision must be a positive integer'],
    )


class ErrorResponse(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    code: str = Field(
        ...,
        description='Error code identifier (e.g., invalid_request, resource_not_found, authentication_failed)',
        examples=['invalid_request'],
    )
    message: str = Field(
        ...,
        description='Human-readable error message suitable for display',
        examples=['The request could not be processed due to invalid parameters'],
    )
    details: Optional[List[Detail]] = Field(
        None,
        description='Optional array of detailed error information for specific fields or issues',
    )
