Skip to content

Generator: Update SDK /services/cdn #2069

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
32 changes: 32 additions & 0 deletions services/cdn/src/stackit/cdn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,29 @@
"GenericJSONResponse",
"GetCacheInfoResponse",
"GetCacheInfoResponseHistoryEntry",
"GetCustomDomainCustomCertificate",
"GetCustomDomainManagedCertificate",
"GetCustomDomainResponse",
"GetCustomDomainResponseCertificate",
"GetDistributionResponse",
"GetLogsResponse",
"GetStatisticsResponse",
"HttpBackend",
"HttpBackendPatch",
"ListDistributionsResponse",
"LokiLogSink",
"Optimizer",
"OptimizerPatch",
"PatchDistributionPayload",
"PatchDistributionResponse",
"PatchLokiLogSink",
"PurgeCachePayload",
"PutCustomDomainCustomCertificate",
"PutCustomDomainManagedCertificate",
"PutCustomDomainPayload",
"PutCustomDomainPayloadCertificate",
"PutCustomDomainResponse",
"PutCustomDomainResponseCertificate",
"Region",
"StatusError",
]
Expand Down Expand Up @@ -127,9 +136,18 @@
from stackit.cdn.models.get_cache_info_response_history_entry import (
GetCacheInfoResponseHistoryEntry as GetCacheInfoResponseHistoryEntry,
)
from stackit.cdn.models.get_custom_domain_custom_certificate import (
GetCustomDomainCustomCertificate as GetCustomDomainCustomCertificate,
)
from stackit.cdn.models.get_custom_domain_managed_certificate import (
GetCustomDomainManagedCertificate as GetCustomDomainManagedCertificate,
)
from stackit.cdn.models.get_custom_domain_response import (
GetCustomDomainResponse as GetCustomDomainResponse,
)
from stackit.cdn.models.get_custom_domain_response_certificate import (
GetCustomDomainResponseCertificate as GetCustomDomainResponseCertificate,
)
from stackit.cdn.models.get_distribution_response import (
GetDistributionResponse as GetDistributionResponse,
)
Expand All @@ -142,6 +160,7 @@
from stackit.cdn.models.list_distributions_response import (
ListDistributionsResponse as ListDistributionsResponse,
)
from stackit.cdn.models.loki_log_sink import LokiLogSink as LokiLogSink
from stackit.cdn.models.optimizer import Optimizer as Optimizer
from stackit.cdn.models.optimizer_patch import OptimizerPatch as OptimizerPatch
from stackit.cdn.models.patch_distribution_payload import (
Expand All @@ -150,14 +169,27 @@
from stackit.cdn.models.patch_distribution_response import (
PatchDistributionResponse as PatchDistributionResponse,
)
from stackit.cdn.models.patch_loki_log_sink import PatchLokiLogSink as PatchLokiLogSink
from stackit.cdn.models.purge_cache_payload import (
PurgeCachePayload as PurgeCachePayload,
)
from stackit.cdn.models.put_custom_domain_custom_certificate import (
PutCustomDomainCustomCertificate as PutCustomDomainCustomCertificate,
)
from stackit.cdn.models.put_custom_domain_managed_certificate import (
PutCustomDomainManagedCertificate as PutCustomDomainManagedCertificate,
)
from stackit.cdn.models.put_custom_domain_payload import (
PutCustomDomainPayload as PutCustomDomainPayload,
)
from stackit.cdn.models.put_custom_domain_payload_certificate import (
PutCustomDomainPayloadCertificate as PutCustomDomainPayloadCertificate,
)
from stackit.cdn.models.put_custom_domain_response import (
PutCustomDomainResponse as PutCustomDomainResponse,
)
from stackit.cdn.models.put_custom_domain_response_certificate import (
PutCustomDomainResponseCertificate as PutCustomDomainResponseCertificate,
)
from stackit.cdn.models.region import Region as Region
from stackit.cdn.models.status_error import StatusError as StatusError
129 changes: 129 additions & 0 deletions services/cdn/src/stackit/cdn/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from pydantic import (
Field,
StrictBool,
StrictFloat,
StrictInt,
StrictStr,
Expand Down Expand Up @@ -1971,6 +1972,30 @@ def get_logs(
),
] = None,
sort_order: Optional[StrictStr] = None,
data_center_region: Annotated[
Optional[StrictStr],
Field(
description="Filters by the CDN data center region that served the request. Can be combined with other filters "
),
] = None,
request_country_code: Annotated[
Optional[StrictStr],
Field(
description="Filters by the originating country of the user request. Can be combined with other filters "
),
] = None,
status_code: Annotated[
Optional[StrictInt],
Field(
description="Filters by the HTTP status code returned to the client. Can be combined with other filters "
),
] = None,
cache_hit: Annotated[
Optional[StrictBool],
Field(
description="Filters based on whether the request was served from the CDN cache. Can be combined with other filters "
),
] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -2000,6 +2025,14 @@ def get_logs(
:type sort_by: str
:param sort_order:
:type sort_order: str
:param data_center_region: Filters by the CDN data center region that served the request. Can be combined with other filters
:type data_center_region: str
:param request_country_code: Filters by the originating country of the user request. Can be combined with other filters
:type request_country_code: str
:param status_code: Filters by the HTTP status code returned to the client. Can be combined with other filters
:type status_code: int
:param cache_hit: Filters based on whether the request was served from the CDN cache. Can be combined with other filters
:type cache_hit: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -2031,6 +2064,10 @@ def get_logs(
page_identifier=page_identifier,
sort_by=sort_by,
sort_order=sort_order,
data_center_region=data_center_region,
request_country_code=request_country_code,
status_code=status_code,
cache_hit=cache_hit,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -2083,6 +2120,30 @@ def get_logs_with_http_info(
),
] = None,
sort_order: Optional[StrictStr] = None,
data_center_region: Annotated[
Optional[StrictStr],
Field(
description="Filters by the CDN data center region that served the request. Can be combined with other filters "
),
] = None,
request_country_code: Annotated[
Optional[StrictStr],
Field(
description="Filters by the originating country of the user request. Can be combined with other filters "
),
] = None,
status_code: Annotated[
Optional[StrictInt],
Field(
description="Filters by the HTTP status code returned to the client. Can be combined with other filters "
),
] = None,
cache_hit: Annotated[
Optional[StrictBool],
Field(
description="Filters based on whether the request was served from the CDN cache. Can be combined with other filters "
),
] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -2112,6 +2173,14 @@ def get_logs_with_http_info(
:type sort_by: str
:param sort_order:
:type sort_order: str
:param data_center_region: Filters by the CDN data center region that served the request. Can be combined with other filters
:type data_center_region: str
:param request_country_code: Filters by the originating country of the user request. Can be combined with other filters
:type request_country_code: str
:param status_code: Filters by the HTTP status code returned to the client. Can be combined with other filters
:type status_code: int
:param cache_hit: Filters based on whether the request was served from the CDN cache. Can be combined with other filters
:type cache_hit: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -2143,6 +2212,10 @@ def get_logs_with_http_info(
page_identifier=page_identifier,
sort_by=sort_by,
sort_order=sort_order,
data_center_region=data_center_region,
request_country_code=request_country_code,
status_code=status_code,
cache_hit=cache_hit,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -2195,6 +2268,30 @@ def get_logs_without_preload_content(
),
] = None,
sort_order: Optional[StrictStr] = None,
data_center_region: Annotated[
Optional[StrictStr],
Field(
description="Filters by the CDN data center region that served the request. Can be combined with other filters "
),
] = None,
request_country_code: Annotated[
Optional[StrictStr],
Field(
description="Filters by the originating country of the user request. Can be combined with other filters "
),
] = None,
status_code: Annotated[
Optional[StrictInt],
Field(
description="Filters by the HTTP status code returned to the client. Can be combined with other filters "
),
] = None,
cache_hit: Annotated[
Optional[StrictBool],
Field(
description="Filters based on whether the request was served from the CDN cache. Can be combined with other filters "
),
] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -2224,6 +2321,14 @@ def get_logs_without_preload_content(
:type sort_by: str
:param sort_order:
:type sort_order: str
:param data_center_region: Filters by the CDN data center region that served the request. Can be combined with other filters
:type data_center_region: str
:param request_country_code: Filters by the originating country of the user request. Can be combined with other filters
:type request_country_code: str
:param status_code: Filters by the HTTP status code returned to the client. Can be combined with other filters
:type status_code: int
:param cache_hit: Filters based on whether the request was served from the CDN cache. Can be combined with other filters
:type cache_hit: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -2255,6 +2360,10 @@ def get_logs_without_preload_content(
page_identifier=page_identifier,
sort_by=sort_by,
sort_order=sort_order,
data_center_region=data_center_region,
request_country_code=request_country_code,
status_code=status_code,
cache_hit=cache_hit,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand All @@ -2280,6 +2389,10 @@ def _get_logs_serialize(
page_identifier,
sort_by,
sort_order,
data_center_region,
request_country_code,
status_code,
cache_hit,
_request_auth,
_content_type,
_headers,
Expand Down Expand Up @@ -2331,6 +2444,22 @@ def _get_logs_serialize(

_query_params.append(("sortOrder", sort_order))

if data_center_region is not None:

_query_params.append(("dataCenterRegion", data_center_region))

if request_country_code is not None:

_query_params.append(("requestCountryCode", request_country_code))

if status_code is not None:

_query_params.append(("statusCode", status_code))

if cache_hit is not None:

_query_params.append(("cacheHit", cache_hit))

# process the header parameters
# process the form parameters
# process the body parameter
Expand Down
23 changes: 23 additions & 0 deletions services/cdn/src/stackit/cdn/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,42 @@
from stackit.cdn.models.get_cache_info_response_history_entry import (
GetCacheInfoResponseHistoryEntry,
)
from stackit.cdn.models.get_custom_domain_custom_certificate import (
GetCustomDomainCustomCertificate,
)
from stackit.cdn.models.get_custom_domain_managed_certificate import (
GetCustomDomainManagedCertificate,
)
from stackit.cdn.models.get_custom_domain_response import GetCustomDomainResponse
from stackit.cdn.models.get_custom_domain_response_certificate import (
GetCustomDomainResponseCertificate,
)
from stackit.cdn.models.get_distribution_response import GetDistributionResponse
from stackit.cdn.models.get_logs_response import GetLogsResponse
from stackit.cdn.models.get_statistics_response import GetStatisticsResponse
from stackit.cdn.models.http_backend import HttpBackend
from stackit.cdn.models.http_backend_patch import HttpBackendPatch
from stackit.cdn.models.list_distributions_response import ListDistributionsResponse
from stackit.cdn.models.loki_log_sink import LokiLogSink
from stackit.cdn.models.optimizer import Optimizer
from stackit.cdn.models.optimizer_patch import OptimizerPatch
from stackit.cdn.models.patch_distribution_payload import PatchDistributionPayload
from stackit.cdn.models.patch_distribution_response import PatchDistributionResponse
from stackit.cdn.models.patch_loki_log_sink import PatchLokiLogSink
from stackit.cdn.models.purge_cache_payload import PurgeCachePayload
from stackit.cdn.models.put_custom_domain_custom_certificate import (
PutCustomDomainCustomCertificate,
)
from stackit.cdn.models.put_custom_domain_managed_certificate import (
PutCustomDomainManagedCertificate,
)
from stackit.cdn.models.put_custom_domain_payload import PutCustomDomainPayload
from stackit.cdn.models.put_custom_domain_payload_certificate import (
PutCustomDomainPayloadCertificate,
)
from stackit.cdn.models.put_custom_domain_response import PutCustomDomainResponse
from stackit.cdn.models.put_custom_domain_response_certificate import (
PutCustomDomainResponseCertificate,
)
from stackit.cdn.models.region import Region
from stackit.cdn.models.status_error import StatusError
7 changes: 7 additions & 0 deletions services/cdn/src/stackit/cdn/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from typing_extensions import Annotated, Self

from stackit.cdn.models.http_backend import HttpBackend
from stackit.cdn.models.loki_log_sink import LokiLogSink
from stackit.cdn.models.optimizer import Optimizer
from stackit.cdn.models.region import Region

Expand All @@ -44,6 +45,7 @@ class Config(BaseModel):
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",
)
log_sink: Optional[LokiLogSink] = Field(default=None, alias="logSink")
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 @@ -56,6 +58,7 @@ class Config(BaseModel):
"blockedCountries",
"blockedIPs",
"defaultCacheDuration",
"logSink",
"monthlyLimitBytes",
"optimizer",
"regions",
Expand Down Expand Up @@ -101,6 +104,9 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of backend
if self.backend:
_dict["backend"] = self.backend.to_dict()
# override the default output from pydantic by calling `to_dict()` of log_sink
if self.log_sink:
_dict["logSink"] = self.log_sink.to_dict()
# override the default output from pydantic by calling `to_dict()` of optimizer
if self.optimizer:
_dict["optimizer"] = self.optimizer.to_dict()
Expand Down Expand Up @@ -131,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"blockedCountries": obj.get("blockedCountries"),
"blockedIPs": obj.get("blockedIPs"),
"defaultCacheDuration": obj.get("defaultCacheDuration"),
"logSink": LokiLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
"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
Loading
Loading