Skip to content

Commit 4e80d70

Browse files
Generate cdn
1 parent 0683ee2 commit 4e80d70

File tree

4 files changed

+37
-6
lines changed

4 files changed

+37
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,7 @@ def list_distributions(
27172717
sort_by: Annotated[
27182718
Optional[StrictStr],
27192719
Field(
2720-
description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison "
2720+
description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. "
27212721
),
27222722
] = None,
27232723
sort_order: Optional[StrictStr] = None,
@@ -2741,7 +2741,7 @@ def list_distributions(
27412741
:type page_size: int
27422742
:param page_identifier: Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API.
27432743
:type page_identifier: str
2744-
:param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison
2744+
:param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other.
27452745
:type sort_by: str
27462746
:param sort_order:
27472747
:type sort_order: str
@@ -2811,7 +2811,7 @@ def list_distributions_with_http_info(
28112811
sort_by: Annotated[
28122812
Optional[StrictStr],
28132813
Field(
2814-
description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison "
2814+
description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. "
28152815
),
28162816
] = None,
28172817
sort_order: Optional[StrictStr] = None,
@@ -2835,7 +2835,7 @@ def list_distributions_with_http_info(
28352835
:type page_size: int
28362836
:param page_identifier: Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API.
28372837
:type page_identifier: str
2838-
:param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison
2838+
:param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other.
28392839
:type sort_by: str
28402840
:param sort_order:
28412841
:type sort_order: str
@@ -2905,7 +2905,7 @@ def list_distributions_without_preload_content(
29052905
sort_by: Annotated[
29062906
Optional[StrictStr],
29072907
Field(
2908-
description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison "
2908+
description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. "
29092909
),
29102910
] = None,
29112911
sort_order: Optional[StrictStr] = None,
@@ -2929,7 +2929,7 @@ def list_distributions_without_preload_content(
29292929
:type page_size: int
29302930
:param page_identifier: Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API.
29312931
:type page_identifier: str
2932-
:param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison
2932+
:param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other.
29332933
:type sort_by: str
29342934
:param sort_order:
29352935
:type sort_order: str

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class Config(BaseModel):
3939
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. ",
4040
alias="blockedIPs",
4141
)
42+
default_cache_duration: Optional[StrictStr] = Field(
43+
default=None,
44+
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) ",
45+
alias="defaultCacheDuration",
46+
)
4247
monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
4348
default=None,
4449
description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ",
@@ -50,6 +55,7 @@ class Config(BaseModel):
5055
"backend",
5156
"blockedCountries",
5257
"blockedIPs",
58+
"defaultCacheDuration",
5359
"monthlyLimitBytes",
5460
"optimizer",
5561
"regions",
@@ -98,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]:
98104
# override the default output from pydantic by calling `to_dict()` of optimizer
99105
if self.optimizer:
100106
_dict["optimizer"] = self.optimizer.to_dict()
107+
# set to None if default_cache_duration (nullable) is None
108+
# and model_fields_set contains the field
109+
if self.default_cache_duration is None and "default_cache_duration" in self.model_fields_set:
110+
_dict["defaultCacheDuration"] = None
111+
101112
# set to None if monthly_limit_bytes (nullable) is None
102113
# and model_fields_set contains the field
103114
if self.monthly_limit_bytes is None and "monthly_limit_bytes" in self.model_fields_set:
@@ -119,6 +130,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119130
"backend": ConfigBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None,
120131
"blockedCountries": obj.get("blockedCountries"),
121132
"blockedIPs": obj.get("blockedIPs"),
133+
"defaultCacheDuration": obj.get("defaultCacheDuration"),
122134
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
123135
"optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
124136
"regions": obj.get("regions"),

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ class ConfigPatch(BaseModel):
4141
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. ",
4242
alias="blockedIPs",
4343
)
44+
default_cache_duration: Optional[StrictStr] = Field(
45+
default=None,
46+
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) ",
47+
alias="defaultCacheDuration",
48+
)
4449
monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
4550
default=None,
4651
description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ",
@@ -52,6 +57,7 @@ class ConfigPatch(BaseModel):
5257
"backend",
5358
"blockedCountries",
5459
"blockedIPs",
60+
"defaultCacheDuration",
5561
"monthlyLimitBytes",
5662
"optimizer",
5763
"regions",
@@ -100,6 +106,11 @@ def to_dict(self) -> Dict[str, Any]:
100106
# override the default output from pydantic by calling `to_dict()` of optimizer
101107
if self.optimizer:
102108
_dict["optimizer"] = self.optimizer.to_dict()
109+
# set to None if default_cache_duration (nullable) is None
110+
# and model_fields_set contains the field
111+
if self.default_cache_duration is None and "default_cache_duration" in self.model_fields_set:
112+
_dict["defaultCacheDuration"] = None
113+
103114
# set to None if monthly_limit_bytes (nullable) is None
104115
# and model_fields_set contains the field
105116
if self.monthly_limit_bytes is None and "monthly_limit_bytes" in self.model_fields_set:
@@ -121,6 +132,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
121132
"backend": ConfigPatchBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None,
122133
"blockedCountries": obj.get("blockedCountries"),
123134
"blockedIPs": obj.get("blockedIPs"),
135+
"defaultCacheDuration": obj.get("defaultCacheDuration"),
124136
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
125137
"optimizer": OptimizerPatch.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
126138
"regions": obj.get("regions"),

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class CreateDistributionPayload(BaseModel):
3939
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. ",
4040
alias="blockedIPs",
4141
)
42+
default_cache_duration: Optional[StrictStr] = Field(
43+
default=None,
44+
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) ",
45+
alias="defaultCacheDuration",
46+
)
4247
intent_id: Optional[StrictStr] = Field(
4348
default=None,
4449
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. ",
@@ -65,6 +70,7 @@ class CreateDistributionPayload(BaseModel):
6570
__properties: ClassVar[List[str]] = [
6671
"blockedCountries",
6772
"blockedIPs",
73+
"defaultCacheDuration",
6874
"intentId",
6975
"monthlyLimitBytes",
7076
"optimizer",
@@ -128,6 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
128134
{
129135
"blockedCountries": obj.get("blockedCountries"),
130136
"blockedIPs": obj.get("blockedIPs"),
137+
"defaultCacheDuration": obj.get("defaultCacheDuration"),
131138
"intentId": obj.get("intentId"),
132139
"monthlyLimitBytes": obj.get("monthlyLimitBytes"),
133140
"optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,

0 commit comments

Comments
 (0)