Skip to content

Commit 76d6f81

Browse files
Generator: Update SDK /services/cdn (#3807)
Co-authored-by: Manuel Vaas <manuel.vaas@stackit.cloud>
1 parent ee8f9c4 commit 76d6f81

28 files changed

Lines changed: 384 additions & 110 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
- **Feature:** Add `config_drive` attribute to ModelClass `Server` and `CreateServerPayload`
2020
- `alb`: [v0.9.3](services/alb/CHANGELOG.md#v093)
2121
- Add HTTP 429 status code to some API client methods
22+
- `cdn`: [v2.5.0](services/cdn/CHANGELOG.md#v250)
23+
- **Feature:** New model classes `TlsConfigPatch` and `TlsConfig`
24+
- **Feature:** add attributes `forwardHostHeader`, `stripResponseCookies` and `tls` to the model classes:
25+
- `Config`
26+
- `ConfigPatch`
27+
- `CreateDistributionPayload`
2228
- `certificates`: [v1.3.1](services/certificates/CHANGELOG.md#v131)
2329
- Add HTTP 429 status code to some API client methods
2430
- `loadbalancer`: [v0.9.3](services/loadbalancer/CHANGELOG.md#v093)

services/cdn/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v2.5.0
2+
- **Feature:** New model classes `TlsConfigPatch` and `TlsConfig`
3+
- **Feature:** add attributes `forwardHostHeader`, `stripResponseCookies` and `tls` to the model classes:
4+
- `Config`
5+
- `ConfigPatch`
6+
- `CreateDistributionPayload`
7+
18
## v2.4.0
29
- **Feature:** client now supports UUID and decimal types
310
- **Bugfix:** timeouts now passed to requests library

services/cdn/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0e64886dd0847341800d7191ed193b75413be998
1+
bda6ad3d9e8850526f25eddcb6589fcc7559c625

services/cdn/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "stackit-cdn"
3-
version = "v2.4.0"
3+
version = "v2.5.0"
44
description = "CDN API"
55
authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
66
requires-python = ">=3.9,<4.0"
@@ -111,7 +111,7 @@ per-file-ignores = """
111111
# asserts are fine in tests, tests shouldn't be build optimized
112112
./tests/*: S101,
113113
# F841: some variables get generated but may not be used, depending on the api-spec
114-
# E501: long descriptions/string values might lead to lines that are too long
114+
# E501: long descriptions/string values might lead to lines that are too long
115115
./src/stackit/*/models/*: F841,E501
116116
# F841: some variables get generated but may not be used, depending on the api-spec
117117
# E501: long descriptions/string values might lead to lines that are too long

services/cdn/src/stackit/cdn/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
"RedirectRule",
9393
"Region",
9494
"StatusError",
95+
"TlsConfig",
96+
"TlsConfigPatch",
9597
"WAFRuleAction",
9698
"WAFViolation",
9799
"WafConfig",
@@ -270,6 +272,8 @@
270272
from stackit.cdn.models.redirect_rule import RedirectRule as RedirectRule
271273
from stackit.cdn.models.region import Region as Region
272274
from stackit.cdn.models.status_error import StatusError as StatusError
275+
from stackit.cdn.models.tls_config import TlsConfig as TlsConfig
276+
from stackit.cdn.models.tls_config_patch import TlsConfigPatch as TlsConfigPatch
273277
from stackit.cdn.models.waf_config import WafConfig as WafConfig
274278
from stackit.cdn.models.waf_config_patch import WafConfigPatch as WafConfigPatch
275279
from stackit.cdn.models.waf_mode import WafMode as WafMode

services/cdn/src/stackit/cdn/api/default_api.py

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

services/cdn/src/stackit/cdn/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
from stackit.cdn.models.redirect_rule import RedirectRule
110110
from stackit.cdn.models.region import Region
111111
from stackit.cdn.models.status_error import StatusError
112+
from stackit.cdn.models.tls_config import TlsConfig
113+
from stackit.cdn.models.tls_config_patch import TlsConfigPatch
112114
from stackit.cdn.models.waf_config import WafConfig
113115
from stackit.cdn.models.waf_config_patch import WafConfigPatch
114116
from stackit.cdn.models.waf_mode import WafMode

services/cdn/src/stackit/cdn/models/config.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import (
21+
BaseModel,
22+
ConfigDict,
23+
Field,
24+
StrictBool,
25+
StrictStr,
26+
)
2127
from typing_extensions import Annotated, Self
2228

2329
from stackit.cdn.models.config_backend import ConfigBackend
2430
from stackit.cdn.models.loki_log_sink import LokiLogSink
2531
from stackit.cdn.models.optimizer import Optimizer
2632
from stackit.cdn.models.redirect_config import RedirectConfig
2733
from stackit.cdn.models.region import Region
34+
from stackit.cdn.models.tls_config import TlsConfig
2835
from stackit.cdn.models.waf_config import WafConfig
2936

3037

@@ -35,18 +42,22 @@ class Config(BaseModel):
3542

3643
backend: ConfigBackend
3744
blocked_countries: List[StrictStr] = Field(
38-
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. ",
45+
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. ",
3946
alias="blockedCountries",
4047
)
4148
blocked_ips: List[StrictStr] = Field(
42-
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
49+
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
4350
alias="blockedIps",
4451
)
4552
default_cache_duration: Optional[StrictStr] = Field(
4653
default=None,
47-
description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ",
54+
description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ",
4855
alias="defaultCacheDuration",
4956
)
57+
forward_host_header: StrictBool = Field(
58+
description="Enabling this allows the 'Host' header to be passed through to the origin. ",
59+
alias="forwardHostHeader",
60+
)
5061
log_sink: Optional[LokiLogSink] = Field(default=None, alias="logSink")
5162
monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
5263
default=None,
@@ -56,17 +67,25 @@ class Config(BaseModel):
5667
optimizer: Optional[Optimizer] = None
5768
redirects: Optional[RedirectConfig] = None
5869
regions: Annotated[List[Region], Field(min_length=1)]
70+
strip_response_cookies: StrictBool = Field(
71+
description="Enable this to prevent origin-level cookies from being forwarded to the end user. ",
72+
alias="stripResponseCookies",
73+
)
74+
tls: TlsConfig
5975
waf: WafConfig
6076
__properties: ClassVar[List[str]] = [
6177
"backend",
6278
"blockedCountries",
6379
"blockedIps",
6480
"defaultCacheDuration",
81+
"forwardHostHeader",
6582
"logSink",
6683
"monthlyLimitBytes",
6784
"optimizer",
6885
"redirects",
6986
"regions",
87+
"stripResponseCookies",
88+
"tls",
7089
"waf",
7190
]
7291

@@ -119,6 +138,9 @@ def to_dict(self) -> Dict[str, Any]:
119138
# override the default output from pydantic by calling `to_dict()` of redirects
120139
if self.redirects:
121140
_dict["redirects"] = self.redirects.to_dict()
141+
# override the default output from pydantic by calling `to_dict()` of tls
142+
if self.tls:
143+
_dict["tls"] = self.tls.to_dict()
122144
# override the default output from pydantic by calling `to_dict()` of waf
123145
if self.waf:
124146
_dict["waf"] = self.waf.to_dict()
@@ -149,11 +171,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
149171
"blockedCountries": obj.get("blockedCountries"),
150172
"blockedIps": obj.get("blockedIps"),
151173
"defaultCacheDuration": obj.get("defaultCacheDuration"),
174+
"forwardHostHeader": obj.get("forwardHostHeader"),
152175
"logSink": LokiLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
153176
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
154177
"optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
155178
"redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,
156179
"regions": obj.get("regions"),
180+
"stripResponseCookies": obj.get("stripResponseCookies"),
181+
"tls": TlsConfig.from_dict(obj["tls"]) if obj.get("tls") is not None else None,
157182
"waf": WafConfig.from_dict(obj["waf"]) if obj.get("waf") is not None else None,
158183
}
159184
)

services/cdn/src/stackit/cdn/models/config_patch.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import (
21+
BaseModel,
22+
ConfigDict,
23+
Field,
24+
StrictBool,
25+
StrictStr,
26+
)
2127
from typing_extensions import Annotated, Self
2228

2329
from stackit.cdn.models.config_patch_backend import ConfigPatchBackend
2430
from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch
2531
from stackit.cdn.models.optimizer_patch import OptimizerPatch
2632
from stackit.cdn.models.redirect_config import RedirectConfig
2733
from stackit.cdn.models.region import Region
34+
from stackit.cdn.models.tls_config_patch import TlsConfigPatch
2835
from stackit.cdn.models.waf_config_patch import WafConfigPatch
2936

3037

@@ -36,19 +43,24 @@ class ConfigPatch(BaseModel):
3643
backend: Optional[ConfigPatchBackend] = None
3744
blocked_countries: Optional[List[StrictStr]] = Field(
3845
default=None,
39-
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
46+
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
4047
alias="blockedCountries",
4148
)
4249
blocked_ips: Optional[List[StrictStr]] = Field(
4350
default=None,
44-
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
51+
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
4552
alias="blockedIps",
4653
)
4754
default_cache_duration: Optional[StrictStr] = Field(
4855
default=None,
49-
description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ",
56+
description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ",
5057
alias="defaultCacheDuration",
5158
)
59+
forward_host_header: Optional[StrictBool] = Field(
60+
default=None,
61+
description="Enabling this allows the 'Host' header to be passed through to the origin. ",
62+
alias="forwardHostHeader",
63+
)
5264
log_sink: Optional[LokiLogSinkPatch] = Field(default=None, alias="logSink")
5365
monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
5466
default=None,
@@ -58,17 +70,26 @@ class ConfigPatch(BaseModel):
5870
optimizer: Optional[OptimizerPatch] = None
5971
redirects: Optional[RedirectConfig] = None
6072
regions: Optional[Annotated[List[Region], Field(min_length=1)]] = None
73+
strip_response_cookies: Optional[StrictBool] = Field(
74+
default=None,
75+
description="Enable this to prevent origin-level cookies from being forwarded to the end user. ",
76+
alias="stripResponseCookies",
77+
)
78+
tls: Optional[TlsConfigPatch] = None
6179
waf: Optional[WafConfigPatch] = None
6280
__properties: ClassVar[List[str]] = [
6381
"backend",
6482
"blockedCountries",
6583
"blockedIps",
6684
"defaultCacheDuration",
85+
"forwardHostHeader",
6786
"logSink",
6887
"monthlyLimitBytes",
6988
"optimizer",
7089
"redirects",
7190
"regions",
91+
"stripResponseCookies",
92+
"tls",
7293
"waf",
7394
]
7495

@@ -121,6 +142,9 @@ def to_dict(self) -> Dict[str, Any]:
121142
# override the default output from pydantic by calling `to_dict()` of redirects
122143
if self.redirects:
123144
_dict["redirects"] = self.redirects.to_dict()
145+
# override the default output from pydantic by calling `to_dict()` of tls
146+
if self.tls:
147+
_dict["tls"] = self.tls.to_dict()
124148
# override the default output from pydantic by calling `to_dict()` of waf
125149
if self.waf:
126150
_dict["waf"] = self.waf.to_dict()
@@ -156,11 +180,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
156180
"blockedCountries": obj.get("blockedCountries"),
157181
"blockedIps": obj.get("blockedIps"),
158182
"defaultCacheDuration": obj.get("defaultCacheDuration"),
183+
"forwardHostHeader": obj.get("forwardHostHeader"),
159184
"logSink": LokiLogSinkPatch.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
160185
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
161186
"optimizer": OptimizerPatch.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
162187
"redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,
163188
"regions": obj.get("regions"),
189+
"stripResponseCookies": obj.get("stripResponseCookies"),
190+
"tls": TlsConfigPatch.from_dict(obj["tls"]) if obj.get("tls") is not None else None,
164191
"waf": WafConfigPatch.from_dict(obj["waf"]) if obj.get("waf") is not None else None,
165192
}
166193
)

services/cdn/src/stackit/cdn/models/create_distribution_payload.py

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import (
21+
BaseModel,
22+
ConfigDict,
23+
Field,
24+
StrictBool,
25+
StrictStr,
26+
)
2127
from typing_extensions import Annotated, Self
2228

2329
from stackit.cdn.models.create_distribution_payload_backend import (
@@ -27,6 +33,7 @@
2733
from stackit.cdn.models.optimizer import Optimizer
2834
from stackit.cdn.models.redirect_config import RedirectConfig
2935
from stackit.cdn.models.region import Region
36+
from stackit.cdn.models.tls_config import TlsConfig
3037
from stackit.cdn.models.waf_config import WafConfig
3138

3239

@@ -38,22 +45,27 @@ class CreateDistributionPayload(BaseModel):
3845
backend: CreateDistributionPayloadBackend
3946
blocked_countries: Optional[List[StrictStr]] = Field(
4047
default=None,
41-
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
48+
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
4249
alias="blockedCountries",
4350
)
4451
blocked_ips: Optional[List[StrictStr]] = Field(
4552
default=None,
46-
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
53+
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
4754
alias="blockedIps",
4855
)
4956
default_cache_duration: Optional[StrictStr] = Field(
5057
default=None,
51-
description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ",
58+
description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ",
5259
alias="defaultCacheDuration",
5360
)
61+
forward_host_header: Optional[StrictBool] = Field(
62+
default=None,
63+
description="Enabling this allows the 'Host' header to be passed through to the origin. ",
64+
alias="forwardHostHeader",
65+
)
5466
intent_id: Optional[StrictStr] = Field(
5567
default=None,
56-
description="While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. ",
68+
description="While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. ",
5769
alias="intentId",
5870
)
5971
log_sink: Optional[LokiLogSinkCreate] = Field(default=None, alias="logSink")
@@ -67,18 +79,27 @@ class CreateDistributionPayload(BaseModel):
6779
regions: Annotated[List[Region], Field(min_length=1)] = Field(
6880
description="Define in which regions you would like your content to be cached. "
6981
)
82+
strip_response_cookies: Optional[StrictBool] = Field(
83+
default=None,
84+
description="Enable this to prevent origin-level cookies from being forwarded to the end user. ",
85+
alias="stripResponseCookies",
86+
)
87+
tls: Optional[TlsConfig] = None
7088
waf: Optional[WafConfig] = None
7189
__properties: ClassVar[List[str]] = [
7290
"backend",
7391
"blockedCountries",
7492
"blockedIps",
7593
"defaultCacheDuration",
94+
"forwardHostHeader",
7695
"intentId",
7796
"logSink",
7897
"monthlyLimitBytes",
7998
"optimizer",
8099
"redirects",
81100
"regions",
101+
"stripResponseCookies",
102+
"tls",
82103
"waf",
83104
]
84105

@@ -131,6 +152,9 @@ def to_dict(self) -> Dict[str, Any]:
131152
# override the default output from pydantic by calling `to_dict()` of redirects
132153
if self.redirects:
133154
_dict["redirects"] = self.redirects.to_dict()
155+
# override the default output from pydantic by calling `to_dict()` of tls
156+
if self.tls:
157+
_dict["tls"] = self.tls.to_dict()
134158
# override the default output from pydantic by calling `to_dict()` of waf
135159
if self.waf:
136160
_dict["waf"] = self.waf.to_dict()
@@ -155,12 +179,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
155179
"blockedCountries": obj.get("blockedCountries"),
156180
"blockedIps": obj.get("blockedIps"),
157181
"defaultCacheDuration": obj.get("defaultCacheDuration"),
182+
"forwardHostHeader": obj.get("forwardHostHeader"),
158183
"intentId": obj.get("intentId"),
159184
"logSink": LokiLogSinkCreate.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
160185
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
161186
"optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
162187
"redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,
163188
"regions": obj.get("regions"),
189+
"stripResponseCookies": obj.get("stripResponseCookies"),
190+
"tls": TlsConfig.from_dict(obj["tls"]) if obj.get("tls") is not None else None,
164191
"waf": WafConfig.from_dict(obj["waf"]) if obj.get("waf") is not None else None,
165192
}
166193
)

0 commit comments

Comments
 (0)