1# generated by datamodel-codegen:
2# filename: http://0.0.0.0:8080/execution/openapi.json
3# version: 0.33.0
4
5# Licensed to the Apache Software Foundation (ASF) under one
6# or more contributor license agreements. See the NOTICE file
7# distributed with this work for additional information
8# regarding copyright ownership. The ASF licenses this file
9# to you under the Apache License, Version 2.0 (the
10# "License"); you may not use this file except in compliance
11# with the License. You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing,
16# software distributed under the License is distributed on an
17# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18# KIND, either express or implied. See the License for the
19# specific language governing permissions and limitations
20# under the License.
21from __future__ import annotations
22
23from datetime import timedelta
24from enum import Enum
25from typing import Annotated, Any, Final, Literal
26from uuid import UUID
27
28from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, JsonValue, RootModel
29
30API_VERSION: Final[str] = "2026-06-30"
31
32
33class AssetAliasReferenceAssetEventDagRun(BaseModel):
34 """
35 Schema for AssetAliasModel used in AssetEventDagRunReference.
36 """
37
38 model_config = ConfigDict(
39 extra="forbid",
40 )
41 name: Annotated[str, Field(title="Name")]
42
43
44class AssetProfile(BaseModel):
45 """
46 Profile of an asset-like object.
47
48 Asset will have name, uri defined, with type set to 'Asset'.
49 AssetNameRef will have name defined, type set to 'AssetNameRef'.
50 AssetUriRef will have uri defined, type set to 'AssetUriRef'.
51 AssetAlias will have name defined, type set to 'AssetAlias'.
52
53 Note that 'type' here is distinct from 'asset_type' the user declares on an
54 Asset (or subclass). This field is for distinguishing between different
55 asset-related types (Asset, AssetRef, or AssetAlias).
56 """
57
58 model_config = ConfigDict(
59 extra="forbid",
60 )
61 name: Annotated[str | None, Field(title="Name")] = None
62 uri: Annotated[str | None, Field(title="Uri")] = None
63 type: Annotated[str, Field(title="Type")]
64
65
66class ConnectionResponse(BaseModel):
67 """
68 Connection schema for responses with fields that are needed for Runtime.
69 """
70
71 conn_id: Annotated[str, Field(title="Conn Id")]
72 conn_type: Annotated[str, Field(title="Conn Type")]
73 host: Annotated[str | None, Field(title="Host")] = None
74 schema_: Annotated[str | None, Field(alias="schema", title="Schema")] = None
75 login: Annotated[str | None, Field(title="Login")] = None
76 password: Annotated[str | None, Field(title="Password")] = None
77 port: Annotated[int | None, Field(title="Port")] = None
78 extra: Annotated[str | None, Field(title="Extra")] = None
79
80
81class ConnectionTestConnectionResponse(BaseModel):
82 """
83 Connection data returned to workers from a test request.
84 """
85
86 conn_id: Annotated[str, Field(title="Conn Id")]
87 conn_type: Annotated[str, Field(title="Conn Type")]
88 host: Annotated[str | None, Field(title="Host")] = None
89 login: Annotated[str | None, Field(title="Login")] = None
90 password: Annotated[str | None, Field(title="Password")] = None
91 schema_: Annotated[str | None, Field(alias="schema", title="Schema")] = None
92 port: Annotated[int | None, Field(title="Port")] = None
93 extra: Annotated[str | None, Field(title="Extra")] = None
94
95
96class ResultMessage(RootModel[str]):
97 root: Annotated[str, Field(max_length=2000, title="Result Message")]
98
99
100class ConnectionTestState(str, Enum):
101 """
102 All possible states of a connection test.
103 """
104
105 PENDING = "pending"
106 QUEUED = "queued"
107 RUNNING = "running"
108 SUCCESS = "success"
109 FAILED = "failed"
110
111
112class DagResponse(BaseModel):
113 """
114 Schema for DAG response.
115 """
116
117 dag_id: Annotated[str, Field(title="Dag Id")]
118 is_paused: Annotated[bool, Field(title="Is Paused")]
119 bundle_name: Annotated[str | None, Field(title="Bundle Name")] = None
120 bundle_version: Annotated[str | None, Field(title="Bundle Version")] = None
121 relative_fileloc: Annotated[str | None, Field(title="Relative Fileloc")] = None
122 owners: Annotated[str | None, Field(title="Owners")] = None
123 tags: Annotated[list[str], Field(title="Tags")]
124 next_dagrun: Annotated[AwareDatetime | None, Field(title="Next Dagrun")] = None
125
126
127class DagRunAssetReference(BaseModel):
128 """
129 DagRun serializer for asset responses.
130 """
131
132 model_config = ConfigDict(
133 extra="forbid",
134 )
135 run_id: Annotated[str, Field(title="Run Id")]
136 dag_id: Annotated[str, Field(title="Dag Id")]
137 logical_date: Annotated[AwareDatetime | None, Field(title="Logical Date")] = None
138 start_date: Annotated[AwareDatetime, Field(title="Start Date")]
139 end_date: Annotated[AwareDatetime | None, Field(title="End Date")] = None
140 state: Annotated[str, Field(title="State")]
141 data_interval_start: Annotated[AwareDatetime | None, Field(title="Data Interval Start")] = None
142 data_interval_end: Annotated[AwareDatetime | None, Field(title="Data Interval End")] = None
143 partition_key: Annotated[str | None, Field(title="Partition Key")] = None
144
145
146class DagRunState(str, Enum):
147 """
148 All possible states that a DagRun can be in.
149
150 These are "shared" with TaskInstanceState in some parts of the code,
151 so please ensure that their values always match the ones with the
152 same name in TaskInstanceState.
153 """
154
155 QUEUED = "queued"
156 RUNNING = "running"
157 SUCCESS = "success"
158 FAILED = "failed"
159
160
161class DagRunStateResponse(BaseModel):
162 """
163 Schema for DAG Run State response.
164 """
165
166 state: DagRunState
167
168
169class DagRunType(str, Enum):
170 """
171 Class with DagRun types.
172 """
173
174 BACKFILL = "backfill"
175 SCHEDULED = "scheduled"
176 MANUAL = "manual"
177 OPERATOR_TRIGGERED = "operator_triggered"
178 ASSET_TRIGGERED = "asset_triggered"
179 ASSET_MATERIALIZATION = "asset_materialization"
180
181
182class HITLUser(BaseModel):
183 """
184 Schema for a Human-in-the-loop users.
185 """
186
187 id: Annotated[str, Field(title="Id")]
188 name: Annotated[str, Field(title="Name")]
189
190
191class HTTPExceptionResponse(BaseModel):
192 """
193 HTTPException Model used for error response.
194 """
195
196 detail: Annotated[str | dict[str, Any], Field(title="Detail")]
197
198
199class InactiveAssetsResponse(BaseModel):
200 """
201 Response for inactive assets.
202 """
203
204 inactive_assets: Annotated[list[AssetProfile] | None, Field(title="Inactive Assets")] = None
205
206
207class IntermediateTIState(str, Enum):
208 """
209 States that a Task Instance can be in that indicate it is not yet in a terminal or running state.
210 """
211
212 SCHEDULED = "scheduled"
213 QUEUED = "queued"
214 RESTARTING = "restarting"
215 UP_FOR_RETRY = "up_for_retry"
216 UP_FOR_RESCHEDULE = "up_for_reschedule"
217 DEFERRED = "deferred"
218 AWAITING_INPUT = "awaiting_input"
219
220
221class PrevSuccessfulDagRunResponse(BaseModel):
222 """
223 Schema for response with previous successful DagRun information for Task Template Context.
224 """
225
226 data_interval_start: Annotated[AwareDatetime | None, Field(title="Data Interval Start")] = None
227 data_interval_end: Annotated[AwareDatetime | None, Field(title="Data Interval End")] = None
228 start_date: Annotated[AwareDatetime | None, Field(title="Start Date")] = None
229 end_date: Annotated[AwareDatetime | None, Field(title="End Date")] = None
230
231
232class PreviousTIResponse(BaseModel):
233 """
234 Schema for response with previous TaskInstance information.
235 """
236
237 task_id: Annotated[str, Field(title="Task Id")]
238 dag_id: Annotated[str, Field(title="Dag Id")]
239 run_id: Annotated[str, Field(title="Run Id")]
240 logical_date: Annotated[AwareDatetime | None, Field(title="Logical Date")] = None
241 start_date: Annotated[AwareDatetime | None, Field(title="Start Date")] = None
242 end_date: Annotated[AwareDatetime | None, Field(title="End Date")] = None
243 state: Annotated[str | None, Field(title="State")] = None
244 try_number: Annotated[int, Field(title="Try Number")]
245 map_index: Annotated[int | None, Field(title="Map Index")] = -1
246 duration: Annotated[float | None, Field(title="Duration")] = None
247
248
249class TIAwaitingInputStatePayload(BaseModel):
250 """
251 Schema for parking a TaskInstance in an awaiting_input state (Human-in-the-loop, no trigger).
252 """
253
254 model_config = ConfigDict(
255 extra="forbid",
256 )
257 state: Annotated[Literal["awaiting_input"] | None, Field(title="State")] = "awaiting_input"
258 timeout: Annotated[timedelta | None, Field(title="Timeout")] = None
259 next_method: Annotated[str, Field(title="Next Method")]
260 next_kwargs: Annotated[dict[str, JsonValue] | None, Field(title="Next Kwargs")] = None
261 rendered_map_index: Annotated[str | None, Field(title="Rendered Map Index")] = None
262
263
264class TIDeferredStatePayload(BaseModel):
265 """
266 Schema for updating TaskInstance to a deferred state.
267 """
268
269 model_config = ConfigDict(
270 extra="forbid",
271 )
272 state: Annotated[Literal["deferred"] | None, Field(title="State")] = "deferred"
273 classpath: Annotated[str, Field(title="Classpath")]
274 trigger_kwargs: Annotated[dict[str, JsonValue] | str | None, Field(title="Trigger Kwargs")] = None
275 trigger_timeout: Annotated[timedelta | None, Field(title="Trigger Timeout")] = None
276 queue: Annotated[str | None, Field(title="Queue")] = None
277 next_method: Annotated[str, Field(title="Next Method")]
278 next_kwargs: Annotated[dict[str, JsonValue] | None, Field(title="Next Kwargs")] = None
279 rendered_map_index: Annotated[str | None, Field(title="Rendered Map Index")] = None
280
281
282class TIEnterRunningPayload(BaseModel):
283 """
284 Schema for updating TaskInstance to 'RUNNING' state with minimal required fields.
285 """
286
287 model_config = ConfigDict(
288 extra="forbid",
289 )
290 state: Annotated[Literal["running"] | None, Field(title="State")] = "running"
291 hostname: Annotated[str, Field(title="Hostname")]
292 unixname: Annotated[str, Field(title="Unixname")]
293 pid: Annotated[int, Field(title="Pid")]
294 start_date: Annotated[AwareDatetime, Field(title="Start Date")]
295
296
297class TIHeartbeatInfo(BaseModel):
298 """
299 Schema for TaskInstance heartbeat endpoint.
300 """
301
302 model_config = ConfigDict(
303 extra="forbid",
304 )
305 hostname: Annotated[str, Field(title="Hostname")]
306 pid: Annotated[int, Field(title="Pid")]
307
308
309class TIRescheduleStatePayload(BaseModel):
310 """
311 Schema for updating TaskInstance to a up_for_reschedule state.
312 """
313
314 model_config = ConfigDict(
315 extra="forbid",
316 )
317 state: Annotated[Literal["up_for_reschedule"] | None, Field(title="State")] = "up_for_reschedule"
318 reschedule_date: Annotated[AwareDatetime, Field(title="Reschedule Date")]
319 end_date: Annotated[AwareDatetime, Field(title="End Date")]
320
321
322class TIRetryStatePayload(BaseModel):
323 """
324 Schema for updating TaskInstance to up_for_retry.
325 """
326
327 model_config = ConfigDict(
328 extra="forbid",
329 )
330 state: Annotated[Literal["up_for_retry"] | None, Field(title="State")] = "up_for_retry"
331 end_date: Annotated[AwareDatetime, Field(title="End Date")]
332 rendered_map_index: Annotated[str | None, Field(title="Rendered Map Index")] = None
333 retry_delay_seconds: Annotated[float | None, Field(title="Retry Delay Seconds")] = None
334 retry_reason: Annotated[str | None, Field(title="Retry Reason")] = None
335
336
337class TISkippedDownstreamTasksStatePayload(BaseModel):
338 """
339 Schema for updating downstream tasks to a skipped state.
340 """
341
342 model_config = ConfigDict(
343 extra="forbid",
344 )
345 tasks: Annotated[list[str | tuple[str, int]], Field(title="Tasks")]
346
347
348class TISuccessStatePayload(BaseModel):
349 """
350 Schema for updating TaskInstance to success state.
351 """
352
353 model_config = ConfigDict(
354 extra="forbid",
355 )
356 state: Annotated[Literal["success"] | None, Field(title="State")] = "success"
357 end_date: Annotated[AwareDatetime, Field(title="End Date")]
358 task_outlets: Annotated[list[AssetProfile] | None, Field(title="Task Outlets")] = None
359 outlet_events: Annotated[list[dict[str, Any]] | None, Field(title="Outlet Events")] = None
360 rendered_map_index: Annotated[str | None, Field(title="Rendered Map Index")] = None
361
362
363class TITargetStatePayload(BaseModel):
364 """
365 Schema for updating TaskInstance to a target state, excluding terminal and running states.
366 """
367
368 model_config = ConfigDict(
369 extra="forbid",
370 )
371 state: IntermediateTIState
372
373
374class TaskBreadcrumbsResponse(BaseModel):
375 """
376 Response for task breadcrumbs.
377 """
378
379 breadcrumbs: Annotated[list[dict[str, Any]], Field(title="Breadcrumbs")]
380
381
382class TaskInstanceState(str, Enum):
383 """
384 All possible states that a Task Instance can be in.
385
386 Note that None is also allowed, so always use this in a type hint with Optional.
387 """
388
389 REMOVED = "removed"
390 SCHEDULED = "scheduled"
391 QUEUED = "queued"
392 RUNNING = "running"
393 SUCCESS = "success"
394 RESTARTING = "restarting"
395 FAILED = "failed"
396 UP_FOR_RETRY = "up_for_retry"
397 UP_FOR_RESCHEDULE = "up_for_reschedule"
398 UPSTREAM_FAILED = "upstream_failed"
399 SKIPPED = "skipped"
400 DEFERRED = "deferred"
401 AWAITING_INPUT = "awaiting_input"
402
403
404class TaskStateStorePutBody(BaseModel):
405 """
406 Request body for setting a task state store value.
407 """
408
409 model_config = ConfigDict(
410 extra="forbid",
411 )
412 value: JsonValue
413 expires_at: Annotated[AwareDatetime | None, Field(title="Expires At")] = None
414
415
416class TaskStateStoreResponse(BaseModel):
417 """
418 Task state store value returned to a worker.
419 """
420
421 model_config = ConfigDict(
422 extra="forbid",
423 )
424 value: JsonValue
425
426
427class TaskStatesResponse(BaseModel):
428 """
429 Response for task states with run_id, task and state.
430 """
431
432 task_states: Annotated[dict[str, Any], Field(title="Task States")]
433
434
435class TerminalStateNonSuccess(str, Enum):
436 """
437 TaskInstance states that can be reported without extra information.
438 """
439
440 FAILED = "failed"
441 SKIPPED = "skipped"
442 REMOVED = "removed"
443 UPSTREAM_FAILED = "upstream_failed"
444
445
446class TriggerDAGRunPayload(BaseModel):
447 """
448 Schema for Trigger DAG Run API request.
449 """
450
451 model_config = ConfigDict(
452 extra="forbid",
453 )
454 logical_date: Annotated[AwareDatetime | None, Field(title="Logical Date")] = None
455 run_after: Annotated[AwareDatetime | None, Field(title="Run After")] = None
456 conf: Annotated[dict[str, Any] | None, Field(title="Conf")] = None
457 reset_dag_run: Annotated[bool | None, Field(title="Reset Dag Run")] = False
458 partition_key: Annotated[str | None, Field(title="Partition Key")] = None
459 note: Annotated[str | None, Field(title="Note")] = None
460
461
462class UpdateHITLDetailPayload(BaseModel):
463 """
464 Schema for writing the response part of a Human-in-the-loop detail for a specific task instance.
465 """
466
467 ti_id: Annotated[UUID, Field(title="Ti Id")]
468 chosen_options: Annotated[list[str], Field(min_length=1, title="Chosen Options")]
469 params_input: Annotated[dict[str, Any] | None, Field(title="Params Input")] = None
470
471
472class ValidationError(BaseModel):
473 loc: Annotated[list[str | int], Field(title="Location")]
474 msg: Annotated[str, Field(title="Message")]
475 type: Annotated[str, Field(title="Error Type")]
476 input: Annotated[Any | None, Field(title="Input")] = None
477 ctx: Annotated[dict[str, Any] | None, Field(title="Context")] = None
478
479
480class VariableKeysResponse(BaseModel):
481 """
482 Variable keys schema for list responses.
483 """
484
485 model_config = ConfigDict(
486 extra="forbid",
487 )
488 keys: Annotated[list[str], Field(title="Keys")]
489 total_entries: Annotated[int, Field(title="Total Entries")]
490
491
492class VariablePostBody(BaseModel):
493 """
494 Request body schema for creating variables.
495 """
496
497 model_config = ConfigDict(
498 extra="forbid",
499 )
500 val: Annotated[str | None, Field(title="Val")] = None
501 description: Annotated[str | None, Field(title="Description")] = None
502
503
504class VariableResponse(BaseModel):
505 """
506 Variable schema for responses with fields that are needed for Runtime.
507 """
508
509 model_config = ConfigDict(
510 extra="forbid",
511 )
512 key: Annotated[str, Field(title="Key")]
513 value: Annotated[str | None, Field(title="Value")] = None
514
515
516class XComResponse(BaseModel):
517 """
518 XCom schema for responses with fields that are needed for Runtime.
519 """
520
521 key: Annotated[str, Field(title="Key")]
522 value: JsonValue
523
524
525class XComSequenceIndexResponse(RootModel[JsonValue]):
526 root: Annotated[
527 JsonValue,
528 Field(
529 description="XCom schema with minimal structure for index-based access.",
530 title="XComSequenceIndexResponse",
531 ),
532 ]
533
534
535class XComSequenceSliceResponse(RootModel[list[JsonValue]]):
536 """
537 XCom schema with minimal structure for slice-based access.
538 """
539
540 root: Annotated[
541 list[JsonValue],
542 Field(
543 description="XCom schema with minimal structure for slice-based access.",
544 title="XComSequenceSliceResponse",
545 ),
546 ]
547
548
549class TaskInstance(BaseModel):
550 """
551 Schema for TaskInstance model with minimal required fields needed for Runtime.
552 """
553
554 id: Annotated[UUID, Field(title="Id")]
555 task_id: Annotated[str, Field(title="Task Id")]
556 dag_id: Annotated[str, Field(title="Dag Id")]
557 run_id: Annotated[str, Field(title="Run Id")]
558 try_number: Annotated[int, Field(title="Try Number")]
559 dag_version_id: Annotated[UUID, Field(title="Dag Version Id")]
560 map_index: Annotated[int | None, Field(title="Map Index")] = -1
561 hostname: Annotated[str | None, Field(title="Hostname")] = None
562 context_carrier: Annotated[dict[str, Any] | None, Field(title="Context Carrier")] = None
563 queue: Annotated[str | None, Field(title="Queue")] = "default"
564
565
566class BundleInfo(BaseModel):
567 """
568 Schema for telling task which bundle to run with.
569 """
570
571 name: Annotated[str, Field(title="Name")]
572 version: Annotated[str | None, Field(title="Version")] = None
573 version_data: Annotated[dict[str, Any] | None, Field(title="Version Data")] = None
574
575
576class TerminalTIState(str, Enum):
577 SUCCESS = "success"
578 FAILED = "failed"
579 SKIPPED = "skipped"
580 UPSTREAM_FAILED = "upstream_failed"
581 REMOVED = "removed"
582
583
584class WeightRule(str, Enum):
585 DOWNSTREAM = "downstream"
586 UPSTREAM = "upstream"
587 ABSOLUTE = "absolute"
588
589
590class TriggerRule(str, Enum):
591 ALL_SUCCESS = "all_success"
592 ALL_FAILED = "all_failed"
593 ALL_DONE = "all_done"
594 ALL_DONE_MIN_ONE_SUCCESS = "all_done_min_one_success"
595 ALL_DONE_SETUP_SUCCESS = "all_done_setup_success"
596 ONE_SUCCESS = "one_success"
597 ONE_FAILED = "one_failed"
598 ONE_DONE = "one_done"
599 NONE_FAILED = "none_failed"
600 NONE_SKIPPED = "none_skipped"
601 ALWAYS = "always"
602 NONE_FAILED_MIN_ONE_SUCCESS = "none_failed_min_one_success"
603 ALL_SKIPPED = "all_skipped"
604
605
606class DagAttributeTypes(str, Enum):
607 OP = "operator"
608 TASK_GROUP = "taskgroup"
609
610
611class AssetReferenceAssetEventDagRun(BaseModel):
612 """
613 Schema for AssetModel used in AssetEventDagRunReference.
614 """
615
616 model_config = ConfigDict(
617 extra="forbid",
618 )
619 name: Annotated[str, Field(title="Name")]
620 uri: Annotated[str, Field(title="Uri")]
621 extra: Annotated[dict[str, JsonValue], Field(title="Extra")]
622
623
624class AssetResponse(BaseModel):
625 """
626 Asset schema for responses with fields that are needed for Runtime.
627 """
628
629 name: Annotated[str, Field(title="Name")]
630 uri: Annotated[str, Field(title="Uri")]
631 group: Annotated[str, Field(title="Group")]
632 extra: Annotated[dict[str, JsonValue] | None, Field(title="Extra")] = None
633
634
635class AssetStateStorePutBody(BaseModel):
636 """
637 Request body for setting an asset state store value.
638 """
639
640 model_config = ConfigDict(
641 extra="forbid",
642 )
643 value: JsonValue
644
645
646class AssetStateStoreResponse(BaseModel):
647 """
648 Asset state store value returned to a worker.
649 """
650
651 model_config = ConfigDict(
652 extra="forbid",
653 )
654 value: JsonValue
655
656
657class ConnectionTestResultBody(BaseModel):
658 """
659 Result a worker reports back for a connection test.
660 """
661
662 model_config = ConfigDict(
663 extra="forbid",
664 )
665 state: ConnectionTestState
666 result_message: Annotated[ResultMessage | None, Field(title="Result Message")] = None
667
668
669class HITLDetailRequest(BaseModel):
670 """
671 Schema for the request part of a Human-in-the-loop detail for a specific task instance.
672 """
673
674 ti_id: Annotated[UUID, Field(title="Ti Id")]
675 options: Annotated[list[str], Field(min_length=1, title="Options")]
676 subject: Annotated[str, Field(title="Subject")]
677 body: Annotated[str | None, Field(title="Body")] = None
678 defaults: Annotated[list[str] | None, Field(title="Defaults")] = None
679 multiple: Annotated[bool | None, Field(title="Multiple")] = False
680 params: Annotated[dict[str, Any] | None, Field(title="Params")] = None
681 assigned_users: Annotated[list[HITLUser] | None, Field(title="Assigned Users")] = None
682
683
684class HITLDetailResponse(BaseModel):
685 """
686 Schema for the response part of a Human-in-the-loop detail for a specific task instance.
687 """
688
689 response_received: Annotated[bool, Field(title="Response Received")]
690 responded_by_user: HITLUser | None = None
691 responded_at: Annotated[AwareDatetime | None, Field(title="Responded At")] = None
692 chosen_options: Annotated[list[str] | None, Field(title="Chosen Options")] = None
693 params_input: Annotated[dict[str, Any] | None, Field(title="Params Input")] = None
694
695
696class HTTPValidationError(BaseModel):
697 detail: Annotated[list[ValidationError] | None, Field(title="Detail")] = None
698
699
700class TITerminalStatePayload(BaseModel):
701 """
702 Schema for updating TaskInstance to a terminal state except SUCCESS state.
703 """
704
705 model_config = ConfigDict(
706 extra="forbid",
707 )
708 state: TerminalStateNonSuccess
709 end_date: Annotated[AwareDatetime, Field(title="End Date")]
710 rendered_map_index: Annotated[str | None, Field(title="Rendered Map Index")] = None
711
712
713class AssetEventDagRunReference(BaseModel):
714 """
715 Schema for AssetEvent model used in DagRun.
716 """
717
718 model_config = ConfigDict(
719 extra="forbid",
720 )
721 asset: AssetReferenceAssetEventDagRun
722 extra: Annotated[dict[str, JsonValue], Field(title="Extra")]
723 source_task_id: Annotated[str | None, Field(title="Source Task Id")] = None
724 source_dag_id: Annotated[str | None, Field(title="Source Dag Id")] = None
725 source_run_id: Annotated[str | None, Field(title="Source Run Id")] = None
726 source_map_index: Annotated[int | None, Field(title="Source Map Index")] = None
727 source_aliases: Annotated[list[AssetAliasReferenceAssetEventDagRun], Field(title="Source Aliases")]
728 timestamp: Annotated[AwareDatetime, Field(title="Timestamp")]
729 partition_key: Annotated[str | None, Field(title="Partition Key")] = None
730
731
732class AssetEventResponse(BaseModel):
733 """
734 Asset event schema with fields that are needed for Runtime.
735 """
736
737 id: Annotated[int, Field(title="Id")]
738 timestamp: Annotated[AwareDatetime, Field(title="Timestamp")]
739 extra: Annotated[dict[str, JsonValue] | None, Field(title="Extra")] = None
740 asset: AssetResponse
741 created_dagruns: Annotated[list[DagRunAssetReference], Field(title="Created Dagruns")]
742 source_task_id: Annotated[str | None, Field(title="Source Task Id")] = None
743 source_dag_id: Annotated[str | None, Field(title="Source Dag Id")] = None
744 source_run_id: Annotated[str | None, Field(title="Source Run Id")] = None
745 source_map_index: Annotated[int | None, Field(title="Source Map Index")] = None
746 partition_key: Annotated[str | None, Field(title="Partition Key")] = None
747
748
749class AssetEventsResponse(BaseModel):
750 """
751 Collection of AssetEventResponse.
752 """
753
754 asset_events: Annotated[list[AssetEventResponse], Field(title="Asset Events")]
755
756
757class DagRun(BaseModel):
758 """
759 Schema for DagRun model with minimal required fields needed for Runtime.
760 """
761
762 model_config = ConfigDict(
763 extra="forbid",
764 )
765 dag_id: Annotated[str, Field(title="Dag Id")]
766 run_id: Annotated[str, Field(title="Run Id")]
767 logical_date: Annotated[AwareDatetime | None, Field(title="Logical Date")] = None
768 data_interval_start: Annotated[AwareDatetime | None, Field(title="Data Interval Start")] = None
769 data_interval_end: Annotated[AwareDatetime | None, Field(title="Data Interval End")] = None
770 run_after: Annotated[AwareDatetime, Field(title="Run After")]
771 start_date: Annotated[AwareDatetime | None, Field(title="Start Date")] = None
772 end_date: Annotated[AwareDatetime | None, Field(title="End Date")] = None
773 clear_number: Annotated[int | None, Field(title="Clear Number")] = 0
774 run_type: DagRunType
775 state: DagRunState
776 conf: Annotated[dict[str, Any] | None, Field(title="Conf")] = None
777 triggering_user_name: Annotated[str | None, Field(title="Triggering User Name")] = None
778 consumed_asset_events: Annotated[list[AssetEventDagRunReference], Field(title="Consumed Asset Events")]
779 partition_key: Annotated[str | None, Field(title="Partition Key")] = None
780 partition_date: Annotated[AwareDatetime | None, Field(title="Partition Date")] = None
781 note: Annotated[str | None, Field(title="Note")] = None
782 team_name: Annotated[str | None, Field(title="Team Name")] = None
783
784
785class TIRunContext(BaseModel):
786 """
787 Response schema for TaskInstance run context.
788 """
789
790 dag_run: DagRun
791 task_reschedule_count: Annotated[int | None, Field(title="Task Reschedule Count")] = 0
792 max_tries: Annotated[int, Field(title="Max Tries")]
793 variables: Annotated[list[VariableResponse] | None, Field(title="Variables")] = None
794 connections: Annotated[list[ConnectionResponse] | None, Field(title="Connections")] = None
795 next_method: Annotated[str | None, Field(title="Next Method")] = None
796 next_kwargs: Annotated[dict[str, Any] | str | None, Field(title="Next Kwargs")] = None
797 xcom_keys_to_clear: Annotated[list[str] | None, Field(title="Xcom Keys To Clear")] = None
798 should_retry: Annotated[bool | None, Field(title="Should Retry")] = False
799 start_date: Annotated[AwareDatetime | None, Field(title="Start Date")] = None