Skip to content

Commit fb94576

Browse files
Generate cdn
1 parent 4d6d0db commit fb94576

19 files changed

Lines changed: 1251 additions & 22 deletions

services/cdn/oas_commit

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

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"BucketBackendCreate",
3232
"BucketBackendPatch",
3333
"BucketCredentials",
34+
"CacheConfig",
35+
"CacheConfigCreate",
36+
"CacheConfigPatch",
3437
"Config",
3538
"ConfigBackend",
3639
"ConfigLogSink",
@@ -81,6 +84,13 @@
8184
"Matcher",
8285
"Optimizer",
8386
"OptimizerPatch",
87+
"OtlpLogSink",
88+
"OtlpLogSinkBasicCredentials",
89+
"OtlpLogSinkBearerCredentials",
90+
"OtlpLogSinkCreate",
91+
"OtlpLogSinkCreateCredentials",
92+
"OtlpLogSinkPatch",
93+
"OtlpLogSinkPatchCredentials",
8494
"PatchDistributionPayload",
8595
"PatchDistributionResponse",
8696
"PurgeCachePayload",
@@ -138,6 +148,11 @@
138148
BucketBackendPatch as BucketBackendPatch,
139149
)
140150
from stackit.cdn.models.bucket_credentials import BucketCredentials as BucketCredentials
151+
from stackit.cdn.models.cache_config import CacheConfig as CacheConfig
152+
from stackit.cdn.models.cache_config_create import (
153+
CacheConfigCreate as CacheConfigCreate,
154+
)
155+
from stackit.cdn.models.cache_config_patch import CacheConfigPatch as CacheConfigPatch
141156
from stackit.cdn.models.config import Config as Config
142157
from stackit.cdn.models.config_backend import ConfigBackend as ConfigBackend
143158
from stackit.cdn.models.config_log_sink import ConfigLogSink as ConfigLogSink
@@ -250,6 +265,23 @@
250265
from stackit.cdn.models.matcher import Matcher as Matcher
251266
from stackit.cdn.models.optimizer import Optimizer as Optimizer
252267
from stackit.cdn.models.optimizer_patch import OptimizerPatch as OptimizerPatch
268+
from stackit.cdn.models.otlp_log_sink import OtlpLogSink as OtlpLogSink
269+
from stackit.cdn.models.otlp_log_sink_basic_credentials import (
270+
OtlpLogSinkBasicCredentials as OtlpLogSinkBasicCredentials,
271+
)
272+
from stackit.cdn.models.otlp_log_sink_bearer_credentials import (
273+
OtlpLogSinkBearerCredentials as OtlpLogSinkBearerCredentials,
274+
)
275+
from stackit.cdn.models.otlp_log_sink_create import (
276+
OtlpLogSinkCreate as OtlpLogSinkCreate,
277+
)
278+
from stackit.cdn.models.otlp_log_sink_create_credentials import (
279+
OtlpLogSinkCreateCredentials as OtlpLogSinkCreateCredentials,
280+
)
281+
from stackit.cdn.models.otlp_log_sink_patch import OtlpLogSinkPatch as OtlpLogSinkPatch
282+
from stackit.cdn.models.otlp_log_sink_patch_credentials import (
283+
OtlpLogSinkPatchCredentials as OtlpLogSinkPatchCredentials,
284+
)
253285
from stackit.cdn.models.patch_distribution_payload import (
254286
PatchDistributionPayload as PatchDistributionPayload,
255287
)

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
from stackit.cdn.models.bucket_backend_create import BucketBackendCreate
1818
from stackit.cdn.models.bucket_backend_patch import BucketBackendPatch
1919
from stackit.cdn.models.bucket_credentials import BucketCredentials
20+
from stackit.cdn.models.cache_config import CacheConfig
21+
from stackit.cdn.models.cache_config_create import CacheConfigCreate
22+
from stackit.cdn.models.cache_config_patch import CacheConfigPatch
2023
from stackit.cdn.models.config import Config
2124
from stackit.cdn.models.config_backend import ConfigBackend
2225
from stackit.cdn.models.config_log_sink import ConfigLogSink
@@ -93,6 +96,21 @@
9396
from stackit.cdn.models.matcher import Matcher
9497
from stackit.cdn.models.optimizer import Optimizer
9598
from stackit.cdn.models.optimizer_patch import OptimizerPatch
99+
from stackit.cdn.models.otlp_log_sink import OtlpLogSink
100+
from stackit.cdn.models.otlp_log_sink_basic_credentials import (
101+
OtlpLogSinkBasicCredentials,
102+
)
103+
from stackit.cdn.models.otlp_log_sink_bearer_credentials import (
104+
OtlpLogSinkBearerCredentials,
105+
)
106+
from stackit.cdn.models.otlp_log_sink_create import OtlpLogSinkCreate
107+
from stackit.cdn.models.otlp_log_sink_create_credentials import (
108+
OtlpLogSinkCreateCredentials,
109+
)
110+
from stackit.cdn.models.otlp_log_sink_patch import OtlpLogSinkPatch
111+
from stackit.cdn.models.otlp_log_sink_patch_credentials import (
112+
OtlpLogSinkPatchCredentials,
113+
)
96114
from stackit.cdn.models.patch_distribution_payload import PatchDistributionPayload
97115
from stackit.cdn.models.patch_distribution_response import PatchDistributionResponse
98116
from stackit.cdn.models.purge_cache_payload import PurgeCachePayload
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT CDN API
5+
6+
API used to create and manage your CDN distributions.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
from __future__ import annotations
15+
16+
import json
17+
import pprint
18+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
21+
from pydantic_core import to_jsonable_python
22+
from typing_extensions import Annotated, Self
23+
24+
25+
class CacheConfig(BaseModel):
26+
"""
27+
Groups the cache options that influence how the CDN builds its cache key. **Cache cardinality warning:** enabling query-string vary produces one cache entry per unique query-string combination (**unbounded** when `queryStringVaryParameters` is empty). Each entry in `cacheKeyHeaders` multiplies the number of cache variants by the number of distinct values observed for that header. Use these settings sparingly. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled` so that this feature can be toggled on and off without losing the configured allowlist. Only `queryStringVaryEnabled` gates whether the parameter allowlist actually varies the cache. **Optimizer interaction:** when the Optimizer is enabled, the CDN automatically enables query-string vary for image responses regardless of this setting.
28+
""" # noqa: E501
29+
30+
cache_key_headers: List[Annotated[str, Field(strict=True)]] = Field(
31+
description="HTTP request header names whose values participate in the cache key. Each entry multiplies the number of cache variants by the number of distinct values observed for that header. ",
32+
alias="cacheKeyHeaders",
33+
)
34+
query_string_vary_enabled: StrictBool = Field(
35+
description="When true, the CDN varies its cache by the request query string. If `queryStringVaryParameters` is empty, every unique query-string combination produces its own cache entry; if non-empty, only the listed parameters influence the cache key. ",
36+
alias="queryStringVaryEnabled",
37+
)
38+
query_string_vary_parameters: List[Annotated[str, Field(strict=True)]] = Field(
39+
description="Allowlist of query-string parameter names that participate in the cache key when `queryStringVaryEnabled` is true. Ignored while `queryStringVaryEnabled` is false, but still stored so it can be re-activated without losing the list. ",
40+
alias="queryStringVaryParameters",
41+
)
42+
__properties: ClassVar[List[str]] = ["cacheKeyHeaders", "queryStringVaryEnabled", "queryStringVaryParameters"]
43+
44+
model_config = ConfigDict(
45+
validate_by_name=True,
46+
validate_by_alias=True,
47+
validate_assignment=True,
48+
protected_namespaces=(),
49+
)
50+
51+
def to_str(self) -> str:
52+
"""Returns the string representation of the model using alias"""
53+
return pprint.pformat(self.model_dump(by_alias=True))
54+
55+
def to_json(self) -> str:
56+
"""Returns the JSON representation of the model using alias"""
57+
return json.dumps(to_jsonable_python(self.to_dict()))
58+
59+
@classmethod
60+
def from_json(cls, json_str: str) -> Optional[Self]:
61+
"""Create an instance of CacheConfig from a JSON string"""
62+
return cls.from_dict(json.loads(json_str))
63+
64+
def to_dict(self) -> Dict[str, Any]:
65+
"""Return the dictionary representation of the model using alias.
66+
67+
This has the following differences from calling pydantic's
68+
`self.model_dump(by_alias=True)`:
69+
70+
* `None` is only added to the output dict for nullable fields that
71+
were set at model initialization. Other fields with value `None`
72+
are ignored.
73+
"""
74+
excluded_fields: Set[str] = set([])
75+
76+
_dict = self.model_dump(
77+
by_alias=True,
78+
exclude=excluded_fields,
79+
exclude_none=True,
80+
)
81+
return _dict
82+
83+
@classmethod
84+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85+
"""Create an instance of CacheConfig from a dict"""
86+
if obj is None:
87+
return None
88+
89+
if not isinstance(obj, dict):
90+
return cls.model_validate(obj)
91+
92+
_obj = cls.model_validate(
93+
{
94+
"cacheKeyHeaders": obj.get("cacheKeyHeaders"),
95+
"queryStringVaryEnabled": obj.get("queryStringVaryEnabled"),
96+
"queryStringVaryParameters": obj.get("queryStringVaryParameters"),
97+
}
98+
)
99+
return _obj
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT CDN API
5+
6+
API used to create and manage your CDN distributions.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
from __future__ import annotations
15+
16+
import json
17+
import pprint
18+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
21+
from pydantic_core import to_jsonable_python
22+
from typing_extensions import Annotated, Self
23+
24+
25+
class CacheConfigCreate(BaseModel):
26+
"""
27+
Groups the cache options that influence how the CDN builds its cache key on distribution creation. **Cache cardinality warning:** enabling query-string vary produces one cache entry per unique query-string combination (**unbounded** when `queryStringVaryParameters` is empty). Each entry in `cacheKeyHeaders` multiplies the number of cache variants by the number of distinct values observed for that header. Use these settings sparingly. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled` so that this feature can be toggled on and off without losing the configured allowlist. Only `queryStringVaryEnabled` gates whether the parameter allowlist actually varies the cache. **Optimizer interaction:** when the Optimizer is enabled, the CDN automatically enables query-string vary for image responses regardless of this setting.
28+
""" # noqa: E501
29+
30+
cache_key_headers: Optional[List[Annotated[str, Field(strict=True)]]] = Field(
31+
default=None,
32+
description="HTTP request header names whose values participate in the cache key. Each entry multiplies the number of cache variants by the number of distinct values observed for that header. ",
33+
alias="cacheKeyHeaders",
34+
)
35+
query_string_vary_enabled: Optional[StrictBool] = Field(
36+
default=False,
37+
description="When true, the CDN varies its cache by the request query string. If `queryStringVaryParameters` is empty, every unique query-string combination produces its own cache entry; if non-empty, only the listed parameters influence the cache key. ",
38+
alias="queryStringVaryEnabled",
39+
)
40+
query_string_vary_parameters: Optional[List[Annotated[str, Field(strict=True)]]] = Field(
41+
default=None,
42+
description="Allowlist of query-string parameter names that participate in the cache key when `queryStringVaryEnabled` is true. Ignored while `queryStringVaryEnabled` is false, but still stored so it can be re-activated without losing the list. ",
43+
alias="queryStringVaryParameters",
44+
)
45+
__properties: ClassVar[List[str]] = ["cacheKeyHeaders", "queryStringVaryEnabled", "queryStringVaryParameters"]
46+
47+
model_config = ConfigDict(
48+
validate_by_name=True,
49+
validate_by_alias=True,
50+
validate_assignment=True,
51+
protected_namespaces=(),
52+
)
53+
54+
def to_str(self) -> str:
55+
"""Returns the string representation of the model using alias"""
56+
return pprint.pformat(self.model_dump(by_alias=True))
57+
58+
def to_json(self) -> str:
59+
"""Returns the JSON representation of the model using alias"""
60+
return json.dumps(to_jsonable_python(self.to_dict()))
61+
62+
@classmethod
63+
def from_json(cls, json_str: str) -> Optional[Self]:
64+
"""Create an instance of CacheConfigCreate from a JSON string"""
65+
return cls.from_dict(json.loads(json_str))
66+
67+
def to_dict(self) -> Dict[str, Any]:
68+
"""Return the dictionary representation of the model using alias.
69+
70+
This has the following differences from calling pydantic's
71+
`self.model_dump(by_alias=True)`:
72+
73+
* `None` is only added to the output dict for nullable fields that
74+
were set at model initialization. Other fields with value `None`
75+
are ignored.
76+
"""
77+
excluded_fields: Set[str] = set([])
78+
79+
_dict = self.model_dump(
80+
by_alias=True,
81+
exclude=excluded_fields,
82+
exclude_none=True,
83+
)
84+
return _dict
85+
86+
@classmethod
87+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88+
"""Create an instance of CacheConfigCreate from a dict"""
89+
if obj is None:
90+
return None
91+
92+
if not isinstance(obj, dict):
93+
return cls.model_validate(obj)
94+
95+
_obj = cls.model_validate(
96+
{
97+
"cacheKeyHeaders": obj.get("cacheKeyHeaders"),
98+
"queryStringVaryEnabled": (
99+
obj.get("queryStringVaryEnabled") if obj.get("queryStringVaryEnabled") is not None else False
100+
),
101+
"queryStringVaryParameters": obj.get("queryStringVaryParameters"),
102+
}
103+
)
104+
return _obj

0 commit comments

Comments
 (0)