Skip to content

Commit 1f92b3a

Browse files
authored
Merge branch 'master' into update-models-docs-pr-2412
2 parents d6748cd + 261e2a3 commit 1f92b3a

File tree

5 files changed

+47
-58
lines changed

5 files changed

+47
-58
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ extra_fields = "allow"
226226
allow_population_by_field_name = true
227227
aliases = "datamodel_codegen_aliases.json"
228228
formatters = ["ruff-check", "ruff-format"]
229+
custom_file_header = "# generated by datamodel-codegen"
230+
disable_timestamp = true
229231

230232
[tool.uv]
231233
# Minimal defense against supply-chain atatcks.

src/apify_client/_models.py

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# generated by datamodel-codegen:
2-
# filename: openapi.json
3-
# timestamp: 2026-04-09T11:54:55+00:00
1+
# generated by datamodel-codegen
42

53
from __future__ import annotations
64

@@ -152,8 +150,8 @@ class SourceCodeFile(BaseModel):
152150
extra='allow',
153151
populate_by_name=True,
154152
)
155-
format: SourceCodeFileFormat
156-
content: Annotated[str, Field(examples=["console.log('This is the main.js file');"])]
153+
format: SourceCodeFileFormat | None = None
154+
content: Annotated[str | None, Field(examples=["console.log('This is the main.js file');"])] = None
157155
name: Annotated[str, Field(examples=['src/main.js'])]
158156

159157

@@ -229,14 +227,6 @@ class CommonActorPricingInfo(BaseModel):
229227
reason_for_change: Annotated[str | None, Field(alias='reasonForChange')] = None
230228

231229

