Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common TypedDicts used for M2M #565

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/310.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added common TypedDicts for Contrib SSoT.
74 changes: 74 additions & 0 deletions nautobot_ssot/contrib/typeddicts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""Common TypedDict definitions used in Many-to-Many relationships. """

from typing import TypedDict


class ContentTypeDict(TypedDict):
"""TypedDict for Django Content Types."""

app_label: str
model: str


class TagDict(TypedDict):
"""TypedDict for Nautobot Tags."""

name: str


class LocationDict(TypedDict):
"""TypedDict for DCIM Locations."""

name: str
parent__name: str


class DeviceDict(TypedDict):
"""TypedDict for DCIM Devices."""

name: str
location__name: str
tenant__name: str
rack__name: str
rack__rack_group__name: str
position: int
face: str
virtual_chassis__name: str
vc_position: int


class InterfaceDict(TypedDict):
"""TypedDict for DCIM INterfaces."""

name: str
device__name: str


class PrefixDict(TypedDict):
"""TypedDict for IPAM Prefixes."""

network: str
prefix_length: int
namespace__name: str


class VLANDict(TypedDict):
"""TypedDict for IPAM VLANs."""

vid: int
vlan_group__name: str


class IPAddressDict(TypedDict):
"""TypedDict for IPAM IP Address."""

host: str
prefix_length: int


class VirtualMachineDict(TypedDict):
"""TypedDict for IPAM ."""

name: str
cluster__name: str
tenant__name: str