Skip to content

Commit fc6d9d6

Browse files
feat(api): api update (#2522)
1 parent e3a6206 commit fc6d9d6

File tree

7 files changed

+179
-88
lines changed

7 files changed

+179
-88
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1607
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1e8a2b07a4b4468bc8d49736bcc37947664a7d2daa79369607e89ed9cb5a8ca2.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d810c2572965e260d41bfa5a12b06aea5a81feedd81d0437308832d1f468d86a.yml

src/cloudflare/types/pages/deployment.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import Dict, List, Union, Optional
44
from datetime import datetime
5-
from typing_extensions import Literal
5+
from typing_extensions import Literal, Annotated, TypeAlias
66

77
from .stage import Stage
8+
from ..._utils import PropertyInfo
89
from ..._models import BaseModel
910

1011
__all__ = [
@@ -13,6 +14,8 @@
1314
"DeploymentTrigger",
1415
"DeploymentTriggerMetadata",
1516
"EnvVars",
17+
"EnvVarsPagesPlainTextEnvVar",
18+
"EnvVarsPagesSecretTextEnvVar",
1619
"Source",
1720
"SourceConfig",
1821
]
@@ -53,16 +56,28 @@ class DeploymentTrigger(BaseModel):
5356
metadata: Optional[DeploymentTriggerMetadata] = None
5457
"""Additional info about the trigger."""
5558

56-
type: Optional[str] = None
59+
type: Optional[Literal["push", "ad_hoc"]] = None
5760
"""What caused the deployment."""
5861

5962

60-
class EnvVars(BaseModel):
63+
class EnvVarsPagesPlainTextEnvVar(BaseModel):
64+
type: Literal["plain_text"]
65+
6166
value: str
6267
"""Environment variable value."""
6368

64-
type: Optional[str] = None
65-
"""The type of environment variable."""
69+
70+
class EnvVarsPagesSecretTextEnvVar(BaseModel):
71+
type: Literal["secret_text"]
72+
73+
value: str
74+
"""Secret value."""
75+
76+
77+
EnvVars: TypeAlias = Annotated[
78+
Union[Optional[EnvVarsPagesPlainTextEnvVar], Optional[EnvVarsPagesSecretTextEnvVar]],
79+
PropertyInfo(discriminator="type"),
80+
]
6681

6782

6883
class SourceConfig(BaseModel):
@@ -111,10 +126,10 @@ class Deployment(BaseModel):
111126
deployment_trigger: Optional[DeploymentTrigger] = None
112127
"""Info about what caused the deployment."""
113128

114-
env_vars: Optional[Dict[str, Optional[EnvVars]]] = None
115-
"""A dict of env variables to build this deploy."""
129+
env_vars: Optional[Dict[str, EnvVars]] = None
130+
"""Environment variables used for builds and Pages Functions."""
116131

117-
environment: Optional[str] = None
132+
environment: Optional[Literal["preview", "production"]] = None
118133
"""Type of deploy."""
119134

120135
is_skipped: Optional[bool] = None

src/cloudflare/types/pages/project.py

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import Dict, List, Union, Optional
44
from datetime import datetime
5-
from typing_extensions import Literal
5+
from typing_extensions import Literal, Annotated, TypeAlias
66

7+
from ..._utils import PropertyInfo
78
from ..._models import BaseModel
89
from .deployment import Deployment
910

@@ -18,6 +19,8 @@
1819
"DeploymentConfigsPreviewD1Databases",
1920
"DeploymentConfigsPreviewDurableObjectNamespaces",
2021
"DeploymentConfigsPreviewEnvVars",
22+
"DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar",
23+
"DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar",
2124
"DeploymentConfigsPreviewHyperdriveBindings",
2225
"DeploymentConfigsPreviewKVNamespaces",
2326
"DeploymentConfigsPreviewMTLSCertificates",
@@ -33,6 +36,8 @@
3336
"DeploymentConfigsProductionD1Databases",
3437
"DeploymentConfigsProductionDurableObjectNamespaces",
3538
"DeploymentConfigsProductionEnvVars",
39+
"DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar",
40+
"DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar",
3641
"DeploymentConfigsProductionHyperdriveBindings",
3742
"DeploymentConfigsProductionKVNamespaces",
3843
"DeploymentConfigsProductionMTLSCertificates",
@@ -86,15 +91,30 @@ class DeploymentConfigsPreviewD1Databases(BaseModel):
8691

8792
class DeploymentConfigsPreviewDurableObjectNamespaces(BaseModel):
8893
namespace_id: Optional[str] = None
89-
"""ID of the Durabble Object namespace."""
94+
"""ID of the Durable Object namespace."""
9095

9196

92-
class DeploymentConfigsPreviewEnvVars(BaseModel):
97+
class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar(BaseModel):
98+
type: Literal["plain_text"]
99+
93100
value: str
94101
"""Environment variable value."""
95102

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+
]
98118

99119

100120
class DeploymentConfigsPreviewHyperdriveBindings(BaseModel):
@@ -163,10 +183,10 @@ class DeploymentConfigsPreview(BaseModel):
163183
"""D1 databases used for Pages Functions."""
164184

165185
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."""
167187

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."""
170190

171191
hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewHyperdriveBindings]]] = None
172192
"""Hyperdrive bindings used for Pages Functions."""
@@ -213,15 +233,30 @@ class DeploymentConfigsProductionD1Databases(BaseModel):
213233

214234
class DeploymentConfigsProductionDurableObjectNamespaces(BaseModel):
215235
namespace_id: Optional[str] = None
216-
"""ID of the Durabble Object namespace."""
236+
"""ID of the Durable Object namespace."""
217237

