#
# Generated by "infrahubctl protocols"
#

from __future__ import annotations

from typing import TYPE_CHECKING, Optional

from infrahub_sdk.protocols import CoreNodeSync, BuiltinIPAddress, BuiltinIPAddressSync, BuiltinIPNamespace, BuiltinIPNamespaceSync, BuiltinIPPrefix, BuiltinIPPrefixSync, BuiltinTag, BuiltinTagSync, CoreAccount, CoreAccountGroup, CoreAccountGroupSync, CoreAccountRole, CoreAccountRoleSync, CoreAccountSync, CoreAction, CoreActionSync, CoreArtifact, CoreArtifactCheck, CoreArtifactCheckSync, CoreArtifactDefinition, CoreArtifactDefinitionSync, CoreArtifactSync, CoreArtifactTarget, CoreArtifactTargetSync, CoreArtifactThread, CoreArtifactThreadSync, CoreArtifactValidator, CoreArtifactValidatorSync, CoreBasePermission, CoreBasePermissionSync, CoreChangeComment, CoreChangeCommentSync, CoreChangeThread, CoreChangeThreadSync, CoreCheck, CoreCheckDefinition, CoreCheckDefinitionSync, CoreCheckSync, CoreComment, CoreCommentSync, CoreCredential, CoreCredentialSync, CoreCustomWebhook, CoreCustomWebhookSync, CoreDataCheck, CoreDataCheckSync, CoreDataValidator, CoreDataValidatorSync, CoreEnvKeyValue, CoreEnvKeyValueSync, CoreFileCheck, CoreFileCheckSync, CoreFileObject, CoreFileObjectSync, CoreFileThread, CoreFileThreadSync, CoreGeneratorAction, CoreGeneratorActionSync, CoreGeneratorAwareGroup, CoreGeneratorAwareGroupSync, CoreGeneratorCheck, CoreGeneratorCheckSync, CoreGeneratorDefinition, CoreGeneratorDefinitionSync, CoreGeneratorGroup, CoreGeneratorGroupSync, CoreGeneratorInstance, CoreGeneratorInstanceSync, CoreGeneratorValidator, CoreGeneratorValidatorSync, CoreGenericAccount, CoreGenericAccountSync, CoreGenericRepository, CoreGenericRepositorySync, CoreGlobalPermission, CoreGlobalPermissionSync, CoreGraphQLQuery, CoreGraphQLQueryGroup, CoreGraphQLQueryGroupSync, CoreGraphQLQuerySync, CoreGroup, CoreGroupAction, CoreGroupActionSync, CoreGroupSync, CoreGroupTriggerRule, CoreGroupTriggerRuleSync, CoreIPAddressPool, CoreIPAddressPoolSync, CoreIPPool, CoreIPPoolSync, CoreIPPrefixPool, CoreIPPrefixPoolSync, CoreKeyValue, CoreKeyValueSync, CoreMenu, CoreMenuItem, CoreMenuItemSync, CoreMenuSync, CoreNodeSync, CoreNodeTriggerAttributeMatch, CoreNodeTriggerAttributeMatchSync, CoreNodeTriggerMatch, CoreNodeTriggerMatchSync, CoreNodeTriggerRelationshipMatch, CoreNodeTriggerRelationshipMatchSync, CoreNodeTriggerRule, CoreNodeTriggerRuleSync, CoreNumberPool, CoreNumberPoolRange, CoreNumberPoolRangeSync, CoreNumberPoolSync, CoreObjectComponentTemplate, CoreObjectComponentTemplateSync, CoreObjectPermission, CoreObjectPermissionSync, CoreObjectTemplate, CoreObjectTemplateSync, CoreObjectThread, CoreObjectThreadSync, CorePasswordCredential, CorePasswordCredentialSync, CoreProfile, CoreProfileSync, CoreProposedChange, CoreProposedChangeSync, CoreReadOnlyRepository, CoreReadOnlyRepositorySync, CoreRepository, CoreRepositoryGroup, CoreRepositoryGroupSync, CoreRepositorySync, CoreRepositoryValidator, CoreRepositoryValidatorSync, CoreResourcePool, CoreResourcePoolSync, CoreSchemaCheck, CoreSchemaCheckSync, CoreSchemaValidator, CoreSchemaValidatorSync, CoreStandardCheck, CoreStandardCheckSync, CoreStandardGroup, CoreStandardGroupSync, CoreStandardWebhook, CoreStandardWebhookSync, CoreStaticKeyValue, CoreStaticKeyValueSync, CoreTaskTarget, CoreTaskTargetSync, CoreThread, CoreThreadComment, CoreThreadCommentSync, CoreThreadSync, CoreTransformJinja2, CoreTransformJinja2Sync, CoreTransformPython, CoreTransformPythonSync, CoreTransformation, CoreTransformationSync, CoreTriggerRule, CoreTriggerRuleSync, CoreUserValidator, CoreUserValidatorSync, CoreValidator, CoreValidatorSync, CoreWebhook, CoreWebhookSync, CoreWeightedPoolResource, CoreWeightedPoolResourceSync, InternalAccountToken, InternalAccountTokenSync, InternalExternalIdentity, InternalExternalIdentitySync, InternalIPPrefixAvailable, InternalIPPrefixAvailableSync, InternalIPRangeAvailable, InternalIPRangeAvailableSync, InternalRefreshToken, InternalRefreshTokenSync, IpamNamespace, IpamNamespaceSync, LineageOwner, LineageOwnerSync, LineageSource, LineageSourceSync, ProfileBuiltinIPAddress, ProfileBuiltinIPAddressSync, ProfileBuiltinIPPrefix, ProfileBuiltinIPPrefixSync, ProfileBuiltinTag, ProfileBuiltinTagSync, ProfileIpamNamespace, ProfileIpamNamespaceSync

