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

from __future__ import annotations

from typing import List, Optional

from pydantic import Field
from typing_extensions import Literal

from wandb._pydantic import GQLId, GQLResult, Typename

from .enums import ArtifactState


class ArtifactAliasFragment(GQLResult):
    typename__: Typename[Literal["ArtifactAlias"]] = "ArtifactAlias"
    id: GQLId
    alias: str


class ProjectInfoFragment(GQLResult):
    name: str
    entity: ProjectInfoFragmentEntity


class ProjectInfoFragmentEntity(GQLResult):
    name: str


class TagFragment(GQLResult):
    typename__: Typename[Literal["Tag"]] = "Tag"
    id: GQLId
    name: str


class ArtifactCollectionFragment(GQLResult):
    typename__: Typename[Literal["ArtifactSequence", "ArtifactPortfolio"]]
    id: GQLId
    name: str
    description: Optional[str]
    created_at: str = Field(alias="createdAt")
    project: Optional[ProjectInfoFragment]
    type: ArtifactCollectionFragmentType
    tags: ArtifactCollectionFragmentTags


class ArtifactCollectionFragmentType(GQLResult):
    name: str


class ArtifactCollectionFragmentTags(GQLResult):
    edges: List[ArtifactCollectionFragmentTagsEdges]


class ArtifactCollectionFragmentTagsEdges(GQLResult):
    node: TagFragment


class CollectionInfoFragment(GQLResult):
    typename__: Typename[Literal["ArtifactSequence", "ArtifactPortfolio"]]
    name: str
    project: Optional[ProjectInfoFragment]


class SourceCollectionInfoFragment(GQLResult):
    typename__: Typename[Literal["ArtifactSequence"]] = "ArtifactSequence"
    name: str
    project: Optional[ProjectInfoFragment]


class ArtifactFragment(GQLResult):
    typename__: Typename[Literal["Artifact"]] = "Artifact"
    id: GQLId
    artifact_sequence: SourceCollectionInfoFragment = Field(alias="artifactSequence")
    version_index: Optional[int] = Field(alias="versionIndex")
    artifact_type: ArtifactFragmentArtifactType = Field(alias="artifactType")
    description: Optional[str]
    metadata: Optional[str]
    ttl_duration_seconds: Optional[int] = Field(
        alias="ttlDurationSeconds", default=None
    )
    ttl_is_inherited: Optional[bool] = Field(alias="ttlIsInherited", default=None)
    tags: Optional[List[TagFragment]] = None
    history_step: Optional[int] = Field(alias="historyStep", default=None)
    state: ArtifactState
    size: int
    digest: str
    commit_hash: Optional[str] = Field(alias="commitHash")
    file_count: int = Field(alias="fileCount")
    created_at: str = Field(alias="createdAt")
    updated_at: Optional[str] = Field(alias="updatedAt")
    aliases: Optional[List[ArtifactFragmentAliases]] = None


class ArtifactFragmentArtifactType(GQLResult):
    name: str


class ArtifactFragmentAliases(ArtifactAliasFragment):
    artifact_collection: Optional[CollectionInfoFragment] = Field(
        alias="artifactCollection"
    )


class ArtifactMembershipFragment(GQLResult):
    typename__: Typename[Literal["ArtifactCollectionMembership"]] = (
        "ArtifactCollectionMembership"
    )
    id: GQLId
    version_index: Optional[int] = Field(alias="versionIndex")
    aliases: List[ArtifactAliasFragment]
    artifact_collection: Optional[CollectionInfoFragment] = Field(
        alias="artifactCollection"
    )
    artifact: Optional[ArtifactFragment]


class ArtifactPortfolioTypeFields(GQLResult):
    typename__: Typename[Literal["ArtifactPortfolio"]] = "ArtifactPortfolio"
    id: GQLId
    name: str


class ArtifactSequenceTypeFields(GQLResult):
    typename__: Typename[Literal["ArtifactSequence"]] = "ArtifactSequence"
    id: GQLId
    name: str


class ArtifactTypeFragment(GQLResult):
    typename__: Typename[Literal["ArtifactType"]] = "ArtifactType"
    id: GQLId
    name: str
    description: Optional[str]
    created_at: str = Field(alias="createdAt")


class DeferredManifestFragment(GQLResult):
    file: DeferredManifestFragmentFile


class DeferredManifestFragmentFile(GQLResult):
    direct_url: str = Field(alias="directUrl")


class FileFragment(GQLResult):
    typename__: Typename[Literal["File"]] = "File"
    id: GQLId
    name: str
    url: Optional[str]
    size_bytes: int = Field(alias="sizeBytes")
    storage_path: Optional[str] = Field(alias="storagePath", default=None)
    mimetype: Optional[str]
    updated_at: Optional[str] = Field(alias="updatedAt")
    digest: Optional[str]
    md_5: Optional[str] = Field(alias="md5")
    direct_url: str = Field(alias="directUrl")


class FileWithUrlFragment(GQLResult):
    typename__: Typename[Literal["File"]] = "File"
    name: str
    direct_url: str = Field(alias="directUrl")


class OrgInfoFragment(GQLResult):
    name: str
    org_entity: Optional[OrgInfoFragmentOrgEntity] = Field(
        alias="orgEntity", default=None
    )


class OrgInfoFragmentOrgEntity(GQLResult):
    name: str