232-
@docs_group('Models')
233-
class PricingModel(StrEnum):
234-
PAY_PER_EVENT = 'PAY_PER_EVENT'
235-
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
236-
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
237-
FREE = 'FREE'
238-
239-
240230
@docs_group('Models')
241231
class ActorChargeEvent(BaseModel):
242232
model_config = ConfigDict(
@@ -679,6 +669,27 @@ class ActorNotFoundError(BaseModel):
679669
error: ActorNotFoundErrorDetail | None = None
680670

681671

672+
@docs_group('Models')
673+
class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
674+
model_config = ConfigDict(
675+
extra='allow',
676+
populate_by_name=True,
677+
)
678+
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
679+
"""
680+
Machine-processable error type identifier.
681+
"""
682+
683+
684+
@docs_group('Models')
685+
class RecordOrTokenNotFoundError(BaseModel):
686+
model_config = ConfigDict(
687+
extra='allow',
688+
populate_by_name=True,
689+
)
690+
error: RecordOrTokenNotFoundErrorDetail | None = None
691+
692+
682693
@docs_group('Models')
683694
class RecordNotFoundErrorDetail(ErrorDetail):
684695
model_config = ConfigDict(
@@ -1632,7 +1643,7 @@ class CreateTaskRequest(BaseModel):
16321643
populate_by_name=True,
16331644
)
16341645
act_id: Annotated[str, Field(alias='actId', examples=['asADASadYvn4mBZmm'])]
1635-
name: Annotated[str, Field(examples=['my-task'])]
1646+
name: Annotated[str | None, Field(examples=['my-task'])] = None
16361647
options: TaskOptions | None = None
16371648
input: TaskInput | None = None
16381649
title: str | None = None
@@ -1735,27 +1746,6 @@ class ChargeRunRequest(BaseModel):
17351746
count: Annotated[int, Field(examples=[1])]
17361747

17371748

1738-
@docs_group('Models')
1739-
class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
1740-
model_config = ConfigDict(
1741-
extra='allow',
1742-
populate_by_name=True,
1743-
)
1744-
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
1745-
"""
1746-
Machine-processable error type identifier.
1747-
"""
1748-
1749-
1750-
@docs_group('Models')
1751-
class RecordOrTokenNotFoundError(BaseModel):
1752-
model_config = ConfigDict(
1753-
extra='allow',
1754-
populate_by_name=True,
1755-
)
1756-
error: RecordOrTokenNotFoundErrorDetail | None = None
1757-
1758-
17591749
@docs_group('Models')
17601750
class StorageOwnership(StrEnum):
17611751
OWNED_BY_ME = 'ownedByMe'
@@ -2475,7 +2465,7 @@ class RequestBase(BaseModel):
24752465
"""
24762466
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
24772467
"""
2478-
url: Annotated[AnyUrl | None, Field(examples=['https://apify.com'])] = None
2468+
url: Annotated[str | None, Field(examples=['https://apify.com'])] = None
24792469
"""
24802470
The URL of the request.
24812471
"""
@@ -2488,7 +2478,7 @@ class RequestBase(BaseModel):
24882478
"""
24892479
The final URL that was loaded, after redirects (if any).
24902480
"""
2491-
payload: Annotated[dict[str, Any] | None, Field(examples=[None])] = None
2481+
payload: Annotated[str | dict[str, Any] | None, Field(examples=[None])] = None
24922482
"""
24932483
The request payload, typically used with POST or PUT requests.
24942484
"""
@@ -2553,7 +2543,7 @@ class RequestDraft(BaseModel):
25532543
"""
25542544
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
25552545
"""
2556-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2546+
url: Annotated[str, Field(examples=['https://apify.com'])]
25572547
"""
25582548
The URL of the request.
25592549
"""
@@ -2872,7 +2862,7 @@ class HeadRequest(BaseModel):
28722862
"""
28732863
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
28742864
"""
2875-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2865+
url: Annotated[str, Field(examples=['https://apify.com'])]
28762866
"""
28772867
The URL of the request.
28782868
"""
@@ -2936,7 +2926,7 @@ class LockedHeadRequest(BaseModel):
29362926
"""
29372927
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
29382928
"""
2939-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2929+
url: Annotated[str, Field(examples=['https://apify.com'])]
29402930
"""
29412931
The URL of the request.
29422932
"""
@@ -3037,7 +3027,7 @@ class WebhookCreate(BaseModel):
30373027
idempotency_key: Annotated[str | None, Field(alias='idempotencyKey', examples=['fdSJmdP3nfs7sfk3y'])] = None
30383028
ignore_ssl_errors: Annotated[bool | None, Field(alias='ignoreSslErrors', examples=[False])] = None
30393029
do_not_retry: Annotated[bool | None, Field(alias='doNotRetry', examples=[False])] = None
3040-
request_url: Annotated[AnyUrl, Field(alias='requestUrl', examples=['http://example.com/'])]
3030+
request_url: Annotated[str, Field(alias='requestUrl', examples=['http://example.com/'])]
30413031
payload_template: Annotated[
30423032
str | None, Field(alias='payloadTemplate', examples=['{\\n "userId": {{userId}}...'])
30433033
] = None

src/apify_client/_resource_clients/webhook_collection.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from typing import TYPE_CHECKING, Any
44

5-
from pydantic import AnyUrl
6-
75
from apify_client._docs import docs_group
86
from apify_client._models import (
97
ListOfWebhooks,
@@ -105,7 +103,7 @@ def create(
105103
"""
106104
webhook_create = WebhookCreate(
107105
event_types=list(event_types),
108-
request_url=AnyUrl(request_url),
106+
request_url=request_url,
109107
payload_template=payload_template,
110108
headers_template=headers_template,
111109
ignore_ssl_errors=ignore_ssl_errors,
@@ -208,7 +206,7 @@ async def create(
208206
"""
209207
webhook_create = WebhookCreate(
210208
event_types=list(event_types),
211-
request_url=AnyUrl(request_url),
209+
request_url=request_url,
212210
payload_template=payload_template,
213211
headers_template=headers_template,
214212
ignore_ssl_errors=ignore_ssl_errors,

tests/unit/test_utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import impit
77
import pytest
8-
from pydantic import AnyUrl
98

109
from apify_client._models import WebhookCondition, WebhookCreate, WebhookEventType
1110
from apify_client._resource_clients._resource_client import ResourceClientBase
@@ -39,12 +38,12 @@ def test_webhook_representation_list_to_base64() -> None:
3938
WebhookCreate(
4039
event_types=[WebhookEventType.ACTOR_RUN_CREATED],
4140
condition=WebhookCondition(),
42-
request_url=AnyUrl('https://example.com/run-created'),
41+
request_url='https://example.com/run-created',
4342
),
4443
WebhookCreate(
4544
event_types=[WebhookEventType.ACTOR_RUN_SUCCEEDED],
4645
condition=WebhookCondition(),
47-
request_url=AnyUrl('https://example.com/run-succeeded'),
46+
request_url='https://example.com/run-succeeded',
4847
payload_template='{"hello": "world", "resource":{{resource}}}',
4948
),
5049
]
@@ -77,12 +76,12 @@ def test_webhook_representation_list_from_dicts() -> None:
7776
WebhookCreate(
7877
event_types=[WebhookEventType.ACTOR_RUN_CREATED],
7978
condition=WebhookCondition(),
80-
request_url=AnyUrl('https://example.com/run-created'),
79+
request_url='https://example.com/run-created',
8180
),
8281
WebhookCreate(
8382
event_types=[WebhookEventType.ACTOR_RUN_SUCCEEDED],
8483
condition=WebhookCondition(),
85-
request_url=AnyUrl('https://example.com/run-succeeded'),
84+
request_url='https://example.com/run-succeeded',
8685
payload_template='{"hello": "world"}',
8786
),
8887
]

website/yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7070,13 +7070,13 @@ __metadata:
70707070
linkType: hard
70717071

70727072
"axios@npm:^1.7.9":
7073-
version: 1.13.6
7074-
resolution: "axios@npm:1.13.6"
7073+
version: 1.15.0
7074+
resolution: "axios@npm:1.15.0"
70757075
dependencies:
70767076
follow-redirects: "npm:^1.15.11"
70777077
form-data: "npm:^4.0.5"
7078-
proxy-from-env: "npm:^1.1.0"
7079-
checksum: 10c0/51fb5af055c3b85662fa97df17d986ae2c37d13bf86d50b6bb36b6b3a2dec6966a1d3a14ab3774b71707b155ae3597ed9b7babdf1a1a863d1a31840cb8e7ec71
7078+
proxy-from-env: "npm:^2.1.0"
7079+
checksum: 10c0/47e0f860e98d4d7aa145e89ce0cae00e1fb0f1d2485f065c21fce955ddb1dba4103a46bd0e47acd18a27208a7f62c96249e620db575521b92a968619ab133409
70807080
languageName: node
70817081
linkType: hard
70827082

@@ -15361,10 +15361,10 @@ __metadata:
1536115361
languageName: node
1536215362
linkType: hard
1536315363

15364-
"proxy-from-env@npm:^1.1.0":
15365-
version: 1.1.0
15366-
resolution: "proxy-from-env@npm:1.1.0"
15367-
checksum: 10c0/fe7dd8b1bdbbbea18d1459107729c3e4a2243ca870d26d34c2c1bcd3e4425b7bcc5112362df2d93cc7fb9746f6142b5e272fd1cc5c86ddf8580175186f6ad42b
15364+
"proxy-from-env@npm:^2.1.0":
15365+
version: 2.1.0
15366+
resolution: "proxy-from-env@npm:2.1.0"
15367+
checksum: 10c0/ed01729fd4d094eab619cd7e17ce3698b3413b31eb102c4904f9875e677cd207392795d5b4adee9cec359dfd31c44d5ad7595a3a3ad51c40250e141512281c58
1536815368
languageName: node
1536915369
linkType: hard
1537015370

0 commit comments

Comments
 (0)