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

from __future__ import annotations

from typing import Literal, Optional, Union

from pydantic import Field

from wandb._pydantic import GQLBase, Typename

from .fragments import GenericWebhookIntegrationFields


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


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


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


class CreateGenericWebhookIntegrationCreateGenericWebhookIntegrationIntegrationGenericWebhookIntegration(
    GenericWebhookIntegrationFields
):
    typename__: Typename[Literal["GenericWebhookIntegration"]]


CreateGenericWebhookIntegration.model_rebuild()
CreateGenericWebhookIntegrationCreateGenericWebhookIntegration.model_rebuild()