if TYPE_CHECKING:
    from infrahub_sdk.node import RelatedNodeSync, RelationshipAttributeSync, RelationshipManagerSync
    from infrahub_sdk.protocols_base import (
        AnyAttribute,
        AnyAttributeOptional,
        String,
        StringOptional,
        Integer,
        IntegerOptional,
        Boolean,
        BooleanOptional,
        DateTime,
        DateTimeOptional,
        Dropdown,
        DropdownOptional,
        HashedPassword,
        HashedPasswordOptional,
        MacAddress,
        MacAddressOptional,
        IPHost,
        IPHostOptional,
        IPNetwork,
        IPNetworkOptional,
        IPAddress,
        IPAddressOptional,
        JSONAttribute,
        JSONAttributeOptional,
        ListAttribute,
        ListAttributeOptional,
        URL,
        URLOptional,
    )


class LocationGeneric(CoreNodeSync):
    description: StringOptional
    name: String
    shortname: String
    children: RelationshipManagerSync[LocationGeneric]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    parent: RelationshipAttributeSync[LocationGeneric]
    profiles: RelationshipManagerSync[CoreProfileSync]
    servers: RelationshipManagerSync[NetworkManagementServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]
    tags: RelationshipManagerSync[BuiltinTagSync]

class NetworkManagementServer(CoreNodeSync):
    description: StringOptional
    name: String
    status: Dropdown
    ip_addresses: RelationshipManagerSync[IpamIPAddress]
    location: RelationshipAttributeSync[LocationGeneric]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    profiles: RelationshipManagerSync[CoreProfileSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]



