|
1 | 1 | # generated by datamodel-codegen: |
2 | 2 | # filename: ecs-files-input.json |
3 | | -# timestamp: 2022-07-28T10:48:50+00:00 |
| 3 | +# timestamp: 2022-08-07T22:11:46+00:00 |
4 | 4 |
|
5 | 5 | from __future__ import annotations |
6 | 6 |
|
7 | 7 | from enum import Enum |
8 | | -from typing import Dict, List, Optional |
| 8 | +from typing import Any, Dict, List, Optional, Union |
9 | 9 |
|
10 | 10 | from pydantic import AnyUrl, BaseModel, EmailStr, Extra, Field, constr |
11 | 11 |
|
12 | 12 |
|
| 13 | +class S3Uri(BaseModel): |
| 14 | + __root__: str = Field( |
| 15 | + ..., |
| 16 | + description="s3://bucket-name/path/to/file simple syntax. Does not support IamOverride", |
| 17 | + regex="^s3://([a-zA-Z\\d\\-.]+)/([\\S]+)$", |
| 18 | + ) |
| 19 | + |
| 20 | + |
| 21 | +class ComposeXUri(BaseModel): |
| 22 | + __root__: str = Field( |
| 23 | + ..., |
| 24 | + description="bucket_name::path/to/file format used in other compose-x projects", |
| 25 | + regex="([a-zA-Z\\-\\d.]+)::([\\S]+)$", |
| 26 | + ) |
| 27 | + |
| 28 | + |
13 | 29 | class Encoding(Enum): |
14 | 30 | base64 = "base64" |
15 | 31 | plain = "plain" |
@@ -136,19 +152,27 @@ class SecretDef(BaseModel): |
136 | 152 | iam_override: Optional[IamOverrideDef] = Field(None, alias="IamOverride") |
137 | 153 |
|
138 | 154 |
|
139 | | -class S3Def(BaseModel): |
140 | | - bucket_name: str = Field( |
141 | | - ..., alias="BucketName", description="Name of the S3 Bucket" |
| 155 | +class S3Def1(BaseModel): |
| 156 | + s3_uri: Optional[S3Uri] = Field(None, alias="S3Uri") |
| 157 | + compose_x_uri: Optional[ComposeXUri] = Field(None, alias="ComposeXUri") |
| 158 | + bucket_name: Optional[str] = Field( |
| 159 | + None, alias="BucketName", description="Name of the S3 Bucket" |
142 | 160 | ) |
143 | 161 | bucket_region: Optional[str] = Field( |
144 | 162 | None, |
145 | 163 | alias="BucketRegion", |
146 | 164 | description="S3 Region to use. Default will ignore or retrieve via s3:GetBucketLocation", |
147 | 165 | ) |
148 | | - key: str = Field(..., alias="Key", description="Full path to the file to retrieve") |
| 166 | + key: Optional[str] = Field( |
| 167 | + None, alias="Key", description="Full path to the file to retrieve" |
| 168 | + ) |
149 | 169 | iam_override: Optional[IamOverrideDef] = Field(None, alias="IamOverride") |
150 | 170 |
|
151 | 171 |
|
| 172 | +class S3Def(BaseModel): |
| 173 | + __root__: Union[S3Def1, Any, Any, Any] |
| 174 | + |
| 175 | + |
152 | 176 | class SourceDef(BaseModel): |
153 | 177 | url: Optional[UrlDef] = Field(None, alias="Url") |
154 | 178 | ssm: Optional[SsmDef] = Field(None, alias="Ssm") |
|
0 commit comments