class PageInfoFragment(GQLResult):
    typename__: Typename[Literal["PageInfo"]] = "PageInfo"
    end_cursor: Optional[str] = Field(alias="endCursor")
    has_next_page: bool = Field(alias="hasNextPage")


class RegistryCollectionFragment(GQLResult):
    typename__: Typename[Literal["ArtifactSequence", "ArtifactPortfolio"]]
    id: GQLId
    name: str
    description: Optional[str]
    created_at: str = Field(alias="createdAt")
    project: Optional[ProjectInfoFragment]
    type: RegistryCollectionFragmentType
    tags: RegistryCollectionFragmentTags


class RegistryCollectionFragmentType(GQLResult):
    name: str


class RegistryCollectionFragmentTags(GQLResult):
    edges: List[RegistryCollectionFragmentTagsEdges]


class RegistryCollectionFragmentTagsEdges(GQLResult):
    node: TagFragment


class RegistryFragment(GQLResult):
    typename__: Typename[Literal["Project"]] = "Project"
    id: GQLId
    name: str
    entity: RegistryFragmentEntity
    description: Optional[str]
    created_at: str = Field(alias="createdAt")
    updated_at: Optional[str] = Field(alias="updatedAt")
    access: Optional[str]
    allow_all_artifact_types: bool = Field(alias="allowAllArtifactTypes")
    artifact_types: RegistryFragmentArtifactTypes = Field(alias="artifactTypes")


class RegistryFragmentEntity(GQLResult):
    name: str
    organization: Optional[RegistryFragmentEntityOrganization]


class RegistryFragmentEntityOrganization(GQLResult):
    name: str


class RegistryFragmentArtifactTypes(GQLResult):
    edges: List[RegistryFragmentArtifactTypesEdges]


class RegistryFragmentArtifactTypesEdges(GQLResult):
    node: Optional[RegistryFragmentArtifactTypesEdgesNode]


class RegistryFragmentArtifactTypesEdgesNode(GQLResult):
    name: str


class RegistryRoleFragment(GQLResult):
    name: str


class RunInfoFragment(GQLResult):
    typename__: Typename[Literal["Run"]] = "Run"
    id: GQLId
    name: str
    project: Optional[ProjectInfoFragment]


class TeamMemberFragment(GQLResult):
    typename__: Typename[Literal["Member"]] = "Member"
    id: Optional[str]
    role: Optional[str]
    pending: Optional[bool]
    email: Optional[str]
    username: Optional[str]
    name: str
    photo_url: Optional[str] = Field(alias="photoUrl")
    account_type: Optional[str] = Field(alias="accountType")
    api_key: Optional[str] = Field(alias="apiKey")


class TeamFragment(GQLResult):
    typename__: Typename[Literal["Entity"]] = "Entity"
    id: GQLId
    name: str
    available: Optional[bool]
    photo_url: Optional[str] = Field(alias="photoUrl")
    read_only: Optional[bool] = Field(alias="readOnly")
    read_only_admin: bool = Field(alias="readOnlyAdmin")
    is_team: bool = Field(alias="isTeam")
    private_only: bool = Field(alias="privateOnly")
    storage_bytes: int = Field(alias="storageBytes")
    code_saving_enabled: bool = Field(alias="codeSavingEnabled")
    default_access: str = Field(alias="defaultAccess")
    is_paid: Optional[bool] = Field(alias="isPaid")
    members: List[TeamMemberFragment]


class TeamRegistryMemberFragment(GQLResult):
    team: TeamFragment
    role: RegistryRoleFragment


class TypeInfoFragment(GQLResult):
    name: Optional[str]
    fields: Optional[List[TypeInfoFragmentFields]]
    input_fields: Optional[List[TypeInfoFragmentInputFields]] = Field(
        alias="inputFields"
    )


class TypeInfoFragmentFields(GQLResult):
    name: str
    args: List[TypeInfoFragmentFieldsArgs]


class TypeInfoFragmentFieldsArgs(GQLResult):
    name: str


class TypeInfoFragmentInputFields(GQLResult):
    name: str


class UserRegistryMemberFragment(GQLResult):
    id: GQLId
    name: Optional[str]
    username: Optional[str]
    email: Optional[str]
    role: RegistryRoleFragment


ArtifactAliasFragment.model_rebuild()
ProjectInfoFragment.model_rebuild()
TagFragment.model_rebuild()
ArtifactCollectionFragment.model_rebuild()
CollectionInfoFragment.model_rebuild()
SourceCollectionInfoFragment.model_rebuild()
ArtifactFragment.model_rebuild()
ArtifactMembershipFragment.model_rebuild()
ArtifactPortfolioTypeFields.model_rebuild()
ArtifactSequenceTypeFields.model_rebuild()
ArtifactTypeFragment.model_rebuild()
DeferredManifestFragment.model_rebuild()
FileFragment.model_rebuild()
FileWithUrlFragment.model_rebuild()
OrgInfoFragment.model_rebuild()
PageInfoFragment.model_rebuild()
RegistryCollectionFragment.model_rebuild()
RegistryFragment.model_rebuild()
RegistryRoleFragment.model_rebuild()
RunInfoFragment.model_rebuild()
TeamMemberFragment.model_rebuild()
TeamFragment.model_rebuild()
TeamRegistryMemberFragment.model_rebuild()
TypeInfoFragment.model_rebuild()
UserRegistryMemberFragment.model_rebuild()
