mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00

* Resolve F541 errors * Resolve F841 errors * Resolve F811 errors * Resolve F901 errors * Resolve E714 errors * Ignore F821 errors for GraphQL mixins * Replace pycodestyle with ruff * Move ignores to ruff.toml
43 lines
2.2 KiB
Python
43 lines
2.2 KiB
Python
from typing import Annotated, List, Union
|
|
|
|
import strawberry
|
|
|
|
__all__ = (
|
|
'CabledObjectMixin',
|
|
'PathEndpointMixin',
|
|
)
|
|
|
|
|
|
@strawberry.type
|
|
class CabledObjectMixin:
|
|
cable: Annotated["CableType", strawberry.lazy('dcim.graphql.types')] | None # noqa: F821
|
|
|
|
link_peers: List[Annotated[Union[
|
|
Annotated["CircuitTerminationType", strawberry.lazy('circuits.graphql.types')], # noqa: F821
|
|
Annotated["ConsolePortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["ConsoleServerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["FrontPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
], strawberry.union("LinkPeerType")]]
|
|
|
|
|
|
@strawberry.type
|
|
class PathEndpointMixin:
|
|
|
|
connected_endpoints: List[Annotated[Union[
|
|
Annotated["CircuitTerminationType", strawberry.lazy('circuits.graphql.types')], # noqa: F821
|
|
Annotated["ConsolePortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["ConsoleServerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["FrontPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
Annotated["ProviderNetworkType", strawberry.lazy('circuits.graphql.types')], # noqa: F821
|
|
Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821
|
|
], strawberry.union("ConnectedEndpointType")]]
|