|
1 | 1 | # generated by datamodel-codegen: |
2 | 2 | # filename: schema.json |
3 | | -# timestamp: 2025-10-26T23:11:28+00:00 |
| 3 | +# timestamp: 2025-11-12T19:13:24+00:00 |
4 | 4 | # using the command: |
5 | 5 | # datamodel-codegen --input tests\usethis\_integrations\ci\bitbucket\schema.json --input-file-type jsonschema --output src\usethis\_integrations\ci\bitbucket\schema.py --enum-field-as-literal all --field-constraints --use-double-quotes --use-union-operator --use-standard-collections --use-default-kwarg --extra-fields=allow --output-model-type pydantic_v2.BaseModel --target-python-version 3.10 |
6 | 6 | # ruff: noqa: ERA001 |
@@ -160,6 +160,24 @@ class ImportPipeline(BaseModel): |
160 | 160 | ) |
161 | 161 |
|
162 | 162 |
|
| 163 | +class TriggerConfiguration(BaseModel): |
| 164 | + model_config = ConfigDict( |
| 165 | + extra="allow", |
| 166 | + ) |
| 167 | + condition: str = Field( |
| 168 | + ..., |
| 169 | + description="Boolean expression that determines whether the trigger should execute.", |
| 170 | + examples=['BITBUCKET_BRANCH == "main"'], |
| 171 | + title="Trigger Condition", |
| 172 | + ) |
| 173 | + pipelines: list[str] = Field( |
| 174 | + ..., |
| 175 | + description="List of pipeline names to trigger when the condition is met. Can reference pipelines from the custom section.", |
| 176 | + min_length=1, |
| 177 | + title="Pipeline Names", |
| 178 | + ) |
| 179 | + |
| 180 | + |
163 | 181 | class ImageBase(BaseModel): |
164 | 182 | model_config = ConfigDict( |
165 | 183 | extra="allow", |
@@ -308,6 +326,15 @@ class Runtime(BaseModel): |
308 | 326 | cloud: Cloud | None = None |
309 | 327 |
|
310 | 328 |
|
| 329 | +class TriggerConfigurationList(RootModel[list[TriggerConfiguration]]): |
| 330 | + root: list[TriggerConfiguration] = Field( |
| 331 | + ..., |
| 332 | + description="List of trigger configurations for a specific trigger type.", |
| 333 | + min_length=1, |
| 334 | + title="Trigger Configuration List", |
| 335 | + ) |
| 336 | + |
| 337 | + |
311 | 338 | class CacheExpanded(BaseModel): |
312 | 339 | model_config = ConfigDict( |
313 | 340 | extra="allow", |
@@ -738,6 +765,27 @@ class PipelinesConfiguration(BaseModel): |
738 | 765 | title="Global Options", |
739 | 766 | ) |
740 | 767 | pipelines: Pipelines | None = Field(default=None, title="Pipelines") |
| 768 | + triggers: dict[str, TriggerConfigurationList] | None = Field( |
| 769 | + default=None, |
| 770 | + description="Event-based triggers that automatically run pipelines when specific events occur. The property names represent trigger types (e.g., repository-push, pullrequest-push).", |
| 771 | + examples=[ |
| 772 | + { |
| 773 | + "pullrequest-push": [ |
| 774 | + { |
| 775 | + "condition": 'BITBUCKET_PR_DESTINATION_BRANCH == "main"', |
| 776 | + "pipelines": ["pipeline2"], |
| 777 | + } |
| 778 | + ], |
| 779 | + "repository-push": [ |
| 780 | + { |
| 781 | + "condition": 'BITBUCKET_BRANCH == "main"', |
| 782 | + "pipelines": ["pipeline1"], |
| 783 | + } |
| 784 | + ], |
| 785 | + } |
| 786 | + ], |
| 787 | + title="Pipeline Triggers", |
| 788 | + ) |
741 | 789 |
|
742 | 790 |
|
743 | 791 | class Model(RootModel[PipelinesConfiguration]): |
|
0 commit comments