Skip to content

Commit 47287f9

Browse files
Generator: Update SDK /services/cdn (#8781)
* Generate cdn * chore(cdn): add changelogs --------- Co-authored-by: Jonas Schlecht <jonas.schlecht_ext@external.digits.schwarz>
1 parent b9dc8cd commit 47287f9

23 files changed

Lines changed: 616 additions & 45 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
- **Chore:** Bump minimum Python version to 3.10
2525
- **Chore:** Update dependencies
2626
- `cdn`
27+
- [v2.8.0](services/cdn/CHANGELOG.md#v280)
28+
- **Breaking Change:** `log_sink` fields changed to new wrapper types: `ConfigLogSink`, `ConfigPatchLogSink`, `CreateDistributionPayloadLogSink`
29+
- **Feature:** New model classes `ConfigLogSink`, `ConfigPatchLogSink` and `CreateDistributionPayloadLogSink`
30+
- **Feature:** Add `labels` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model classes
31+
- **Feature:** Add enum validation for `type` field in `BucketBackend`, `BucketBackendCreate`, `BucketBackendPatch`, `HttpBackend`, `HttpBackendCreate`, `HttpBackendPatch`, `LokiLogSink`, `LokiLogSinkCreate` and `LokiLogSinkPatch` model classes
32+
- **Improvement:** Extend field descriptions in multiple model classes
2733
- [v2.7.0](services/cdn/CHANGELOG.md#v270)
2834
- **Chore:** Bump minimum Python version to 3.10
2935
- **Chore:** Update dependencies

services/cdn/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v2.8.0
2+
- **Breaking Change:** `log_sink` fields changed to new wrapper types: `ConfigLogSink`, `ConfigPatchLogSink`, `CreateDistributionPayloadLogSink`
3+
- **Feature:** New model classes `ConfigLogSink`, `ConfigPatchLogSink` and `CreateDistributionPayloadLogSink`
4+
- **Feature:** Add `labels` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model classes
5+
- **Feature:** Add enum validation for `type` field in `BucketBackend`, `BucketBackendCreate`, `BucketBackendPatch`, `HttpBackend`, `HttpBackendCreate`, `HttpBackendPatch`, `LokiLogSink`, `LokiLogSinkCreate` and `LokiLogSinkPatch` model classes
6+
- **Improvement:** Extend field descriptions in multiple model classes
7+
18
## v2.7.0
29
- **Chore:** Bump minimum Python version to 3.10
310
- **Chore:** Update dependencies

services/cdn/oas_commit

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

services/cdn/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "stackit-cdn"
3-
version = "v2.7.0"
3+
version = "v2.8.0"
44
description = "CDN API"
55
authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
66
requires-python = ">=3.10,<4.0"

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@
3333
"BucketCredentials",
3434
"Config",
3535
"ConfigBackend",
36+
"ConfigLogSink",
3637
"ConfigPatch",
3738
"ConfigPatchBackend",
39+
"ConfigPatchLogSink",
3840
"CreateDistributionPayload",
3941
"CreateDistributionPayloadBackend",
42+
"CreateDistributionPayloadLogSink",
4043
"CreateDistributionResponse",
4144
"CustomDomain",
4245
"DeleteCustomDomainResponse",
@@ -137,16 +140,23 @@
137140
from stackit.cdn.models.bucket_credentials import BucketCredentials as BucketCredentials
138141
from stackit.cdn.models.config import Config as Config
139142
from stackit.cdn.models.config_backend import ConfigBackend as ConfigBackend
143+
from stackit.cdn.models.config_log_sink import ConfigLogSink as ConfigLogSink
140144
from stackit.cdn.models.config_patch import ConfigPatch as ConfigPatch
141145
from stackit.cdn.models.config_patch_backend import (
142146
ConfigPatchBackend as ConfigPatchBackend,
143147
)
148+
from stackit.cdn.models.config_patch_log_sink import (
149+
ConfigPatchLogSink as ConfigPatchLogSink,
150+
)
144151
from stackit.cdn.models.create_distribution_payload import (
145152
CreateDistributionPayload as CreateDistributionPayload,
146153
)
147154
from stackit.cdn.models.create_distribution_payload_backend import (
148155
CreateDistributionPayloadBackend as CreateDistributionPayloadBackend,
149156
)
157+
from stackit.cdn.models.create_distribution_payload_log_sink import (
158+
CreateDistributionPayloadLogSink as CreateDistributionPayloadLogSink,
159+
)
150160
from stackit.cdn.models.create_distribution_response import (
151161
CreateDistributionResponse as CreateDistributionResponse,
152162
)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@
1919
from stackit.cdn.models.bucket_credentials import BucketCredentials
2020
from stackit.cdn.models.config import Config
2121
from stackit.cdn.models.config_backend import ConfigBackend
22+
from stackit.cdn.models.config_log_sink import ConfigLogSink
2223
from stackit.cdn.models.config_patch import ConfigPatch
2324
from stackit.cdn.models.config_patch_backend import ConfigPatchBackend
25+
from stackit.cdn.models.config_patch_log_sink import ConfigPatchLogSink
2426
from stackit.cdn.models.create_distribution_payload import CreateDistributionPayload
2527
from stackit.cdn.models.create_distribution_payload_backend import (
2628
CreateDistributionPayloadBackend,
2729
)
30+
from stackit.cdn.models.create_distribution_payload_log_sink import (
31+
CreateDistributionPayloadLogSink,
32+
)
2833
from stackit.cdn.models.create_distribution_response import CreateDistributionResponse
2934
from stackit.cdn.models.custom_domain import CustomDomain
3035
from stackit.cdn.models.delete_custom_domain_response import DeleteCustomDomainResponse

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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 BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -27,11 +27,25 @@ class BucketBackend(BaseModel):
2727
BucketBackend
2828
""" # noqa: E501
2929

30-
bucket_url: StrictStr = Field(alias="bucketUrl")
31-
region: StrictStr
32-
type: StrictStr
30+
bucket_url: StrictStr = Field(
31+
description="The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`).",
32+
alias="bucketUrl",
33+
)
34+
region: StrictStr = Field(
35+
description="The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT)."
36+
)
37+
type: StrictStr = Field(
38+
description="Defines the type of content origin. For this schema, it must be set to `bucket`."
39+
)
3340
__properties: ClassVar[List[str]] = ["bucketUrl", "region", "type"]
3441

42+
@field_validator("type")
43+
def type_validate_enum(cls, value):
44+
"""Validates the enum"""
45+
if value not in set(["bucket"]):
46+
raise ValueError("must be one of enum values ('bucket')")
47+
return value
48+
3549
model_config = ConfigDict(
3650
validate_by_name=True,
3751
validate_by_alias=True,

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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 BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -29,12 +29,26 @@ class BucketBackendCreate(BaseModel):
2929
BucketBackendCreate
3030
""" # noqa: E501
3131

32-
bucket_url: StrictStr = Field(alias="bucketUrl")
32+
bucket_url: StrictStr = Field(
33+
description="The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`).",
34+
alias="bucketUrl",
35+
)
3336
credentials: BucketCredentials
34-
region: StrictStr
35-
type: StrictStr
37+
region: StrictStr = Field(
38+
description="The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT)."
39+
)
40+
type: StrictStr = Field(
41+
description="Defines the type of content origin. For this schema, it must be set to `bucket`."
42+
)
3643
__properties: ClassVar[List[str]] = ["bucketUrl", "credentials", "region", "type"]
3744

45+
@field_validator("type")
46+
def type_validate_enum(cls, value):
47+
"""Validates the enum"""
48+
if value not in set(["bucket"]):
49+
raise ValueError("must be one of enum values ('bucket')")
50+
return value
51+
3852
model_config = ConfigDict(
3953
validate_by_name=True,
4054
validate_by_alias=True,

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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 BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -29,12 +29,28 @@ class BucketBackendPatch(BaseModel):
2929
BucketBackendPatch
3030
""" # noqa: E501
3131

32-
bucket_url: Optional[StrictStr] = Field(default=None, alias="bucketUrl")
32+
bucket_url: Optional[StrictStr] = Field(
33+
default=None,
34+
description="The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`).",
35+
alias="bucketUrl",
36+
)
3337
credentials: Optional[BucketCredentials] = None
34-
region: Optional[StrictStr] = None
35-
type: StrictStr
38+
region: Optional[StrictStr] = Field(
39+
default=None,
40+
description="The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT).",
41+
)
42+
type: StrictStr = Field(
43+
description="Defines the type of content origin. For this schema, it must be set to `bucket`."
44+
)
3645
__properties: ClassVar[List[str]] = ["bucketUrl", "credentials", "region", "type"]
3746

47+
@field_validator("type")
48+
def type_validate_enum(cls, value):
49+
"""Validates the enum"""
50+
if value not in set(["bucket"]):
51+
raise ValueError("must be one of enum values ('bucket')")
52+
return value
53+
3854
model_config = ConfigDict(
3955
validate_by_name=True,
4056
validate_by_alias=True,

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from typing_extensions import Annotated, Self
2929

3030
from stackit.cdn.models.config_backend import ConfigBackend
31-
from stackit.cdn.models.loki_log_sink import LokiLogSink
31+
from stackit.cdn.models.config_log_sink import ConfigLogSink
3232
from stackit.cdn.models.optimizer import Optimizer
3333
from stackit.cdn.models.redirect_config import RedirectConfig
3434
from stackit.cdn.models.region import Region
@@ -59,7 +59,10 @@ class Config(BaseModel):
5959
description="Enabling this allows the 'Host' header to be passed through to the origin. ",
6060
alias="forwardHostHeader",
6161
)
62-
log_sink: Optional[LokiLogSink] = Field(default=None, alias="logSink")
62+
labels: Optional[Dict[str, StrictStr]] = Field(
63+
default=None, description="Labels are key-value string pairs that can be attached to a distribution."
64+
)
65+
log_sink: Optional[ConfigLogSink] = Field(default=None, alias="logSink")
6366
monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
6467
default=None,
6568
description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ",
@@ -80,6 +83,7 @@ class Config(BaseModel):
8083
"blockedIps",
8184
"defaultCacheDuration",
8285
"forwardHostHeader",
86+
"labels",
8387
"logSink",
8488
"monthlyLimitBytes",
8589
"optimizer",
@@ -173,7 +177,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
173177
"blockedIps": obj.get("blockedIps"),
174178
"defaultCacheDuration": obj.get("defaultCacheDuration"),
175179
"forwardHostHeader": obj.get("forwardHostHeader"),
176-
"logSink": LokiLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
180+
"labels": obj.get("labels"),
181+
"logSink": ConfigLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
177182
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
178183
"optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
179184
"redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,

0 commit comments

Comments
 (0)