Skip to content

Commit 3bbbe3f

Browse files
committed
fix: resolve pre-existing mypy errors in webhook and to_markdown types
- Remove duplicate notification_url field in webhook_update_response.py and webhook_get_response.py (mypy no-redef) - Move type: ignore[call-arg] to _get_api_list call site in radar/ai/to_markdown.py and ai/to_markdown.py (mypy reports error on the call line, not the keyword argument line)
1 parent 85f2965 commit 3bbbe3f

4 files changed

Lines changed: 8 additions & 14 deletions

File tree

src/cloudflare/resources/ai/to_markdown.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def transform(
115115
# sent to the server will contain a `boundary` parameter, e.g.
116116
# multipart/form-data; boundary=---abc--
117117
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
118-
return self._get_api_list(
118+
return self._get_api_list( # type: ignore[call-arg]
119119
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
120120
page=SyncSinglePage[ToMarkdownTransformResponse],
121121
body=maybe_transform(body, to_markdown_transform_params.ToMarkdownTransformParams),
122-
files=files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
122+
files=files, # pyright: ignore[reportCallIssue]
123123
options=make_request_options(
124124
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
125125
),
@@ -218,11 +218,11 @@ def transform(
218218
# sent to the server will contain a `boundary` parameter, e.g.
219219
# multipart/form-data; boundary=---abc--
220220
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
221-
return self._get_api_list(
221+
return self._get_api_list( # type: ignore[call-arg]
222222
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
223223
page=AsyncSinglePage[ToMarkdownTransformResponse],
224224
body=maybe_transform(body, to_markdown_transform_params.ToMarkdownTransformParams),
225-
files=files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
225+
files=files, # pyright: ignore[reportCallIssue]
226226
options=make_request_options(
227227
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
228228
),

src/cloudflare/resources/radar/ai/to_markdown.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ def create(
9090
# sent to the server will contain a `boundary` parameter, e.g.
9191
# multipart/form-data; boundary=---abc--
9292
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
93-
return self._get_api_list(
93+
return self._get_api_list( # type: ignore[call-arg]
9494
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
9595
page=SyncSinglePage[ToMarkdownCreateResponse],
9696
body=maybe_transform(body, to_markdown_create_params.ToMarkdownCreateParams),
97-
files=extracted_files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
97+
files=extracted_files, # pyright: ignore[reportCallIssue]
9898
options=make_request_options(
9999
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
100100
),
@@ -160,11 +160,11 @@ def create(
160160
# sent to the server will contain a `boundary` parameter, e.g.
161161
# multipart/form-data; boundary=---abc--
162162
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
163-
return self._get_api_list(
163+
return self._get_api_list( # type: ignore[call-arg]
164164
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
165165
page=AsyncSinglePage[ToMarkdownCreateResponse],
166166
body=maybe_transform(body, to_markdown_create_params.ToMarkdownCreateParams),
167-
files=extracted_files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
167+
files=extracted_files, # pyright: ignore[reportCallIssue]
168168
options=make_request_options(
169169
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
170170
),

src/cloudflare/types/stream/webhook_get_response.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ class WebhookGetResponse(BaseModel):
1414
modified: Optional[datetime] = None
1515
"""The date and time the webhook was last modified."""
1616

17-
notification_url: Optional[str] = None
18-
"""The URL where webhooks will be sent."""
19-
2017
notification_url: Optional[str] = FieldInfo(alias="notificationUrl", default=None)
2118
"""The URL where webhooks will be sent."""
2219

src/cloudflare/types/stream/webhook_update_response.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ class WebhookUpdateResponse(BaseModel):
1414
modified: Optional[datetime] = None
1515
"""The date and time the webhook was last modified."""
1616

17-
notification_url: Optional[str] = None
18-
"""The URL where webhooks will be sent."""
19-
2017
notification_url: Optional[str] = FieldInfo(alias="notificationUrl", default=None)
2118
"""The URL where webhooks will be sent."""
2219

0 commit comments

Comments
 (0)