|
1 | 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2 | 2 |
|
3 |
| -from typing import Dict, List, Optional |
| 3 | +from typing import Dict, List, Union, Optional |
4 | 4 | from datetime import datetime
|
5 |
| -from typing_extensions import Literal |
| 5 | +from typing_extensions import Literal, Annotated, TypeAlias |
6 | 6 |
|
| 7 | +from ..._utils import PropertyInfo |
7 | 8 | from ..._models import BaseModel
|
8 | 9 | from .deployment import Deployment
|
9 | 10 |
|
|
18 | 19 | "DeploymentConfigsPreviewD1Databases",
|
19 | 20 | "DeploymentConfigsPreviewDurableObjectNamespaces",
|
20 | 21 | "DeploymentConfigsPreviewEnvVars",
|
| 22 | + "DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar", |
| 23 | + "DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar", |
21 | 24 | "DeploymentConfigsPreviewHyperdriveBindings",
|
22 | 25 | "DeploymentConfigsPreviewKVNamespaces",
|
23 | 26 | "DeploymentConfigsPreviewMTLSCertificates",
|
|
33 | 36 | "DeploymentConfigsProductionD1Databases",
|
34 | 37 | "DeploymentConfigsProductionDurableObjectNamespaces",
|
35 | 38 | "DeploymentConfigsProductionEnvVars",
|
| 39 | + "DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar", |
| 40 | + "DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar", |
36 | 41 | "DeploymentConfigsProductionHyperdriveBindings",
|
37 | 42 | "DeploymentConfigsProductionKVNamespaces",
|
38 | 43 | "DeploymentConfigsProductionMTLSCertificates",
|
@@ -86,15 +91,30 @@ class DeploymentConfigsPreviewD1Databases(BaseModel):
|
86 | 91 |
|
87 | 92 | class DeploymentConfigsPreviewDurableObjectNamespaces(BaseModel):
|
88 | 93 | namespace_id: Optional[str] = None
|
89 |
| - """ID of the Durabble Object namespace.""" |
| 94 | + """ID of the Durable Object namespace.""" |
90 | 95 |
|
91 | 96 |
|
92 |
| -class DeploymentConfigsPreviewEnvVars(BaseModel): |
| 97 | +class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar(BaseModel): |
| 98 | + type: Literal["plain_text"] |
| 99 | + |
93 | 100 | value: str
|
94 | 101 | """Environment variable value."""
|
95 | 102 |
|
96 |
| - type: Optional[Literal["plain_text", "secret_text"]] = None |
97 |
| - """The type of environment variable.""" |
| 103 | + |
| 104 | +class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar(BaseModel): |
| 105 | + type: Literal["secret_text"] |
| 106 | + |
| 107 | + value: str |
| 108 | + """Secret value.""" |
| 109 | + |
| 110 | + |
| 111 | +DeploymentConfigsPreviewEnvVars: TypeAlias = Annotated[ |
| 112 | + Union[ |
| 113 | + Optional[DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar], |
| 114 | + Optional[DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar], |
| 115 | + ], |
| 116 | + PropertyInfo(discriminator="type"), |
| 117 | +] |
98 | 118 |
|
99 | 119 |
|
100 | 120 | class DeploymentConfigsPreviewHyperdriveBindings(BaseModel):
|
@@ -163,10 +183,10 @@ class DeploymentConfigsPreview(BaseModel):
|
163 | 183 | """D1 databases used for Pages Functions."""
|
164 | 184 |
|
165 | 185 | durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsPreviewDurableObjectNamespaces]]] = None
|
166 |
| - """Durabble Object namespaces used for Pages Functions.""" |
| 186 | + """Durable Object namespaces used for Pages Functions.""" |
167 | 187 |
|
168 |
| - env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]] = None |
169 |
| - """Environment variables for build configs.""" |
| 188 | + env_vars: Optional[Dict[str, DeploymentConfigsPreviewEnvVars]] = None |
| 189 | + """Environment variables used for builds and Pages Functions.""" |
170 | 190 |
|
171 | 191 | hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewHyperdriveBindings]]] = None
|
172 | 192 | """Hyperdrive bindings used for Pages Functions."""
|
@@ -213,15 +233,30 @@ class DeploymentConfigsProductionD1Databases(BaseModel):
|
213 | 233 |
|
214 | 234 | class DeploymentConfigsProductionDurableObjectNamespaces(BaseModel):
|
215 | 235 | namespace_id: Optional[str] = None
|
216 |
| - """ID of the Durabble Object namespace.""" |
| 236 | + """ID of the Durable Object namespace.""" |
217 | 237 |
|
218 | 238 |
|
219 |
| -class DeploymentConfigsProductionEnvVars(BaseModel): |
| 239 | +class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar(BaseModel): |
| 240 | + type: Literal["plain_text"] |
| 241 | + |
220 | 242 | value: str
|
221 | 243 | """Environment variable value."""
|
222 | 244 |
|
223 |
| - type: Optional[Literal["plain_text", "secret_text"]] = None |
224 |
| - """The type of environment variable.""" |
| 245 | + |
| 246 | +class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar(BaseModel): |
| 247 | + type: Literal["secret_text"] |
| 248 | + |
| 249 | + value: str |
| 250 | + """Secret value.""" |
| 251 | + |
| 252 | + |
| 253 | +DeploymentConfigsProductionEnvVars: TypeAlias = Annotated[ |
| 254 | + Union[ |
| 255 | + Optional[DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar], |
| 256 | + Optional[DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar], |
| 257 | + ], |
| 258 | + PropertyInfo(discriminator="type"), |
| 259 | +] |
225 | 260 |
|
226 | 261 |
|
227 | 262 | class DeploymentConfigsProductionHyperdriveBindings(BaseModel):
|
@@ -290,10 +325,10 @@ class DeploymentConfigsProduction(BaseModel):
|
290 | 325 | """D1 databases used for Pages Functions."""
|
291 | 326 |
|
292 | 327 | durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsProductionDurableObjectNamespaces]]] = None
|
293 |
| - """Durabble Object namespaces used for Pages Functions.""" |
| 328 | + """Durable Object namespaces used for Pages Functions.""" |
294 | 329 |
|
295 |
| - env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]] = None |
296 |
| - """Environment variables for build configs.""" |
| 330 | + env_vars: Optional[Dict[str, DeploymentConfigsProductionEnvVars]] = None |
| 331 | + """Environment variables used for builds and Pages Functions.""" |
297 | 332 |
|
298 | 333 | hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionHyperdriveBindings]]] = None
|
299 | 334 | """Hyperdrive bindings used for Pages Functions."""
|
|
0 commit comments