2024-03-22 09:56:30 -07:00
|
|
|
from typing import List
|
|
|
|
|
|
|
|
import strawberry
|
|
|
|
import strawberry_django
|
2021-06-08 13:52:39 -04:00
|
|
|
|
2023-03-23 05:42:18 -07:00
|
|
|
from circuits import models
|
2021-06-08 13:52:39 -04:00
|
|
|
from .types import *
|
2023-03-29 07:27:11 -05:00
|
|
|
|
2023-03-23 05:42:18 -07:00
|
|
|
|
2024-03-22 09:56:30 -07:00
|
|
|
@strawberry.type
|
|
|
|
class CircuitsQuery:
|
|
|
|
@strawberry.field
|
|
|
|
def circuit(self, id: int) -> CircuitType:
|
|
|
|
return models.Circuit.objects.get(pk=id)
|
|
|
|
circuit_list: List[CircuitType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def circuit_termination(self, id: int) -> CircuitTerminationType:
|
|
|
|
return models.CircuitTermination.objects.get(pk=id)
|
|
|
|
circuit_termination_list: List[CircuitTerminationType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def circuit_type(self, id: int) -> CircuitTypeType:
|
|
|
|
return models.CircuitType.objects.get(pk=id)
|
|
|
|
circuit_type_list: List[CircuitTypeType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def provider(self, id: int) -> ProviderType:
|
|
|
|
return models.Provider.objects.get(pk=id)
|
|
|
|
provider_list: List[ProviderType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def provider_account(self, id: int) -> ProviderAccountType:
|
|
|
|
return models.ProviderAccount.objects.get(pk=id)
|
|
|
|
provider_account_list: List[ProviderAccountType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def provider_network(self, id: int) -> ProviderNetworkType:
|
|
|
|
return models.ProviderNetwork.objects.get(pk=id)
|
|
|
|
provider_network_list: List[ProviderNetworkType] = strawberry_django.field()
|