Skip to content

Commit 75beb71

Browse files
committed
Re-pin the spec: a detail object requires no member
The republished 2026.11.13 spec drops `required` from the class, proxy, public proxy, carrier, satellite, SSH, SMTP, DNS resolver, BitTorrent and disposable details, which the API answers as {} under a false flag. A detail object is now read as the spec gives it, any member absent as None, rather than as {} or every member, and the lookups go through the generated decoder as the database calls do, since it reads {} now. Web IP rows, whois, rwhois, hosted_domains, dns and ip_ranges stay whole.
1 parent 6f9df3d commit 75beb71

16 files changed

Lines changed: 372 additions & 424 deletions

‎spec/openapi.yaml‎

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3569,11 +3569,6 @@ components:
35693569
last_seen:
35703570
type: string
35713571
description: The last day the range was seen as such.
3572-
required:
3573-
- provider
3574-
- provider_name
3575-
- confidence
3576-
- last_seen
35773572
ProxyDetail:
35783573
type: object
35793574
properties:
@@ -3598,14 +3593,6 @@ components:
35983593
providers_num:
35993594
type: integer
36003595
description: How many pools it was seen in.
3601-
required:
3602-
- provider
3603-
- provider_name
3604-
- first_seen
3605-
- last_seen
3606-
- hits
3607-
- hits_days_pct
3608-
- providers_num
36093596
PubproxyDetail:
36103597
type: object
36113598
properties:
@@ -3632,14 +3619,6 @@ components:
36323619
last_usable:
36333620
type: string
36343621
description: The last day one answered a request, empty when none did.
3635-
required:
3636-
- entry
3637-
- exit
3638-
- protocols
3639-
- num_ports
3640-
- num_proxies
3641-
- last_seen
3642-
- last_usable
36433622
CarrierDetail:
36443623
type: object
36453624
properties:
@@ -3658,12 +3637,6 @@ components:
36583637
confidence:
36593638
type: string
36603639
description: '`high`, `medium` or `low`.'
3661-
required:
3662-
- name
3663-
- mcc
3664-
- mnc
3665-
- country
3666-
- confidence
36673640
SatelliteDetail:
36683641
type: object
36693642
properties:
@@ -3688,14 +3661,6 @@ components:
36883661
confidence:
36893662
type: string
36903663
description: '`high`, `medium` or `low`.'
3691-
required:
3692-
- provider
3693-
- provider_name
3694-
- orbit
3695-
- segment
3696-
- country
3697-
- asn
3698-
- confidence
36993664
SshDetail:
37003665
type: object
37013666
properties:
@@ -3717,13 +3682,6 @@ components:
37173682
last_seen:
37183683
type: string
37193684
description: The last day it did.
3720-
required:
3721-
- port
3722-
- banner
3723-
- host_key_fp
3724-
- session_ok
3725-
- first_seen
3726-
- last_seen
37273685
SmtpDetail:
37283686
type: object
37293687
properties:
@@ -3742,12 +3700,6 @@ components:
37423700
last_seen:
37433701
type: string
37443702
description: The last day it did.
3745-
required:
3746-
- port
3747-
- banner
3748-
- session_ok
3749-
- first_seen
3750-
- last_seen
37513703
WebDetail:
37523704
type: object
37533705
properties:
@@ -3829,13 +3781,6 @@ components:
38293781
last_seen:
38303782
type: string
38313783
description: The last day it did.
3832-
required:
3833-
- port
3834-
- recursion_available
3835-
- rcode
3836-
- answer_correct
3837-
- first_seen
3838-
- last_seen
38393784
BitTorrentDetail:
38403785
type: object
38413786
properties:
@@ -3871,17 +3816,6 @@ components:
38713816
items:
38723817
type: string
38733818
description: The two-letter codes its clients name themselves by.
3874-
required:
3875-
- verified
3876-
- id_matches_ip
3877-
- first_seen
3878-
- last_seen
3879-
- last_reachable
3880-
- days_seen
3881-
- num_ports
3882-
- peak_num_ports
3883-
- indexer
3884-
- clients
38853819
Location:
38863820
type: object
38873821
properties:
@@ -4410,11 +4344,6 @@ components:
44104344
last_seen:
44114345
type: string
44124346
description: The last day.
4413-
required:
4414-
- confidence
4415-
- providers
4416-
- first_seen
4417-
- last_seen
44184347
BatchLookupRequest:
44194348
type: object
44204349
properties:

