From 4e80d7077c275bef4f707bd845d64ac70d9b0ede Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 13 Jun 2025 12:09:34 +0000 Subject: [PATCH] Generate cdn --- services/cdn/src/stackit/cdn/api/default_api.py | 12 ++++++------ services/cdn/src/stackit/cdn/models/config.py | 12 ++++++++++++ services/cdn/src/stackit/cdn/models/config_patch.py | 12 ++++++++++++ .../cdn/models/create_distribution_payload.py | 7 +++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/services/cdn/src/stackit/cdn/api/default_api.py b/services/cdn/src/stackit/cdn/api/default_api.py index 98bcfcff..6d430383 100644 --- a/services/cdn/src/stackit/cdn/api/default_api.py +++ b/services/cdn/src/stackit/cdn/api/default_api.py @@ -2717,7 +2717,7 @@ def list_distributions( sort_by: Annotated[ Optional[StrictStr], Field( - 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 " + 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. " ), ] = None, sort_order: Optional[StrictStr] = None, @@ -2741,7 +2741,7 @@ def list_distributions( :type page_size: int :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. :type page_identifier: str - :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 + :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. :type sort_by: str :param sort_order: :type sort_order: str @@ -2811,7 +2811,7 @@ def list_distributions_with_http_info( sort_by: Annotated[ Optional[StrictStr], Field( - 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 " + 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. " ), ] = None, sort_order: Optional[StrictStr] = None, @@ -2835,7 +2835,7 @@ def list_distributions_with_http_info( :type page_size: int :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. :type page_identifier: str - :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 + :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. :type sort_by: str :param sort_order: :type sort_order: str @@ -2905,7 +2905,7 @@ def list_distributions_without_preload_content( sort_by: Annotated[ Optional[StrictStr], Field( - 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 " + 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. " ), ] = None, sort_order: Optional[StrictStr] = None, @@ -2929,7 +2929,7 @@ def list_distributions_without_preload_content( :type page_size: int :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. :type page_identifier: str - :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 + :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. :type sort_by: str :param sort_order: :type sort_order: str diff --git a/services/cdn/src/stackit/cdn/models/config.py b/services/cdn/src/stackit/cdn/models/config.py index 76a58119..e5485dcc 100644 --- a/services/cdn/src/stackit/cdn/models/config.py +++ b/services/cdn/src/stackit/cdn/models/config.py @@ -39,6 +39,11 @@ class Config(BaseModel): 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. ", alias="blockedIPs", ) + default_cache_duration: Optional[StrictStr] = Field( + default=None, + 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) ", + alias="defaultCacheDuration", + ) monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( default=None, description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ", @@ -50,6 +55,7 @@ class Config(BaseModel): "backend", "blockedCountries", "blockedIPs", + "defaultCacheDuration", "monthlyLimitBytes", "optimizer", "regions", @@ -98,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of optimizer if self.optimizer: _dict["optimizer"] = self.optimizer.to_dict() + # set to None if default_cache_duration (nullable) is None + # and model_fields_set contains the field + if self.default_cache_duration is None and "default_cache_duration" in self.model_fields_set: + _dict["defaultCacheDuration"] = None + # set to None if monthly_limit_bytes (nullable) is None # and model_fields_set contains the field 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]: "backend": ConfigBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, "blockedCountries": obj.get("blockedCountries"), "blockedIPs": obj.get("blockedIPs"), + "defaultCacheDuration": obj.get("defaultCacheDuration"), "monthlyLimitBytes": obj.get("monthlyLimitBytes"), "optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None, "regions": obj.get("regions"), diff --git a/services/cdn/src/stackit/cdn/models/config_patch.py b/services/cdn/src/stackit/cdn/models/config_patch.py index 1d51c657..d0aee3f6 100644 --- a/services/cdn/src/stackit/cdn/models/config_patch.py +++ b/services/cdn/src/stackit/cdn/models/config_patch.py @@ -41,6 +41,11 @@ class ConfigPatch(BaseModel): 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. ", alias="blockedIPs", ) + default_cache_duration: Optional[StrictStr] = Field( + default=None, + 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) ", + alias="defaultCacheDuration", + ) monthly_limit_bytes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( default=None, description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ", @@ -52,6 +57,7 @@ class ConfigPatch(BaseModel): "backend", "blockedCountries", "blockedIPs", + "defaultCacheDuration", "monthlyLimitBytes", "optimizer", "regions", @@ -100,6 +106,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of optimizer if self.optimizer: _dict["optimizer"] = self.optimizer.to_dict() + # set to None if default_cache_duration (nullable) is None + # and model_fields_set contains the field + if self.default_cache_duration is None and "default_cache_duration" in self.model_fields_set: + _dict["defaultCacheDuration"] = None + # set to None if monthly_limit_bytes (nullable) is None # and model_fields_set contains the field 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]: "backend": ConfigPatchBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, "blockedCountries": obj.get("blockedCountries"), "blockedIPs": obj.get("blockedIPs"), + "defaultCacheDuration": obj.get("defaultCacheDuration"), "monthlyLimitBytes": obj.get("monthlyLimitBytes"), "optimizer": OptimizerPatch.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None, "regions": obj.get("regions"), diff --git a/services/cdn/src/stackit/cdn/models/create_distribution_payload.py b/services/cdn/src/stackit/cdn/models/create_distribution_payload.py index 0a6d69e6..37e3c431 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_payload.py @@ -39,6 +39,11 @@ class CreateDistributionPayload(BaseModel): 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. ", alias="blockedIPs", ) + default_cache_duration: Optional[StrictStr] = Field( + default=None, + 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) ", + alias="defaultCacheDuration", + ) intent_id: Optional[StrictStr] = Field( default=None, 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): __properties: ClassVar[List[str]] = [ "blockedCountries", "blockedIPs", + "defaultCacheDuration", "intentId", "monthlyLimitBytes", "optimizer", @@ -128,6 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "blockedCountries": obj.get("blockedCountries"), "blockedIPs": obj.get("blockedIPs"), + "defaultCacheDuration": obj.get("defaultCacheDuration"), "intentId": obj.get("intentId"), "monthlyLimitBytes": obj.get("monthlyLimitBytes"), "optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,