airweave-sdk 0.8.65__py3-none-any.whl → 0.8.66__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airweave/__init__.py +41 -43
- airweave/client.py +0 -16
- airweave/collections/__init__.py +3 -6
- airweave/collections/client.py +273 -113
- airweave/collections/raw_client.py +633 -94
- airweave/collections/types/__init__.py +2 -4
- airweave/core/client_wrapper.py +4 -30
- airweave/errors/__init__.py +10 -2
- airweave/errors/conflict_error.py +11 -0
- airweave/errors/not_found_error.py +11 -0
- airweave/errors/too_many_requests_error.py +11 -0
- airweave/errors/unprocessable_entity_error.py +1 -2
- airweave/events/client.py +281 -500
- airweave/events/raw_client.py +562 -551
- airweave/source_connections/client.py +210 -162
- airweave/source_connections/raw_client.py +574 -137
- airweave/sources/client.py +42 -18
- airweave/sources/raw_client.py +118 -17
- airweave/types/__init__.py +33 -39
- airweave/types/{endpoint_secret_out.py → conflict_error_response.py} +12 -2
- airweave/types/delivery_attempt.py +61 -0
- airweave/types/event_message.py +55 -0
- airweave/types/event_message_with_attempts.py +59 -0
- airweave/types/{enable_endpoint_request.py → not_found_error_response.py} +6 -4
- airweave/types/{subscription_with_attempts_out.py → rate_limit_error_response.py} +9 -6
- airweave/types/recovery_task.py +35 -0
- airweave/types/search_request.py +13 -10
- airweave/types/search_response.py +6 -3
- airweave/types/source_connection.py +73 -18
- airweave/types/source_connection_job.py +65 -15
- airweave/types/source_connection_list_item.py +45 -10
- airweave/types/sync_event_payload.py +72 -0
- airweave/types/{recover_out.py → validation_error_detail.py} +19 -6
- airweave/types/validation_error_response.py +30 -0
- airweave/types/webhook_subscription.py +68 -0
- {airweave_sdk-0.8.65.dist-info → airweave_sdk-0.8.66.dist-info}/METADATA +1 -5
- {airweave_sdk-0.8.65.dist-info → airweave_sdk-0.8.66.dist-info}/RECORD +38 -38
- airweave/collections/types/search_collections_readable_id_search_post_response.py +0 -8
- airweave/types/background_task_status.py +0 -5
- airweave/types/background_task_type.py +0 -17
- airweave/types/collection_update.py +0 -35
- airweave/types/endpoint_out.py +0 -35
- airweave/types/message_attempt_out.py +0 -37
- airweave/types/message_attempt_trigger_type.py +0 -3
- airweave/types/message_out.py +0 -29
- airweave/types/message_status.py +0 -3
- airweave/types/message_status_text.py +0 -5
- {airweave_sdk-0.8.65.dist-info → airweave_sdk-0.8.66.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DeliveryAttempt(UniversalBaseModel):
|
|
11
|
+
"""
|
|
12
|
+
A delivery attempt for a webhook message.
|
|
13
|
+
|
|
14
|
+
Each time Airweave attempts to deliver a message to your webhook endpoint,
|
|
15
|
+
a delivery attempt is recorded. Failed attempts are automatically retried
|
|
16
|
+
with exponential backoff.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
id: str = pydantic.Field()
|
|
20
|
+
"""
|
|
21
|
+
Unique identifier for this delivery attempt
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
message_id: str = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
The event message that was being delivered
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
endpoint_id: str = pydantic.Field()
|
|
30
|
+
"""
|
|
31
|
+
The subscription endpoint this was delivered to
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
response: typing.Optional[str] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
The response body returned by your webhook endpoint (truncated to 1KB)
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
response_status_code: int = pydantic.Field()
|
|
40
|
+
"""
|
|
41
|
+
HTTP status code returned by your webhook endpoint. 2xx codes indicate success; other codes trigger retries.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
status: str = pydantic.Field()
|
|
45
|
+
"""
|
|
46
|
+
Delivery status: `success` (2xx response), `pending` (awaiting delivery), or `failed` (non-2xx response or timeout)
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
timestamp: dt.datetime = pydantic.Field()
|
|
50
|
+
"""
|
|
51
|
+
When this delivery attempt occurred (ISO 8601 format, UTC)
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
if IS_PYDANTIC_V2:
|
|
55
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
56
|
+
else:
|
|
57
|
+
|
|
58
|
+
class Config:
|
|
59
|
+
frozen = True
|
|
60
|
+
smart_union = True
|
|
61
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .sync_event_payload import SyncEventPayload
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EventMessage(UniversalBaseModel):
|
|
12
|
+
"""
|
|
13
|
+
An event message that was sent (or attempted) to webhook subscribers.
|
|
14
|
+
|
|
15
|
+
The payload contains the actual event data matching the webhook delivery format.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
id: str = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
Unique identifier for this message (UUID format)
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
event_type: str = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
The type of event (e.g., 'sync.completed', 'sync.failed')
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
payload: SyncEventPayload = pydantic.Field()
|
|
29
|
+
"""
|
|
30
|
+
The event payload data, matching what is delivered to webhooks
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
timestamp: dt.datetime = pydantic.Field()
|
|
34
|
+
"""
|
|
35
|
+
When this message was created (ISO 8601 format, UTC)
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
channels: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
39
|
+
"""
|
|
40
|
+
Channels this message was sent to (typically matches the event type)
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
44
|
+
"""
|
|
45
|
+
Tags associated with this message for filtering
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
if IS_PYDANTIC_V2:
|
|
49
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
50
|
+
else:
|
|
51
|
+
|
|
52
|
+
class Config:
|
|
53
|
+
frozen = True
|
|
54
|
+
smart_union = True
|
|
55
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .delivery_attempt import DeliveryAttempt
|
|
9
|
+
from .sync_event_payload import SyncEventPayload
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EventMessageWithAttempts(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
An event message with delivery attempts.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
id: str = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
Unique identifier for this message (UUID format)
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
event_type: str = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
The type of event (e.g., 'sync.completed', 'sync.failed')
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
payload: SyncEventPayload = pydantic.Field()
|
|
28
|
+
"""
|
|
29
|
+
The event payload data, matching what is delivered to webhooks
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
timestamp: dt.datetime = pydantic.Field()
|
|
33
|
+
"""
|
|
34
|
+
When this message was created (ISO 8601 format, UTC)
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
channels: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
38
|
+
"""
|
|
39
|
+
Channels this message was sent to (typically matches the event type)
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
43
|
+
"""
|
|
44
|
+
Tags associated with this message for filtering
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
delivery_attempts: typing.Optional[typing.List[DeliveryAttempt]] = pydantic.Field(default=None)
|
|
48
|
+
"""
|
|
49
|
+
Delivery attempts for this message.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
if IS_PYDANTIC_V2:
|
|
53
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
54
|
+
else:
|
|
55
|
+
|
|
56
|
+
class Config:
|
|
57
|
+
frozen = True
|
|
58
|
+
smart_union = True
|
|
59
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import datetime as dt
|
|
4
3
|
import typing
|
|
5
4
|
|
|
6
5
|
import pydantic
|
|
7
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
class
|
|
9
|
+
class NotFoundErrorResponse(UniversalBaseModel):
|
|
11
10
|
"""
|
|
12
|
-
|
|
11
|
+
Response returned when a resource is not found (HTTP 404).
|
|
13
12
|
"""
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
detail: str = pydantic.Field()
|
|
15
|
+
"""
|
|
16
|
+
Error message describing what was not found
|
|
17
|
+
"""
|
|
16
18
|
|
|
17
19
|
if IS_PYDANTIC_V2:
|
|
18
20
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -4,17 +4,20 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .endpoint_out import EndpointOut
|
|
8
|
-
from .message_attempt_out import MessageAttemptOut
|
|
9
7
|
|
|
10
8
|
|
|
11
|
-
class
|
|
9
|
+
class RateLimitErrorResponse(UniversalBaseModel):
|
|
12
10
|
"""
|
|
13
|
-
Response
|
|
11
|
+
Response returned when rate limit is exceeded (HTTP 429).
|
|
12
|
+
|
|
13
|
+
The API enforces rate limits to ensure fair usage. When exceeded,
|
|
14
|
+
wait for the duration specified in the Retry-After header before retrying.
|
|
14
15
|
"""
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
detail: str = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
Error message explaining the rate limit
|
|
20
|
+
"""
|
|
18
21
|
|
|
19
22
|
if IS_PYDANTIC_V2:
|
|
20
23
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RecoveryTask(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Information about a message recovery task.
|
|
12
|
+
|
|
13
|
+
When you trigger a recovery of failed messages, this object is returned
|
|
14
|
+
to track the recovery progress. The status indicates whether the recovery
|
|
15
|
+
is still in progress or has completed.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
id: str = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
Unique identifier for this recovery task (Svix internal ID)
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
status: str = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
Recovery task status: 'running' or 'completed'
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
if IS_PYDANTIC_V2:
|
|
29
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic.Extra.allow
|
airweave/types/search_request.py
CHANGED
|
@@ -9,32 +9,35 @@ from .retrieval_strategy import RetrievalStrategy
|
|
|
9
9
|
|
|
10
10
|
class SearchRequest(UniversalBaseModel):
|
|
11
11
|
"""
|
|
12
|
-
Search request
|
|
12
|
+
Search request for querying a collection.
|
|
13
|
+
|
|
14
|
+
Provides fine-grained control over the search pipeline including retrieval strategy,
|
|
15
|
+
filtering, and AI-powered features like query expansion and answer generation.
|
|
13
16
|
"""
|
|
14
17
|
|
|
15
18
|
query: str = pydantic.Field()
|
|
16
19
|
"""
|
|
17
|
-
The search query text
|
|
20
|
+
The search query text (required, max 2048 tokens)
|
|
18
21
|
"""
|
|
19
22
|
|
|
20
23
|
retrieval_strategy: typing.Optional[RetrievalStrategy] = pydantic.Field(default=None)
|
|
21
24
|
"""
|
|
22
|
-
|
|
25
|
+
Search strategy: 'hybrid' (default), 'neural' (semantic only), or 'keyword' (BM25 only)
|
|
23
26
|
"""
|
|
24
27
|
|
|
25
28
|
filter: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
26
29
|
"""
|
|
27
|
-
|
|
30
|
+
Structured filter for metadata-based filtering (Qdrant filter format)
|
|
28
31
|
"""
|
|
29
32
|
|
|
30
33
|
offset: typing.Optional[int] = pydantic.Field(default=None)
|
|
31
34
|
"""
|
|
32
|
-
Number of results to skip
|
|
35
|
+
Number of results to skip for pagination (default: 0)
|
|
33
36
|
"""
|
|
34
37
|
|
|
35
38
|
limit: typing.Optional[int] = pydantic.Field(default=None)
|
|
36
39
|
"""
|
|
37
|
-
Maximum number of results to return
|
|
40
|
+
Maximum number of results to return (default: 1000)
|
|
38
41
|
"""
|
|
39
42
|
|
|
40
43
|
temporal_relevance: typing.Optional[float] = pydantic.Field(default=None)
|
|
@@ -44,22 +47,22 @@ class SearchRequest(UniversalBaseModel):
|
|
|
44
47
|
|
|
45
48
|
expand_query: typing.Optional[bool] = pydantic.Field(default=None)
|
|
46
49
|
"""
|
|
47
|
-
Generate
|
|
50
|
+
Generate query variations to improve recall (default: true)
|
|
48
51
|
"""
|
|
49
52
|
|
|
50
53
|
interpret_filters: typing.Optional[bool] = pydantic.Field(default=None)
|
|
51
54
|
"""
|
|
52
|
-
Extract structured filters from natural
|
|
55
|
+
Extract structured filters from natural language (e.g., 'from last week' becomes a date filter)
|
|
53
56
|
"""
|
|
54
57
|
|
|
55
58
|
rerank: typing.Optional[bool] = pydantic.Field(default=None)
|
|
56
59
|
"""
|
|
57
|
-
|
|
60
|
+
LLM-based reranking for improved relevance (default: true)
|
|
58
61
|
"""
|
|
59
62
|
|
|
60
63
|
generate_answer: typing.Optional[bool] = pydantic.Field(default=None)
|
|
61
64
|
"""
|
|
62
|
-
Generate
|
|
65
|
+
Generate an AI answer based on search results (default: true)
|
|
63
66
|
"""
|
|
64
67
|
|
|
65
68
|
if IS_PYDANTIC_V2:
|
|
@@ -8,17 +8,20 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
8
8
|
|
|
9
9
|
class SearchResponse(UniversalBaseModel):
|
|
10
10
|
"""
|
|
11
|
-
|
|
11
|
+
Search response containing results and optional AI-generated completion.
|
|
12
|
+
|
|
13
|
+
Each result includes the matched entity's content, metadata, relevance score,
|
|
14
|
+
and source information.
|
|
12
15
|
"""
|
|
13
16
|
|
|
14
17
|
results: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
|
|
15
18
|
"""
|
|
16
|
-
Array of search result objects containing the found documents, records, or data entities.
|
|
19
|
+
Array of search result objects containing the found documents, records, or data entities. Each result includes entity_id, source_name, md_content, metadata, score, breadcrumbs, and url.
|
|
17
20
|
"""
|
|
18
21
|
|
|
19
22
|
completion: typing.Optional[str] = pydantic.Field(default=None)
|
|
20
23
|
"""
|
|
21
|
-
|
|
24
|
+
AI-generated natural language answer to your query based on the search results. Only included when generate_answer is true in the request.
|
|
22
25
|
"""
|
|
23
26
|
|
|
24
27
|
if IS_PYDANTIC_V2:
|
|
@@ -14,30 +14,85 @@ from .sync_details import SyncDetails
|
|
|
14
14
|
|
|
15
15
|
class SourceConnection(UniversalBaseModel):
|
|
16
16
|
"""
|
|
17
|
-
Complete source connection details.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
Complete source connection details including auth, config, sync status, and entities.
|
|
18
|
+
|
|
19
|
+
This schema provides full information about a source connection, suitable for
|
|
20
|
+
detail views and monitoring sync progress.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
id: str = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
Unique identifier of the source connection
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
name: str = pydantic.Field()
|
|
29
|
+
"""
|
|
30
|
+
Display name of the connection
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
34
|
+
"""
|
|
35
|
+
Optional description of the connection's purpose
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
short_name: str = pydantic.Field()
|
|
39
|
+
"""
|
|
40
|
+
Source type identifier
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
readable_collection_id: str = pydantic.Field()
|
|
44
|
+
"""
|
|
45
|
+
Collection this connection belongs to
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
status: SourceConnectionStatus = pydantic.Field()
|
|
49
|
+
"""
|
|
50
|
+
Current operational status of the connection
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
created_at: dt.datetime = pydantic.Field()
|
|
54
|
+
"""
|
|
55
|
+
When the connection was created (ISO 8601)
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
modified_at: dt.datetime = pydantic.Field()
|
|
59
|
+
"""
|
|
60
|
+
When the connection was last modified (ISO 8601)
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
auth: AuthenticationDetails = pydantic.Field()
|
|
64
|
+
"""
|
|
65
|
+
Authentication status and details
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
69
|
+
"""
|
|
70
|
+
Source-specific configuration values
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
schedule: typing.Optional[ScheduleDetails] = pydantic.Field(default=None)
|
|
74
|
+
"""
|
|
75
|
+
Sync schedule configuration
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
sync: typing.Optional[SyncDetails] = pydantic.Field(default=None)
|
|
79
|
+
"""
|
|
80
|
+
Sync execution history and statistics
|
|
81
|
+
"""
|
|
82
|
+
|
|
32
83
|
sync_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
33
84
|
"""
|
|
34
|
-
ID of the associated sync
|
|
85
|
+
ID of the associated sync (internal use)
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
entities: typing.Optional[EntitySummary] = pydantic.Field(default=None)
|
|
89
|
+
"""
|
|
90
|
+
Summary of synced entities by type
|
|
35
91
|
"""
|
|
36
92
|
|
|
37
|
-
entities: typing.Optional[EntitySummary] = None
|
|
38
93
|
federated_search: typing.Optional[bool] = pydantic.Field(default=None)
|
|
39
94
|
"""
|
|
40
|
-
Whether this source uses federated search
|
|
95
|
+
Whether this source uses federated (real-time) search instead of syncing
|
|
41
96
|
"""
|
|
42
97
|
|
|
43
98
|
if IS_PYDANTIC_V2:
|
|
@@ -10,21 +10,71 @@ from .sync_job_status import SyncJobStatus
|
|
|
10
10
|
|
|
11
11
|
class SourceConnectionJob(UniversalBaseModel):
|
|
12
12
|
"""
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
A sync job representing a single synchronization run.
|
|
14
|
+
|
|
15
|
+
Sync jobs track the execution of data synchronization from a source connection.
|
|
16
|
+
Each job includes timing information, entity counts, and error details if applicable.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
id: str = pydantic.Field()
|
|
20
|
+
"""
|
|
21
|
+
Unique identifier of the sync job
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
source_connection_id: str = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
ID of the source connection this job belongs to
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
status: SyncJobStatus = pydantic.Field()
|
|
30
|
+
"""
|
|
31
|
+
Current status: PENDING, RUNNING, COMPLETED, FAILED, CANCELLED, or CANCELLING
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
started_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
When the job started execution (ISO 8601)
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
|
40
|
+
"""
|
|
41
|
+
When the job finished (ISO 8601). Null if still running.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
duration_seconds: typing.Optional[float] = pydantic.Field(default=None)
|
|
45
|
+
"""
|
|
46
|
+
Total execution time in seconds. Null if still running.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
entities_inserted: typing.Optional[int] = pydantic.Field(default=None)
|
|
50
|
+
"""
|
|
51
|
+
Number of new entities created during this sync
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
entities_updated: typing.Optional[int] = pydantic.Field(default=None)
|
|
55
|
+
"""
|
|
56
|
+
Number of existing entities updated during this sync
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
entities_deleted: typing.Optional[int] = pydantic.Field(default=None)
|
|
60
|
+
"""
|
|
61
|
+
Number of entities removed during this sync
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
entities_failed: typing.Optional[int] = pydantic.Field(default=None)
|
|
65
|
+
"""
|
|
66
|
+
Number of entities that failed to process
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
error: typing.Optional[str] = pydantic.Field(default=None)
|
|
70
|
+
"""
|
|
71
|
+
Error message if the job failed
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
error_details: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
75
|
+
"""
|
|
76
|
+
Additional error context for debugging
|
|
77
|
+
"""
|
|
28
78
|
|
|
29
79
|
if IS_PYDANTIC_V2:
|
|
30
80
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -11,20 +11,55 @@ from .source_connection_status import SourceConnectionStatus
|
|
|
11
11
|
|
|
12
12
|
class SourceConnectionListItem(UniversalBaseModel):
|
|
13
13
|
"""
|
|
14
|
-
|
|
14
|
+
Lightweight source connection representation for list views.
|
|
15
|
+
|
|
16
|
+
Contains essential fields for display and navigation. For full details
|
|
17
|
+
including sync history and configuration, use the GET /{id} endpoint.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
id: str = pydantic.Field()
|
|
21
|
+
"""
|
|
22
|
+
Unique identifier of the source connection
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: str = pydantic.Field()
|
|
26
|
+
"""
|
|
27
|
+
Display name of the connection
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
short_name: str = pydantic.Field()
|
|
31
|
+
"""
|
|
32
|
+
Source type identifier
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
readable_collection_id: str = pydantic.Field()
|
|
36
|
+
"""
|
|
37
|
+
Collection this connection belongs to
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
created_at: dt.datetime = pydantic.Field()
|
|
41
|
+
"""
|
|
42
|
+
When the connection was created (ISO 8601)
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
modified_at: dt.datetime = pydantic.Field()
|
|
46
|
+
"""
|
|
47
|
+
When the connection was last modified (ISO 8601)
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
is_authenticated: bool = pydantic.Field()
|
|
51
|
+
"""
|
|
52
|
+
Whether the connection has valid credentials
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
entity_count: typing.Optional[int] = pydantic.Field(default=None)
|
|
56
|
+
"""
|
|
57
|
+
Total number of entities synced from this connection
|
|
15
58
|
"""
|
|
16
59
|
|
|
17
|
-
id: str
|
|
18
|
-
name: str
|
|
19
|
-
short_name: str
|
|
20
|
-
readable_collection_id: str
|
|
21
|
-
created_at: dt.datetime
|
|
22
|
-
modified_at: dt.datetime
|
|
23
|
-
is_authenticated: bool
|
|
24
|
-
entity_count: typing.Optional[int] = None
|
|
25
60
|
federated_search: typing.Optional[bool] = pydantic.Field(default=None)
|
|
26
61
|
"""
|
|
27
|
-
Whether this source uses federated search
|
|
62
|
+
Whether this source uses federated (real-time) search instead of syncing
|
|
28
63
|
"""
|
|
29
64
|
|
|
30
65
|
auth_method: AuthenticationMethod = pydantic.Field()
|