Skip to content

Commit 196fc7e

Browse files
fix(compat): compat with pydantic<2.8.0 when using additional fields
1 parent d4c7ac1 commit 196fc7e

31 files changed

Lines changed: 186 additions & 31 deletions

src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class SummaryModelResponse(BaseModel):

src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class SummaryTaskResponse(BaseModel):

src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class TimeseriesGroupTimeseriesGroupsResponse(BaseModel):

src/cloudflare/types/radar/ai/timeseries_group_timeseries_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,14 @@ class TimeseriesGroupTimeseriesResponse(BaseModel):
104104
meta: Meta
105105
"""Metadata for the results."""
106106

107-
__pydantic_extra__: Dict[str, TimeseriesGroupTimeseriesResponseItem] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
108107
if TYPE_CHECKING:
108+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
109+
# value to this field, so for compatibility we avoid doing it at runtime.
110+
__pydantic_extra__: Dict[str, TimeseriesGroupTimeseriesResponseItem] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
111+
109112
# Stub to indicate that arbitrary properties are accepted.
110113
# To access properties that are not valid identifiers you can use `getattr`, e.g.
111114
# `getattr(obj, '$type')`
112115
def __getattr__(self, attr: str) -> TimeseriesGroupTimeseriesResponseItem: ...
116+
else:
117+
__pydantic_extra__: Dict[str, TimeseriesGroupTimeseriesResponseItem]

src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class TimeseriesGroupUserAgentResponse(BaseModel):

src/cloudflare/types/radar/as112/timeseries_group_query_type_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class TimeseriesGroupQueryTypeResponse(BaseModel):

src/cloudflare/types/radar/as112/timeseries_group_response_codes_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class TimeseriesGroupResponseCodesResponse(BaseModel):

src/cloudflare/types/radar/as112_timeseries_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,14 @@ class AS112TimeseriesResponse(BaseModel):
104104
meta: Meta
105105
"""Metadata for the results."""
106106

107-
__pydantic_extra__: Dict[str, AS112TimeseriesResponseItem] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
108107
if TYPE_CHECKING:
108+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
109+
# value to this field, so for compatibility we avoid doing it at runtime.
110+
__pydantic_extra__: Dict[str, AS112TimeseriesResponseItem] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
111+
109112
# Stub to indicate that arbitrary properties are accepted.
110113
# To access properties that are not valid identifiers you can use `getattr`, e.g.
111114
# `getattr(obj, '$type')`
112115
def __getattr__(self, attr: str) -> AS112TimeseriesResponseItem: ...
116+
else:
117+
__pydantic_extra__: Dict[str, AS112TimeseriesResponseItem]

src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class TimeseriesGroupIndustryResponse(BaseModel):

src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ class Meta(BaseModel):
9797
class Serie0(BaseModel):
9898
timestamps: List[datetime]
9999

100-
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
101100
if TYPE_CHECKING:
101+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
102+
# value to this field, so for compatibility we avoid doing it at runtime.
103+
__pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
104+
102105
# Stub to indicate that arbitrary properties are accepted.
103106
# To access properties that are not valid identifiers you can use `getattr`, e.g.
104107
# `getattr(obj, '$type')`
105108
def __getattr__(self, attr: str) -> List[str]: ...
109+
else:
110+
__pydantic_extra__: Dict[str, List[str]]
106111

107112

108113
class TimeseriesGroupVectorResponse(BaseModel):

0 commit comments

Comments
 (0)