Skip to content

Generator: Update SDK /services/cdn #1280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions services/cdn/src/stackit/cdn/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
12 changes: 12 additions & 0 deletions services/cdn/src/stackit/cdn/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. ",
Expand All @@ -50,6 +55,7 @@ class Config(BaseModel):
"backend",
"blockedCountries",
"blockedIPs",
"defaultCacheDuration",
"monthlyLimitBytes",
"optimizer",
"regions",
Expand Down Expand Up @@ -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:
Expand All @@ -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"),
Expand Down
12 changes: 12 additions & 0 deletions services/cdn/src/stackit/cdn/models/config_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. ",
Expand All @@ -52,6 +57,7 @@ class ConfigPatch(BaseModel):
"backend",
"blockedCountries",
"blockedIPs",
"defaultCacheDuration",
"monthlyLimitBytes",
"optimizer",
"regions",
Expand Down Expand Up @@ -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:
Expand All @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. ",
Expand All @@ -65,6 +70,7 @@ class CreateDistributionPayload(BaseModel):
__properties: ClassVar[List[str]] = [
"blockedCountries",
"blockedIPs",
"defaultCacheDuration",
"intentId",
"monthlyLimitBytes",
"optimizer",
Expand Down Expand Up @@ -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,
Expand Down
Loading