"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from anncsu.common.errors import AnncsuBaseError as AnncsuError
from anncsu.common.types import BaseModel
import httpx
from typing import Optional


class ElencoAccessiPostInternalServerErrorData(BaseModel):
    title: Optional[str] = None

    detail: Optional[str] = None


class ElencoAccessiPostInternalServerError(AnncsuError):
    r"""Internal Server Error"""

    data: ElencoAccessiPostInternalServerErrorData

    def __init__(
        self,
        data: ElencoAccessiPostInternalServerErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        self.data = data


class ElencoAccessiPostUnprocessableEntityErrorData(BaseModel):
    title: Optional[str] = None

    detail: Optional[str] = None


class ElencoAccessiPostUnprocessableEntityError(AnncsuError):
    r"""Unprocessable Entity - error in json"""

    data: ElencoAccessiPostUnprocessableEntityErrorData

    def __init__(
        self,
        data: ElencoAccessiPostUnprocessableEntityErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        self.data = data


class ElencoAccessiPostMethodNotAllowedErrorData(BaseModel):
    title: Optional[str] = None

    detail: Optional[str] = None


class ElencoAccessiPostMethodNotAllowedError(AnncsuError):
    r"""Method Not Allowed"""

    data: ElencoAccessiPostMethodNotAllowedErrorData

    def __init__(
        self,
        data: ElencoAccessiPostMethodNotAllowedErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        self.data = data


class ElencoAccessiPostNotFoundErrorData(BaseModel):
    title: Optional[str] = None

    detail: Optional[str] = None


class ElencoAccessiPostNotFoundError(AnncsuError):
    r"""Not found"""

    data: ElencoAccessiPostNotFoundErrorData

    def __init__(
        self,
        data: ElencoAccessiPostNotFoundErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        self.data = data


class ElencoAccessiPostBadRequestErrorData(BaseModel):
    title: Optional[str] = None

    detail: Optional[str] = None


class ElencoAccessiPostBadRequestError(AnncsuError):
    r"""Bad Request"""

    data: ElencoAccessiPostBadRequestErrorData

    def __init__(
        self,
        data: ElencoAccessiPostBadRequestErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        self.data = data
