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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CloudJiraDataSource(UniversalBaseModel):
    """
    Cloud Jira Data Source integrating JiraReader.
    """

    supports_access_control: typing.Optional[bool] = None
    email: typing.Optional[str] = pydantic.Field(default=None)
    """
    The email address to use for authentication.
    """

    api_token: typing.Optional[str] = pydantic.Field(default=None)
    """
    The API/ Access Token used for Basic, PAT and OAuth2 authentication.
    """

    server_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The server url for Jira Cloud.
    """

    cloud_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The cloud ID, used in case of OAuth2.
    """

    authentication_mechanism: str = pydantic.Field()
    """
    Type of Authentication for connecting to Jira APIs.
    """

    query: str = pydantic.Field()
    """
    JQL (Jira Query Language) query to search.
    """

    class_name: typing.Optional[str] = None

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

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