|
27 | 27 | )
|
28 | 28 |
|
29 | 29 |
|
30 |
| -@strawberry.type |
| 30 | +@strawberry.type(name="Query") |
31 | 31 | class NetBoxBGPQuery:
|
32 |
| - @strawberry.field |
33 |
| - def netbox_bgp_community(self, id: int) -> CommunityType: |
34 |
| - return Community.objects.get(pk=id) |
35 | 32 |
|
| 33 | + netbox_bgp_community: CommunityType = strawberry_django.field() |
36 | 34 | netbox_bgp_community_list: List[CommunityType] = strawberry_django.field()
|
37 | 35 |
|
38 |
| - @strawberry.field |
39 |
| - def netbox_bgp_session(self, id: int) -> BGPSessionType: |
40 |
| - return BGPSession.objects.get(pk=id) |
41 |
| - |
| 36 | + netbox_bgp_session: BGPSessionType = strawberry_django.field() |
42 | 37 | netbox_bgp_session_list: List[BGPSessionType] = strawberry_django.field()
|
43 | 38 |
|
44 |
| - @strawberry.field |
45 |
| - def netbox_bgp_peer_group(self, id: int) -> BGPPeerGroupType: |
46 |
| - return BGPPeerGroup.objects.get(pk=id) |
47 |
| - |
| 39 | + netbox_bgp_peer_group: BGPPeerGroupType = strawberry_django.field() |
48 | 40 | netbox_bgp_peer_group_list: List[BGPPeerGroupType] = strawberry_django.field()
|
49 | 41 |
|
50 |
| - @strawberry.field |
51 |
| - def netbox_bgp_routing_policy(self, id: int) -> RoutingPolicyType: |
52 |
| - return RoutingPolicy.objects.get(pk=id) |
53 |
| - |
| 42 | + netbox_bgp_routing_policy: RoutingPolicyType = strawberry_django.field() |
54 | 43 | netbox_bgp_routing_policy_list: List[RoutingPolicyType] = strawberry_django.field()
|
55 | 44 |
|
56 |
| - @strawberry.field |
57 |
| - def netbox_bgp_routing_policy_rule(self, id: int) -> RoutingPolicyRuleType: |
58 |
| - return RoutingPolicyRule.objects.get(pk=id) |
59 |
| - |
| 45 | + netbox_bgp_routing_policy_rule: RoutingPolicyRuleType = strawberry_django.field() |
60 | 46 | netbox_bgp_routing_policy_rule_list: List[RoutingPolicyRuleType] = strawberry_django.field()
|
61 | 47 |
|
62 |
| - @strawberry.field |
63 |
| - def netbox_bgp_prefixlist(self, id: int) -> PrefixListType: |
64 |
| - return PrefixList.objects.get(pk=id) |
65 |
| - |
| 48 | + netbox_bgp_prefixlist: PrefixListType = strawberry_django.field() |
66 | 49 | netbox_bgp_prefixlist_list: List[PrefixListType] = strawberry_django.field()
|
67 | 50 |
|
68 |
| - @strawberry.field |
69 |
| - def netbox_bgp_prefixlist_rule(self, id: int) -> PrefixListRuleType: |
70 |
| - return PrefixListRule.objects.get(pk=id) |
71 |
| - |
| 51 | + netbox_bgp_prefixlist_rule: PrefixListRuleType = strawberry_django.field() |
72 | 52 | netbox_bgp_prefixlist_rule_list: List[PrefixListRuleType] = strawberry_django.field()
|
73 | 53 |
|
74 |
| - @strawberry.field |
75 |
| - def netbox_bgp_communitylist(self, id: int) -> CommunityListType: |
76 |
| - return CommunityList.objects.get(pk=id) |
77 |
| - |
| 54 | + netbox_bgp_communitylist: CommunityListType = strawberry_django.field() |
78 | 55 | netbox_bgp_communitylist_list: List[CommunityListType] = strawberry_django.field()
|
79 | 56 |
|
80 |
| - @strawberry.field |
81 |
| - def netbox_bgp_communitylist_rule(self, id: int) -> CommunityListRuleType: |
82 |
| - return CommunityListRule.objects.get(pk=id) |
83 |
| - |
| 57 | + netbox_bgp_communitylist_rule: CommunityListRuleType = strawberry_django.field() |
84 | 58 | netbox_bgp_communitylist_rule_list: List[CommunityListRuleType] = strawberry_django.field()
|
0 commit comments