218238

219-
class DeploymentConfigsProductionEnvVars(BaseModel):
239+
class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar(BaseModel):
240+
type: Literal["plain_text"]
241+
220242
value: str
221243
"""Environment variable value."""
222244

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+
]
225260

226261

227262
class DeploymentConfigsProductionHyperdriveBindings(BaseModel):
@@ -290,10 +325,10 @@ class DeploymentConfigsProduction(BaseModel):
290325
"""D1 databases used for Pages Functions."""
291326

292327
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."""
294329

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."""
297332

298333
hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionHyperdriveBindings]]] = None
299334
"""Hyperdrive bindings used for Pages Functions."""

src/cloudflare/types/pages/project_create_params.py

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Optional
6-
from typing_extensions import Literal, Required, TypedDict
5+
from typing import Dict, List, Union, Optional
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
__all__ = [
99
"ProjectCreateParams",
@@ -16,6 +16,8 @@
1616
"DeploymentConfigsPreviewD1Databases",
1717
"DeploymentConfigsPreviewDurableObjectNamespaces",
1818
"DeploymentConfigsPreviewEnvVars",
19+
"DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar",
20+
"DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar",
1921
"DeploymentConfigsPreviewHyperdriveBindings",
2022
"DeploymentConfigsPreviewKVNamespaces",
2123
"DeploymentConfigsPreviewMTLSCertificates",
@@ -31,6 +33,8 @@
3133
"DeploymentConfigsProductionD1Databases",
3234
"DeploymentConfigsProductionDurableObjectNamespaces",
3335
"DeploymentConfigsProductionEnvVars",
36+
"DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar",
37+
"DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar",
3438
"DeploymentConfigsProductionHyperdriveBindings",
3539
"DeploymentConfigsProductionKVNamespaces",
3640
"DeploymentConfigsProductionMTLSCertificates",
@@ -99,15 +103,27 @@ class DeploymentConfigsPreviewD1Databases(TypedDict, total=False):
99103

100104
class DeploymentConfigsPreviewDurableObjectNamespaces(TypedDict, total=False):
101105
namespace_id: str
102-
"""ID of the Durabble Object namespace."""
106+
"""ID of the Durable Object namespace."""
103107

104108

105-
class DeploymentConfigsPreviewEnvVars(TypedDict, total=False):
109+
class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar(TypedDict, total=False):
110+
type: Required[Literal["plain_text"]]
111+
106112
value: Required[str]
107113
"""Environment variable value."""
108114

109-
type: Literal["plain_text", "secret_text"]
110-
"""The type of environment variable."""
115+
116+
class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar(TypedDict, total=False):
117+
type: Required[Literal["secret_text"]]
118+
119+
value: Required[str]
120+
"""Secret value."""
121+
122+
123+
DeploymentConfigsPreviewEnvVars: TypeAlias = Union[
124+
Optional[DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar],
125+
Optional[DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar],
126+
]
111127

112128

113129
class DeploymentConfigsPreviewHyperdriveBindings(TypedDict, total=False):
@@ -176,10 +192,10 @@ class DeploymentConfigsPreview(TypedDict, total=False):
176192
"""D1 databases used for Pages Functions."""
177193

178194
durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsPreviewDurableObjectNamespaces]]]
179-
"""Durabble Object namespaces used for Pages Functions."""
195+
"""Durable Object namespaces used for Pages Functions."""
180196

181-
env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]
182-
"""Environment variables for build configs."""
197+
env_vars: Dict[str, DeploymentConfigsPreviewEnvVars]
198+
"""Environment variables used for builds and Pages Functions."""
183199

184200
hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewHyperdriveBindings]]]
185201
"""Hyperdrive bindings used for Pages Functions."""
@@ -226,15 +242,27 @@ class DeploymentConfigsProductionD1Databases(TypedDict, total=False):
226242

227243
class DeploymentConfigsProductionDurableObjectNamespaces(TypedDict, total=False):
228244
namespace_id: str
229-
"""ID of the Durabble Object namespace."""
245+
"""ID of the Durable Object namespace."""
230246

231247

232-
class DeploymentConfigsProductionEnvVars(TypedDict, total=False):
248+
class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar(TypedDict, total=False):
249+
type: Required[Literal["plain_text"]]
250+
233251
value: Required[str]
234252
"""Environment variable value."""
235253

236-
type: Literal["plain_text", "secret_text"]
237-
"""The type of environment variable."""
254+
255+
class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar(TypedDict, total=False):
256+
type: Required[Literal["secret_text"]]
257+
258+
value: Required[str]
259+
"""Secret value."""
260+
261+
262+
DeploymentConfigsProductionEnvVars: TypeAlias = Union[
263+
Optional[DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar],
264+
Optional[DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar],
265+
]
238266

239267

240268
class DeploymentConfigsProductionHyperdriveBindings(TypedDict, total=False):
@@ -303,10 +331,10 @@ class DeploymentConfigsProduction(TypedDict, total=False):
303331
"""D1 databases used for Pages Functions."""
304332

305333
durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsProductionDurableObjectNamespaces]]]
306-
"""Durabble Object namespaces used for Pages Functions."""
334+
"""Durable Object namespaces used for Pages Functions."""
307335

308-
env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]
309-
"""Environment variables for build configs."""
336+
env_vars: Dict[str, DeploymentConfigsProductionEnvVars]
337+
"""Environment variables used for builds and Pages Functions."""
310338

311339
hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionHyperdriveBindings]]]
312340
"""Hyperdrive bindings used for Pages Functions."""

0 commit comments

Comments
 (0)