class InfraDevice(CoreNodeSync):
    description: StringOptional
    name: String
    role: Dropdown
    role_id: Integer
    status: Dropdown
    location: RelationshipAttributeSync[LocationSite]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    object_template: RelationshipAttributeSync[TemplateInfraDevice]
    primary_ip: RelationshipAttributeSync[IpamIPAddress]
    profiles: RelationshipManagerSync[CoreProfileSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class IpamIPAddress(BuiltinIPAddressSync):
    address: IPHost
    description: StringOptional
    fqdn: StringOptional
    ip_namespace: RelationshipAttributeSync[BuiltinIPNamespaceSync]
    ip_prefix: RelationshipAttributeSync[BuiltinIPPrefixSync]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    profiles: RelationshipManagerSync[CoreProfileSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class IpamPrefix(BuiltinIPPrefixSync):
    broadcast_address: StringOptional
    description: StringOptional
    hostmask: StringOptional
    is_pool: Boolean
    is_top_level: BooleanOptional
    member_type: Dropdown
    netmask: StringOptional
    network_address: StringOptional
    prefix: IPNetwork
    role: DropdownOptional
    status: Dropdown
    utilization: IntegerOptional
    children: RelationshipManagerSync[BuiltinIPPrefixSync]
    ip_addresses: RelationshipManagerSync[BuiltinIPAddressSync]
    ip_namespace: RelationshipAttributeSync[BuiltinIPNamespaceSync]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    parent: RelationshipAttributeSync[BuiltinIPPrefixSync]
    profiles: RelationshipManagerSync[CoreProfileSync]
    resource_pool: RelationshipManagerSync[CoreIPAddressPoolSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class LocationCountry(LocationGeneric):
    description: StringOptional
    name: String
    shortname: String
    timezone: StringOptional
    children: RelationshipManagerSync[LocationSite]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    parent: RelationshipAttributeSync[LocationGeneric]
    profiles: RelationshipManagerSync[CoreProfileSync]
    servers: RelationshipManagerSync[NetworkManagementServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]
    tags: RelationshipManagerSync[BuiltinTagSync]


class LocationRack(LocationGeneric):
    description: StringOptional
    facility_id: StringOptional
    height: Integer
    name: String
    shortname: String
    children: RelationshipManagerSync[LocationGeneric]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    parent: RelationshipAttributeSync[LocationSite]
    profiles: RelationshipManagerSync[CoreProfileSync]
    servers: RelationshipManagerSync[NetworkManagementServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]
    tags: RelationshipManagerSync[BuiltinTagSync]


class LocationSite(LocationGeneric):
    description: StringOptional
    facility_id: StringOptional
    name: String
    physical_address: StringOptional
    shortname: String
    children: RelationshipManagerSync[LocationRack]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    parent: RelationshipAttributeSync[LocationCountry]
    profiles: RelationshipManagerSync[CoreProfileSync]
    servers: RelationshipManagerSync[NetworkManagementServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]
    tags: RelationshipManagerSync[BuiltinTagSync]


class NetworkDhcpServer(NetworkManagementServer):
    description: StringOptional
    lease_time: String
    name: String
    status: Dropdown
    ip_addresses: RelationshipManagerSync[IpamIPAddress]
    location: RelationshipAttributeSync[LocationGeneric]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    profiles: RelationshipManagerSync[CoreProfileSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class NetworkNameServer(NetworkManagementServer):
    description: StringOptional
    name: String
    status: Dropdown
    ip_addresses: RelationshipManagerSync[IpamIPAddress]
    location: RelationshipAttributeSync[LocationGeneric]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    profiles: RelationshipManagerSync[CoreProfileSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class NetworkNTPServer(NetworkManagementServer):
    description: StringOptional
    name: String
    status: Dropdown
    ip_addresses: RelationshipManagerSync[IpamIPAddress]
    location: RelationshipAttributeSync[LocationGeneric]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    profiles: RelationshipManagerSync[CoreProfileSync]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]




class ProfileInfraDevice(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    role: DropdownOptional
    status: DropdownOptional
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[InfraDevice]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileIpamIPAddress(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    fqdn: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[IpamIPAddress]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileIpamPrefix(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    is_pool: BooleanOptional
    member_type: DropdownOptional
    profile_name: String
    profile_priority: Integer
    role: DropdownOptional
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[IpamPrefix]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileLocationCountry(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    timezone: StringOptional
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[LocationCountry]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileLocationGeneric(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[LocationGeneric]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileLocationRack(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    facility_id: StringOptional
    height: IntegerOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[LocationRack]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileLocationSite(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    facility_id: StringOptional
    physical_address: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[LocationSite]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileNetworkDhcpServer(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[NetworkDhcpServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileNetworkManagementServer(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[NetworkManagementServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileNetworkNameServer(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[NetworkNameServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]


class ProfileNetworkNTPServer(LineageSourceSync, CoreProfileSync, CoreNodeSync):
    description: StringOptional
    profile_name: String
    profile_priority: Integer
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    related_nodes: RelationshipManagerSync[NetworkNTPServer]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]




class TemplateInfraDevice(LineageSourceSync, CoreObjectTemplateSync, CoreNodeSync):
    description: StringOptional
    role: Dropdown
    role_id: IntegerOptional
    status: Dropdown
    template_name: String
    location: RelationshipAttributeSync[LocationSite]
    member_of_groups: RelationshipManagerSync[CoreGroupSync]
    primary_ip: RelationshipAttributeSync[IpamIPAddress]
    related_nodes: RelationshipManagerSync[InfraDevice]
    subscriber_of_groups: RelationshipManagerSync[CoreGroupSync]