‎src/internetdata/_core.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,6 @@ def request(
414414
415415
Assembled from the endpoint module's `_get_kwargs` and `_build_response` because its
416416
`sync_detailed` sends through httpx alone, and httpx has no bound on the attempt.
417-
418-
The lookups are not decoded: the spec requires every member of a detail object while
419-
the API answers `{}` under a false flag, so the generated decoder refuses every answer
420-
holding one. `models` reads them, member by member.
421417
"""
422418
http = client.get_httpx_client()
423419
req = http.build_request(**endpoint._get_kwargs(**params), timeout=httpx.Timeout(bound))

‎src/internetdata/_generated/models/bit_torrent_detail.py‎

Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,37 @@
66
from attrs import define as _attrs_define
77
from attrs import field as _attrs_field
88

9+
from ..types import UNSET, Unset
10+
911
T = TypeVar("T", bound="BitTorrentDetail")
1012

1113

1214
@_attrs_define
1315
class BitTorrentDetail:
1416
"""
1517
Attributes:
16-
verified (bool): A client here answered, or two or more reported it at once.
17-
id_matches_ip (bool): A client here derived its node ID from the address (BEP 42).
18-
first_seen (str): The first day a client was seen here.
19-
last_seen (str): The last day.
20-
last_reachable (str): The last day one answered, empty when none did.
21-
days_seen (int): On how many days.
22-
num_ports (int): Distinct ports over the window.
23-
peak_num_ports (int): The most on one day.
24-
indexer (bool): A DHT indexer rather than people.
25-
clients (list[str]): The two-letter codes its clients name themselves by.
18+
verified (bool | Unset): A client here answered, or two or more reported it at once.
19+
id_matches_ip (bool | Unset): A client here derived its node ID from the address (BEP 42).
20+
first_seen (str | Unset): The first day a client was seen here.
21+
last_seen (str | Unset): The last day.
22+
last_reachable (str | Unset): The last day one answered, empty when none did.
23+
days_seen (int | Unset): On how many days.
24+
num_ports (int | Unset): Distinct ports over the window.
25+
peak_num_ports (int | Unset): The most on one day.
26+
indexer (bool | Unset): A DHT indexer rather than people.
27+
clients (list[str] | Unset): The two-letter codes its clients name themselves by.
2628
"""
2729

28-
verified: bool
29-
id_matches_ip: bool
30-
first_seen: str
31-
last_seen: str
32-
last_reachable: str
33-
days_seen: int
34-
num_ports: int
35-
peak_num_ports: int
36-
indexer: bool
37-
clients: list[str]
30+
verified: bool | Unset = UNSET
31+
id_matches_ip: bool | Unset = UNSET
32+
first_seen: str | Unset = UNSET
33+
last_seen: str | Unset = UNSET
34+
last_reachable: str | Unset = UNSET
35+
days_seen: int | Unset = UNSET
36+
num_ports: int | Unset = UNSET
37+
peak_num_ports: int | Unset = UNSET
38+
indexer: bool | Unset = UNSET
39+
clients: list[str] | Unset = UNSET
3840
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
3941

4042
def to_dict(self) -> dict[str, Any]:
@@ -56,49 +58,58 @@ def to_dict(self) -> dict[str, Any]:
5658

5759
indexer = self.indexer
5860

59-
clients = self.clients
61+
clients: list[str] | Unset = UNSET
62+
if not isinstance(self.clients, Unset):
63+
clients = self.clients
6064

6165
field_dict: dict[str, Any] = {}
6266
field_dict.update(self.additional_properties)
63-
field_dict.update(
64-
{
65-
"verified": verified,
66-
"id_matches_ip": id_matches_ip,
67-
"first_seen": first_seen,
68-
"last_seen": last_seen,
69-
"last_reachable": last_reachable,
70-
"days_seen": days_seen,
71-
"num_ports": num_ports,
72-
"peak_num_ports": peak_num_ports,
73-
"indexer": indexer,
74-
"clients": clients,
75-
}
76-
)
67+
field_dict.update({})
68+
if verified is not UNSET:
69+
field_dict["verified"] = verified
70+
if id_matches_ip is not UNSET:
71+
field_dict["id_matches_ip"] = id_matches_ip
72+
if first_seen is not UNSET:
73+
field_dict["first_seen"] = first_seen
74+
if last_seen is not UNSET:
75+
field_dict["last_seen"] = last_seen
76+
if last_reachable is not UNSET:
77+
field_dict["last_reachable"] = last_reachable
78+
if days_seen is not UNSET:
79+
field_dict["days_seen"] = days_seen
80+
if num_ports is not UNSET:
81+
field_dict["num_ports"] = num_ports
82+
if peak_num_ports is not UNSET:
83+
field_dict["peak_num_ports"] = peak_num_ports
84+
if indexer is not UNSET:
85+
field_dict["indexer"] = indexer
86+
if clients is not UNSET:
87+
field_dict["clients"] = clients
7788

7889
return field_dict
7990

8091
@classmethod
8192
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
8293
d = dict(src_dict)
83-
verified = d.pop("verified")
94+
verified = d.pop("verified", UNSET)
8495

85-
id_matches_ip = d.pop("id_matches_ip")
96+
id_matches_ip = d.pop("id_matches_ip", UNSET)
8697

87-
first_seen = d.pop("first_seen")
98+
first_seen = d.pop("first_seen", UNSET)
8899

89-
last_seen = d.pop("last_seen")
100+
last_seen = d.pop("last_seen", UNSET)
90101

91-
last_reachable = d.pop("last_reachable")
102+
last_reachable = d.pop("last_reachable", UNSET)
92103

93-
days_seen = d.pop("days_seen")
104+
days_seen = d.pop("days_seen", UNSET)
94105

95-
num_ports = d.pop("num_ports")
106+
num_ports = d.pop("num_ports", UNSET)
96107

97-
peak_num_ports = d.pop("peak_num_ports")
108+
peak_num_ports = d.pop("peak_num_ports", UNSET)
98109

99-
indexer = d.pop("indexer")
110+
indexer = d.pop("indexer", UNSET)
100111

101-
clients = cast(list[str], d.pop("clients"))
112+
clients = cast(list[str], d.pop("clients", UNSET))
102113

103114
bit_torrent_detail = cls(
104115
verified=verified,

‎src/internetdata/_generated/models/carrier_detail.py‎

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@
66
from attrs import define as _attrs_define
77
from attrs import field as _attrs_field
88

9+
from ..types import UNSET, Unset
10+
911
T = TypeVar("T", bound="CarrierDetail")
1012

1113

1214
@_attrs_define
1315
class CarrierDetail:
1416
"""
1517
Attributes:
16-
name (str): The mobile carrier.
17-
mcc (str): Its mobile country code.
18-
mnc (str): Its mobile network code.
19-
country (str): ISO 3166 country code.
20-
confidence (str): `high`, `medium` or `low`.
18+
name (str | Unset): The mobile carrier.
19+
mcc (str | Unset): Its mobile country code.
20+
mnc (str | Unset): Its mobile network code.
21+
country (str | Unset): ISO 3166 country code.
22+
confidence (str | Unset): `high`, `medium` or `low`.
2123
"""
2224

23-
name: str
24-
mcc: str
25-
mnc: str
26-
country: str
27-
confidence: str
25+
name: str | Unset = UNSET
26+
mcc: str | Unset = UNSET
27+
mnc: str | Unset = UNSET
28+
country: str | Unset = UNSET
29+
confidence: str | Unset = UNSET
2830
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
2931

3032
def to_dict(self) -> dict[str, Any]:
@@ -40,30 +42,32 @@ def to_dict(self) -> dict[str, Any]:
4042

4143
field_dict: dict[str, Any] = {}
4244
field_dict.update(self.additional_properties)
43-
field_dict.update(
44-
{
45-
"name": name,
46-
"mcc": mcc,
47-
"mnc": mnc,
48-
"country": country,
49-
"confidence": confidence,
50-
}
51-
)
45+
field_dict.update({})
46+
if name is not UNSET:
47+
field_dict["name"] = name
48+
if mcc is not UNSET:
49+
field_dict["mcc"] = mcc
50+
if mnc is not UNSET:
51+
field_dict["mnc"] = mnc
52+
if country is not UNSET:
53+
field_dict["country"] = country
54+
if confidence is not UNSET:
55+
field_dict["confidence"] = confidence
5256

5357
return field_dict
5458

5559
@classmethod
5660
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
5761
d = dict(src_dict)
58-
name = d.pop("name")
62+
name = d.pop("name", UNSET)
5963

60-
mcc = d.pop("mcc")
64+
mcc = d.pop("mcc", UNSET)
6165

62-
mnc = d.pop("mnc")
66+
mnc = d.pop("mnc", UNSET)
6367

64-
country = d.pop("country")
68+
country = d.pop("country", UNSET)
6569

66-
confidence = d.pop("confidence")
70+
confidence = d.pop("confidence", UNSET)
6771

6872
carrier_detail = cls(
6973
name=name,

0 commit comments

Comments
 (0)