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

from ...core.unchecked_base_model import UncheckedBaseModel
from .git_hub_credential import GitHubCredential
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import typing


class AppsecGitHub(UncheckedBaseModel):
    """
    Configuration for GitHub as an application security provider.

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

    credential: GitHubCredential = pydantic.Field()
    """
    Credentials used for accessing the GitHub API.
    """

    organization_slug: str = pydantic.Field()
    """
    GitHub organization slug. This value can be found in the URL of the organization's GitHub page or by converting the organization display name to a slug. For example, if the organization display name is "My GitHub Organization" and the URL is "https://github.com/organizations/my-github-organization", the slug would be "my-github-organization".
    """

    url: str = pydantic.Field()
    """
    Base URL for the GitHub environment. Only necessary with GitHub Enterprise Server deployments.
    """

    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
