diff options
| -rw-r--r-- | generalresearch/models/thl/ipinfo.py | 6 | ||||
| -rw-r--r-- | generalresearch/models/thl/maxmind/__init__.py | 0 | ||||
| -rw-r--r-- | generalresearch/models/thl/maxmind/definitions.py | 22 |
3 files changed, 25 insertions, 3 deletions
diff --git a/generalresearch/models/thl/ipinfo.py b/generalresearch/models/thl/ipinfo.py index 44dd408..c4ad50c 100644 --- a/generalresearch/models/thl/ipinfo.py +++ b/generalresearch/models/thl/ipinfo.py @@ -5,7 +5,6 @@ from datetime import UTC, datetime from typing import TYPE_CHECKING, Any, Literal, Self from faker import Faker -from grip_client.enums import AccessType from pydantic import ( BaseModel, ConfigDict, @@ -20,6 +19,7 @@ from generalresearch.models.custom_types import ( CountryISOLike, IPvAnyAddressStr, ) +from generalresearch.models.thl.maxmind.definitions import UserType if TYPE_CHECKING: from generalresearch.managers.thl.ipinfo import IPGeonameManager @@ -174,11 +174,11 @@ class IPInformation(BaseModel): default=None, description="A score indicating the likelihood that the IP address is static.", ) - user_type: AccessType | None = Field( + user_type: UserType | None = Field( default=None, description="The type of user associated with the IP address " "(e.g., 'residential', 'business').", - examples=[AccessType.RESIDENTIAL], + examples=[UserType.RESIDENTIAL], ) postal_code: str | None = Field( default=None, diff --git a/generalresearch/models/thl/maxmind/__init__.py b/generalresearch/models/thl/maxmind/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/generalresearch/models/thl/maxmind/__init__.py diff --git a/generalresearch/models/thl/maxmind/definitions.py b/generalresearch/models/thl/maxmind/definitions.py new file mode 100644 index 0000000..01431c7 --- /dev/null +++ b/generalresearch/models/thl/maxmind/definitions.py @@ -0,0 +1,22 @@ +from enum import Enum + +from generalresearch.utils.enum import ReprEnumMeta + + +class UserType(Enum, metaclass=ReprEnumMeta): + # https://support.maxmind.com/hc/en-us/articles/4408430082971-IP-Trait-Risk-Data#h_01FN6V8JMQMWZGWNPPAW77ZPY4 + BUSINESS = "business" + CAFE = "cafe" + CELLULAR = "cellular" + COLLEGE = "college" + CDN = "content_delivery_network" + CPN = "consumer_privacy_network" + GOVERNMENT = "government" + HOSTING = "hosting" + LIBRARY = "library" + MILITARY = "military" + RESIDENTIAL = "residential" + ROUTER = "router" + SCHOOL = "school" + SEARCH_ENGINE = "search_engine_spider" + TRAVELER = "traveler" |
