# This file was auto-generated by Fern from our API Definition.

from ...core.unchecked_base_model import UncheckedBaseModel
from .pager_duty_credential import PagerDutyCredential
import typing
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class TicketingPagerDuty(UncheckedBaseModel):
    """
    Configuration for PagerDuty Operations Cloud.

    [Configuration guide](https://docs.synqly.com/guides/provider-configuration/pagerduty-ticketing-setup)
    """

    credential: PagerDutyCredential
    default_creator: typing.Optional[str] = pydantic.Field(default=None)
    """
    Default email address for the creator field. If provided, the creator field becomes optional for ticket and comment creation. If not provided, the creator field is required.
    """

    default_project: typing.Optional[str] = pydantic.Field(default=None)
    """
    Default PagerDuty service ID for ticket creation. If provided, the project field becomes optional in ticket creation requests. If not provided, the project field is required.
    """

    url: str = pydantic.Field()
    """
    Base URL for the PagerDuty API.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
