# Generated by ariadne-codegen
# Source: tools/graphql_codegen/automations/

from __future__ import annotations

from typing import Optional, Union

from pydantic import Field
from typing_extensions import Literal

from wandb._pydantic import GQLResult, Typename

from .fragments import WebhookIntegrationFields


class CreateGenericWebhookIntegration(GQLResult):
    create_generic_webhook_integration: Optional[
        CreateGenericWebhookIntegrationCreateGenericWebhookIntegration
    ] = Field(alias="createGenericWebhookIntegration")


class CreateGenericWebhookIntegrationCreateGenericWebhookIntegration(GQLResult):
    integration: Union[
        CreateGenericWebhookIntegrationCreateGenericWebhookIntegrationIntegrationIntegration,
        WebhookIntegrationFields,
    ] = Field(discriminator="typename__")


class CreateGenericWebhookIntegrationCreateGenericWebhookIntegrationIntegrationIntegration(
    GQLResult
):
    typename__: Typename[
        Literal["GitHubOAuthIntegration", "Integration", "SlackIntegration"]
    ]


CreateGenericWebhookIntegration.model_rebuild()
CreateGenericWebhookIntegrationCreateGenericWebhookIntegration.model_rebuild()
