diff --git a/services/cdn/oas_commit b/services/cdn/oas_commit index 064e1081..e3713dde 100644 --- a/services/cdn/oas_commit +++ b/services/cdn/oas_commit @@ -1 +1 @@ -cfcfc32bc1ae335acecd7bf7ffb60354fdc565ab +0e64886dd0847341800d7191ed193b75413be998 diff --git a/services/cdn/src/stackit/cdn/__init__.py b/services/cdn/src/stackit/cdn/__init__.py index c3aae32e..468b25fa 100644 --- a/services/cdn/src/stackit/cdn/__init__.py +++ b/services/cdn/src/stackit/cdn/__init__.py @@ -3,7 +3,7 @@ # flake8: noqa """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/api/default_api.py b/services/cdn/src/stackit/cdn/api/default_api.py index 76e32750..d7a858d8 100644 --- a/services/cdn/src/stackit/cdn/api/default_api.py +++ b/services/cdn/src/stackit/cdn/api/default_api.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -13,6 +13,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union +from uuid import UUID from pydantic import ( Field, @@ -329,7 +330,7 @@ def _create_distribution_serialize( def delete_custom_domain( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], intent_id: Optional[StrictStr] = None, _request_timeout: Union[ @@ -349,7 +350,7 @@ def delete_custom_domain( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param intent_id: @@ -404,7 +405,7 @@ def delete_custom_domain( def delete_custom_domain_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], intent_id: Optional[StrictStr] = None, _request_timeout: Union[ @@ -424,7 +425,7 @@ def delete_custom_domain_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param intent_id: @@ -479,7 +480,7 @@ def delete_custom_domain_with_http_info( def delete_custom_domain_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], intent_id: Optional[StrictStr] = None, _request_timeout: Union[ @@ -499,7 +500,7 @@ def delete_custom_domain_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param intent_id: @@ -611,7 +612,7 @@ def _delete_custom_domain_serialize( def delete_distribution( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, intent_id: Annotated[ Optional[StrictStr], Field( @@ -635,7 +636,7 @@ def delete_distribution( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param intent_id: While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. :type intent_id: str :param _request_timeout: timeout setting for this request. If one @@ -687,7 +688,7 @@ def delete_distribution( def delete_distribution_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, intent_id: Annotated[ Optional[StrictStr], Field( @@ -711,7 +712,7 @@ def delete_distribution_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param intent_id: While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. :type intent_id: str :param _request_timeout: timeout setting for this request. If one @@ -763,7 +764,7 @@ def delete_distribution_with_http_info( def delete_distribution_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, intent_id: Annotated[ Optional[StrictStr], Field( @@ -787,7 +788,7 @@ def delete_distribution_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param intent_id: While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. :type intent_id: str :param _request_timeout: timeout setting for this request. If one @@ -893,7 +894,7 @@ def _delete_distribution_serialize( def find_cache_paths( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, path: Annotated[StrictStr, Field(description="A substring of the search query. ")], _request_timeout: Union[ None, @@ -912,7 +913,7 @@ def find_cache_paths( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param path: A substring of the search query. (required) :type path: str :param _request_timeout: timeout setting for this request. If one @@ -964,7 +965,7 @@ def find_cache_paths( def find_cache_paths_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, path: Annotated[StrictStr, Field(description="A substring of the search query. ")], _request_timeout: Union[ None, @@ -983,7 +984,7 @@ def find_cache_paths_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param path: A substring of the search query. (required) :type path: str :param _request_timeout: timeout setting for this request. If one @@ -1035,7 +1036,7 @@ def find_cache_paths_with_http_info( def find_cache_paths_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, path: Annotated[StrictStr, Field(description="A substring of the search query. ")], _request_timeout: Union[ None, @@ -1054,7 +1055,7 @@ def find_cache_paths_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param path: A substring of the search query. (required) :type path: str :param _request_timeout: timeout setting for this request. If one @@ -1160,7 +1161,7 @@ def _find_cache_paths_serialize( def get_cache_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, purge_path: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -1179,7 +1180,7 @@ def get_cache_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param purge_path: :type purge_path: str :param _request_timeout: timeout setting for this request. If one @@ -1231,7 +1232,7 @@ def get_cache_info( def get_cache_info_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, purge_path: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -1250,7 +1251,7 @@ def get_cache_info_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param purge_path: :type purge_path: str :param _request_timeout: timeout setting for this request. If one @@ -1302,7 +1303,7 @@ def get_cache_info_with_http_info( def get_cache_info_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, purge_path: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -1321,7 +1322,7 @@ def get_cache_info_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param purge_path: :type purge_path: str :param _request_timeout: timeout setting for this request. If one @@ -1427,7 +1428,7 @@ def _get_cache_info_serialize( def get_custom_domain( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], _request_timeout: Union[ None, @@ -1446,7 +1447,7 @@ def get_custom_domain( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param _request_timeout: timeout setting for this request. If one @@ -1499,7 +1500,7 @@ def get_custom_domain( def get_custom_domain_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], _request_timeout: Union[ None, @@ -1518,7 +1519,7 @@ def get_custom_domain_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param _request_timeout: timeout setting for this request. If one @@ -1571,7 +1572,7 @@ def get_custom_domain_with_http_info( def get_custom_domain_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], _request_timeout: Union[ None, @@ -1590,7 +1591,7 @@ def get_custom_domain_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param _request_timeout: timeout setting for this request. If one @@ -1695,7 +1696,7 @@ def _get_custom_domain_serialize( def get_distribution( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, with_waf_status: Annotated[ Optional[StrictBool], Field( @@ -1719,7 +1720,7 @@ def get_distribution( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param with_waf_status: If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. :type with_waf_status: bool :param _request_timeout: timeout setting for this request. If one @@ -1772,7 +1773,7 @@ def get_distribution( def get_distribution_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, with_waf_status: Annotated[ Optional[StrictBool], Field( @@ -1796,7 +1797,7 @@ def get_distribution_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param with_waf_status: If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. :type with_waf_status: bool :param _request_timeout: timeout setting for this request. If one @@ -1849,7 +1850,7 @@ def get_distribution_with_http_info( def get_distribution_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, with_waf_status: Annotated[ Optional[StrictBool], Field( @@ -1873,7 +1874,7 @@ def get_distribution_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param with_waf_status: If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. :type with_waf_status: bool :param _request_timeout: timeout setting for this request. If one @@ -1980,7 +1981,7 @@ def _get_distribution_serialize( def get_logs( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution Id")], + distribution_id: Annotated[UUID, Field(description="Your CDN distribution Id")], var_from: Annotated[ Optional[datetime], Field(description="the start of the time range for which logs should be returned") ] = None, @@ -2055,7 +2056,7 @@ def get_logs( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: Your CDN distribution Id (required) - :type distribution_id: str + :type distribution_id: UUID :param var_from: the start of the time range for which logs should be returned :type var_from: datetime :param to: the end of the time range for which logs should be returned. If not specified, \"now\" is used. @@ -2137,7 +2138,7 @@ def get_logs( def get_logs_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution Id")], + distribution_id: Annotated[UUID, Field(description="Your CDN distribution Id")], var_from: Annotated[ Optional[datetime], Field(description="the start of the time range for which logs should be returned") ] = None, @@ -2212,7 +2213,7 @@ def get_logs_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: Your CDN distribution Id (required) - :type distribution_id: str + :type distribution_id: UUID :param var_from: the start of the time range for which logs should be returned :type var_from: datetime :param to: the end of the time range for which logs should be returned. If not specified, \"now\" is used. @@ -2294,7 +2295,7 @@ def get_logs_with_http_info( def get_logs_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution Id")], + distribution_id: Annotated[UUID, Field(description="Your CDN distribution Id")], var_from: Annotated[ Optional[datetime], Field(description="the start of the time range for which logs should be returned") ] = None, @@ -2369,7 +2370,7 @@ def get_logs_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: Your CDN distribution Id (required) - :type distribution_id: str + :type distribution_id: UUID :param var_from: the start of the time range for which logs should be returned :type var_from: datetime :param to: the end of the time range for which logs should be returned. If not specified, \"now\" is used. @@ -2559,7 +2560,7 @@ def _get_logs_serialize( def get_logs_search_filters( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID.")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution ID.")], + distribution_id: Annotated[UUID, Field(description="Your CDN distribution ID.")], filter: Annotated[ Optional[StrictStr], Field(description="Optional search string. Will search the **values** for the text input."), @@ -2580,7 +2581,7 @@ def get_logs_search_filters( :param project_id: Your STACKIT Project ID. (required) :type project_id: str :param distribution_id: Your CDN distribution ID. (required) - :type distribution_id: str + :type distribution_id: UUID :param filter: Optional search string. Will search the **values** for the text input. :type filter: str :param _request_timeout: timeout setting for this request. If one @@ -2633,7 +2634,7 @@ def get_logs_search_filters( def get_logs_search_filters_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID.")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution ID.")], + distribution_id: Annotated[UUID, Field(description="Your CDN distribution ID.")], filter: Annotated[ Optional[StrictStr], Field(description="Optional search string. Will search the **values** for the text input."), @@ -2654,7 +2655,7 @@ def get_logs_search_filters_with_http_info( :param project_id: Your STACKIT Project ID. (required) :type project_id: str :param distribution_id: Your CDN distribution ID. (required) - :type distribution_id: str + :type distribution_id: UUID :param filter: Optional search string. Will search the **values** for the text input. :type filter: str :param _request_timeout: timeout setting for this request. If one @@ -2707,7 +2708,7 @@ def get_logs_search_filters_with_http_info( def get_logs_search_filters_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID.")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution ID.")], + distribution_id: Annotated[UUID, Field(description="Your CDN distribution ID.")], filter: Annotated[ Optional[StrictStr], Field(description="Optional search string. Will search the **values** for the text input."), @@ -2728,7 +2729,7 @@ def get_logs_search_filters_without_preload_content( :param project_id: Your STACKIT Project ID. (required) :type project_id: str :param distribution_id: Your CDN distribution ID. (required) - :type distribution_id: str + :type distribution_id: UUID :param filter: Optional search string. Will search the **values** for the text input. :type filter: str :param _request_timeout: timeout setting for this request. If one @@ -2835,7 +2836,7 @@ def _get_logs_search_filters_serialize( def get_statistics( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, var_from: Annotated[ datetime, Field(description="the start of the time range for which statistics should be returned") ], @@ -2868,7 +2869,7 @@ def get_statistics( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param var_from: the start of the time range for which statistics should be returned (required) :type var_from: datetime :param to: the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. @@ -2926,7 +2927,7 @@ def get_statistics( def get_statistics_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, var_from: Annotated[ datetime, Field(description="the start of the time range for which statistics should be returned") ], @@ -2959,7 +2960,7 @@ def get_statistics_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param var_from: the start of the time range for which statistics should be returned (required) :type var_from: datetime :param to: the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. @@ -3017,7 +3018,7 @@ def get_statistics_with_http_info( def get_statistics_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, var_from: Annotated[ datetime, Field(description="the start of the time range for which statistics should be returned") ], @@ -3050,7 +3051,7 @@ def get_statistics_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param var_from: the start of the time range for which statistics should be returned (required) :type var_from: datetime :param to: the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. @@ -4064,7 +4065,7 @@ def _patch_distribution_serialize( def purge_cache( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, purge_cache_payload: Optional[PurgeCachePayload] = None, _request_timeout: Union[ None, @@ -4083,7 +4084,7 @@ def purge_cache( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param purge_cache_payload: :type purge_cache_payload: PurgeCachePayload :param _request_timeout: timeout setting for this request. If one @@ -4135,7 +4136,7 @@ def purge_cache( def purge_cache_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, purge_cache_payload: Optional[PurgeCachePayload] = None, _request_timeout: Union[ None, @@ -4154,7 +4155,7 @@ def purge_cache_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param purge_cache_payload: :type purge_cache_payload: PurgeCachePayload :param _request_timeout: timeout setting for this request. If one @@ -4206,7 +4207,7 @@ def purge_cache_with_http_info( def purge_cache_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, purge_cache_payload: Optional[PurgeCachePayload] = None, _request_timeout: Union[ None, @@ -4225,7 +4226,7 @@ def purge_cache_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param purge_cache_payload: :type purge_cache_payload: PurgeCachePayload :param _request_timeout: timeout setting for this request. If one @@ -4337,7 +4338,7 @@ def _purge_cache_serialize( def put_custom_domain( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], put_custom_domain_payload: Optional[PutCustomDomainPayload] = None, _request_timeout: Union[ @@ -4357,7 +4358,7 @@ def put_custom_domain( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param put_custom_domain_payload: @@ -4412,7 +4413,7 @@ def put_custom_domain( def put_custom_domain_with_http_info( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], put_custom_domain_payload: Optional[PutCustomDomainPayload] = None, _request_timeout: Union[ @@ -4432,7 +4433,7 @@ def put_custom_domain_with_http_info( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param put_custom_domain_payload: @@ -4487,7 +4488,7 @@ def put_custom_domain_with_http_info( def put_custom_domain_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], - distribution_id: StrictStr, + distribution_id: UUID, domain: Annotated[str, Field(strict=True, max_length=72)], put_custom_domain_payload: Optional[PutCustomDomainPayload] = None, _request_timeout: Union[ @@ -4507,7 +4508,7 @@ def put_custom_domain_without_preload_content( :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) - :type distribution_id: str + :type distribution_id: UUID :param domain: (required) :type domain: str :param put_custom_domain_payload: diff --git a/services/cdn/src/stackit/cdn/api_client.py b/services/cdn/src/stackit/cdn/api_client.py index 9a87aa62..d6e18713 100644 --- a/services/cdn/src/stackit/cdn/api_client.py +++ b/services/cdn/src/stackit/cdn/api_client.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -12,11 +12,13 @@ """ # noqa: E501 import datetime +import decimal import json import mimetypes import os import re import tempfile +import uuid from enum import Enum from typing import Dict, List, Optional, Tuple, Union from urllib.parse import quote @@ -63,8 +65,10 @@ class ApiClient: "bool": bool, "date": datetime.date, "datetime": datetime.datetime, + "decimal": decimal.Decimal, "object": object, } + _pool = None def __init__(self, configuration, header_name=None, header_value=None, cookie=None) -> None: self.config: Configuration = configuration @@ -267,7 +271,7 @@ def response_deserialize( return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader("content-type") + content_type = response_data.headers.get("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" @@ -284,7 +288,7 @@ def response_deserialize( return ApiResponse( status_code=response_data.status, data=return_data, - headers=response_data.getheaders(), + headers=response_data.headers, raw_data=response_data.data, ) @@ -296,6 +300,7 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -311,12 +316,16 @@ def sanitize_for_serialization(self, obj): return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj + elif isinstance(obj, uuid.UUID): + return str(obj) elif isinstance(obj, list): return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] elif isinstance(obj, tuple): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -326,7 +335,7 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - if hasattr(obj, "to_dict") and callable(obj.to_dict): + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): obj_dict = obj.to_dict() else: obj_dict = obj.__dict__ @@ -354,7 +363,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): + elif re.match(r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: @@ -400,12 +409,14 @@ def __deserialize(self, data, klass): if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) - elif klass == object: + elif klass is object: return self.__deserialize_object(data) - elif klass == datetime.date: + elif klass is datetime.date: return self.__deserialize_date(data) - elif klass == datetime.datetime: + elif klass is datetime.datetime: return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: @@ -553,12 +564,14 @@ def __deserialize_file(self, response): os.close(fd) os.remove(path) - content_disposition = response.getheader("Content-Disposition") + content_disposition = response.headers.get("Content-Disposition") if content_disposition: m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) if m is None: raise ValueError("Unexpected 'content-disposition' header value") - filename = m.group(1) + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: diff --git a/services/cdn/src/stackit/cdn/configuration.py b/services/cdn/src/stackit/cdn/configuration.py index 8862407f..145d4e19 100644 --- a/services/cdn/src/stackit/cdn/configuration.py +++ b/services/cdn/src/stackit/cdn/configuration.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/exceptions.py b/services/cdn/src/stackit/cdn/exceptions.py index 1e539ba3..e99e9890 100644 --- a/services/cdn/src/stackit/cdn/exceptions.py +++ b/services/cdn/src/stackit/cdn/exceptions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -129,7 +129,7 @@ def __init__( self.body = http_resp.data.decode("utf-8") except Exception: # noqa: S110 pass - self.headers = http_resp.getheaders() + self.headers = http_resp.headers @classmethod def from_response( diff --git a/services/cdn/src/stackit/cdn/models/__init__.py b/services/cdn/src/stackit/cdn/models/__init__.py index 4c2c90b4..4db1a0de 100644 --- a/services/cdn/src/stackit/cdn/models/__init__.py +++ b/services/cdn/src/stackit/cdn/models/__init__.py @@ -2,7 +2,7 @@ # flake8: noqa """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -12,7 +12,6 @@ Do not edit the class manually. """ # noqa: E501 - # import models into model package from stackit.cdn.models.bucket_backend import BucketBackend from stackit.cdn.models.bucket_backend_create import BucketBackendCreate diff --git a/services/cdn/src/stackit/cdn/models/bucket_backend.py b/services/cdn/src/stackit/cdn/models/bucket_backend.py index 629574e5..4a0da218 100644 --- a/services/cdn/src/stackit/cdn/models/bucket_backend.py +++ b/services/cdn/src/stackit/cdn/models/bucket_backend.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/bucket_backend_create.py b/services/cdn/src/stackit/cdn/models/bucket_backend_create.py index ca3ee3db..2bf67e67 100644 --- a/services/cdn/src/stackit/cdn/models/bucket_backend_create.py +++ b/services/cdn/src/stackit/cdn/models/bucket_backend_create.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py b/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py index 835c532b..bb9cbb29 100644 --- a/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py +++ b/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/bucket_credentials.py b/services/cdn/src/stackit/cdn/models/bucket_credentials.py index c2110baa..7faa0ced 100644 --- a/services/cdn/src/stackit/cdn/models/bucket_credentials.py +++ b/services/cdn/src/stackit/cdn/models/bucket_credentials.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/config.py b/services/cdn/src/stackit/cdn/models/config.py index 0da37475..8a4c40d1 100644 --- a/services/cdn/src/stackit/cdn/models/config.py +++ b/services/cdn/src/stackit/cdn/models/config.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/config_backend.py b/services/cdn/src/stackit/cdn/models/config_backend.py index 9024b819..dff55acd 100644 --- a/services/cdn/src/stackit/cdn/models/config_backend.py +++ b/services/cdn/src/stackit/cdn/models/config_backend.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/config_patch.py b/services/cdn/src/stackit/cdn/models/config_patch.py index 5ca32461..6d143dc1 100644 --- a/services/cdn/src/stackit/cdn/models/config_patch.py +++ b/services/cdn/src/stackit/cdn/models/config_patch.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/config_patch_backend.py b/services/cdn/src/stackit/cdn/models/config_patch_backend.py index b8d43df1..58aef53b 100644 --- a/services/cdn/src/stackit/cdn/models/config_patch_backend.py +++ b/services/cdn/src/stackit/cdn/models/config_patch_backend.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. 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 724fa9c4..cc742284 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_payload.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/create_distribution_payload_backend.py b/services/cdn/src/stackit/cdn/models/create_distribution_payload_backend.py index 3972d06a..52b5b685 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_payload_backend.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_payload_backend.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/create_distribution_response.py b/services/cdn/src/stackit/cdn/models/create_distribution_response.py index 53f3dfa3..b74c34ce 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/custom_domain.py b/services/cdn/src/stackit/cdn/models/custom_domain.py index ed6f0823..26df40d6 100644 --- a/services/cdn/src/stackit/cdn/models/custom_domain.py +++ b/services/cdn/src/stackit/cdn/models/custom_domain.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in errors (list) _items = [] if self.errors: - for _item in self.errors: - if _item: - _items.append(_item.to_dict()) + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) _dict["errors"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py b/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py index 711696b6..40b1884a 100644 --- a/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py +++ b/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/delete_distribution_response.py b/services/cdn/src/stackit/cdn/models/delete_distribution_response.py index 6756b851..6236dfec 100644 --- a/services/cdn/src/stackit/cdn/models/delete_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/delete_distribution_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/distribution.py b/services/cdn/src/stackit/cdn/models/distribution.py index 0396d462..675010af 100644 --- a/services/cdn/src/stackit/cdn/models/distribution.py +++ b/services/cdn/src/stackit/cdn/models/distribution.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -140,16 +140,16 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in domains (list) _items = [] if self.domains: - for _item in self.domains: - if _item: - _items.append(_item.to_dict()) + for _item_domains in self.domains: + if _item_domains: + _items.append(_item_domains.to_dict()) _dict["domains"] = _items # override the default output from pydantic by calling `to_dict()` of each item in errors (list) _items = [] if self.errors: - for _item in self.errors: - if _item: - _items.append(_item.to_dict()) + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) _dict["errors"] = _items # override the default output from pydantic by calling `to_dict()` of waf if self.waf: diff --git a/services/cdn/src/stackit/cdn/models/distribution_logs_record.py b/services/cdn/src/stackit/cdn/models/distribution_logs_record.py index 267b786e..db263da4 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_logs_record.py +++ b/services/cdn/src/stackit/cdn/models/distribution_logs_record.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py b/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py index be2f163b..91394072 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py index 97d6718b..44fcbcc9 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py index f25888e6..63e0a941 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/distribution_waf.py b/services/cdn/src/stackit/cdn/models/distribution_waf.py index 70ce0853..1ac6394f 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_waf.py +++ b/services/cdn/src/stackit/cdn/models/distribution_waf.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -73,23 +73,23 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in disabled_rules (list) _items = [] if self.disabled_rules: - for _item in self.disabled_rules: - if _item: - _items.append(_item.to_dict()) + for _item_disabled_rules in self.disabled_rules: + if _item_disabled_rules: + _items.append(_item_disabled_rules.to_dict()) _dict["disabledRules"] = _items # override the default output from pydantic by calling `to_dict()` of each item in enabled_rules (list) _items = [] if self.enabled_rules: - for _item in self.enabled_rules: - if _item: - _items.append(_item.to_dict()) + for _item_enabled_rules in self.enabled_rules: + if _item_enabled_rules: + _items.append(_item_enabled_rules.to_dict()) _dict["enabledRules"] = _items # override the default output from pydantic by calling `to_dict()` of each item in log_only_rules (list) _items = [] if self.log_only_rules: - for _item in self.log_only_rules: - if _item: - _items.append(_item.to_dict()) + for _item_log_only_rules in self.log_only_rules: + if _item_log_only_rules: + _items.append(_item_log_only_rules.to_dict()) _dict["logOnlyRules"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/domain.py b/services/cdn/src/stackit/cdn/models/domain.py index f6aa71e6..3781aab5 100644 --- a/services/cdn/src/stackit/cdn/models/domain.py +++ b/services/cdn/src/stackit/cdn/models/domain.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -29,6 +29,7 @@ class Domain(BaseModel): Definition of a custom or managed domain without any certificates or keys """ # noqa: E501 + certificate_type: StrictStr = Field(alias="certificateType") errors: Optional[Annotated[List[StatusError], Field(min_length=1)]] = Field( default=None, description="This object is present if the custom domain has errors." ) @@ -39,7 +40,14 @@ class Domain(BaseModel): type: StrictStr = Field( description="Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint" ) - __properties: ClassVar[List[str]] = ["errors", "name", "status", "type"] + __properties: ClassVar[List[str]] = ["certificateType", "errors", "name", "status", "type"] + + @field_validator("certificate_type") + def certificate_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["managed", "custom"]): + raise ValueError("must be one of enum values ('managed', 'custom')") + return value @field_validator("type") def type_validate_enum(cls, value): @@ -88,9 +96,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in errors (list) _items = [] if self.errors: - for _item in self.errors: - if _item: - _items.append(_item.to_dict()) + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) _dict["errors"] = _items return _dict @@ -105,6 +113,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "certificateType": obj.get("certificateType"), "errors": ( [StatusError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None ), diff --git a/services/cdn/src/stackit/cdn/models/domain_status.py b/services/cdn/src/stackit/cdn/models/domain_status.py index bc40e1eb..6736c4b0 100644 --- a/services/cdn/src/stackit/cdn/models/domain_status.py +++ b/services/cdn/src/stackit/cdn/models/domain_status.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/error_details.py b/services/cdn/src/stackit/cdn/models/error_details.py index 1df5fbe1..6fbee6d5 100644 --- a/services/cdn/src/stackit/cdn/models/error_details.py +++ b/services/cdn/src/stackit/cdn/models/error_details.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py b/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py index e65e1ab9..d0f07a9d 100644 --- a/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py +++ b/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in response (list) _items = [] if self.response: - for _item in self.response: - if _item: - _items.append(_item.to_dict()) + for _item_response in self.response: + if _item_response: + _items.append(_item_response.to_dict()) _dict["response"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py b/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py index dd0fc415..77b52194 100644 --- a/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py +++ b/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/generic_json_response.py b/services/cdn/src/stackit/cdn/models/generic_json_response.py index 26553d1e..8d6ada35 100644 --- a/services/cdn/src/stackit/cdn/models/generic_json_response.py +++ b/services/cdn/src/stackit/cdn/models/generic_json_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -72,9 +72,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in details (list) _items = [] if self.details: - for _item in self.details: - if _item: - _items.append(_item.to_dict()) + for _item_details in self.details: + if _item_details: + _items.append(_item_details.to_dict()) _dict["details"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/get_cache_info_response.py b/services/cdn/src/stackit/cdn/models/get_cache_info_response.py index 154b9857..d0625f89 100644 --- a/services/cdn/src/stackit/cdn/models/get_cache_info_response.py +++ b/services/cdn/src/stackit/cdn/models/get_cache_info_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -92,9 +92,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in history (list) _items = [] if self.history: - for _item in self.history: - if _item: - _items.append(_item.to_dict()) + for _item_history in self.history: + if _item_history: + _items.append(_item_history.to_dict()) _dict["history"] = _items # set to None if last_purge_time (nullable) is None # and model_fields_set contains the field diff --git a/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py b/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py index 586ba62f..b4ed657e 100644 --- a/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py +++ b/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_custom_domain_custom_certificate.py b/services/cdn/src/stackit/cdn/models/get_custom_domain_custom_certificate.py index 78aaa022..d55a91b3 100644 --- a/services/cdn/src/stackit/cdn/models/get_custom_domain_custom_certificate.py +++ b/services/cdn/src/stackit/cdn/models/get_custom_domain_custom_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -17,7 +17,13 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) from typing_extensions import Annotated, Self @@ -26,11 +32,15 @@ class GetCustomDomainCustomCertificate(BaseModel): Returned if a custom certificate is used. Response does not contain the certificate or key. """ # noqa: E501 + skip_dns_check: StrictBool = Field( + description="Returns if the CNAME Check has been disabled for this Custom Domain. This is usually set for migrations to allow for no downtime.", + alias="skipDnsCheck", + ) type: StrictStr version: Annotated[int, Field(strict=True, ge=1)] = Field( description="Whenever a new custom certificate is added the version is increased by 1." ) - __properties: ClassVar[List[str]] = ["type", "version"] + __properties: ClassVar[List[str]] = ["skipDnsCheck", "type", "version"] model_config = ConfigDict( populate_by_name=True, @@ -80,5 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"type": obj.get("type"), "version": obj.get("version")}) + _obj = cls.model_validate( + { + "skipDnsCheck": obj.get("skipDnsCheck") if obj.get("skipDnsCheck") is not None else False, + "type": obj.get("type"), + "version": obj.get("version"), + } + ) return _obj diff --git a/services/cdn/src/stackit/cdn/models/get_custom_domain_managed_certificate.py b/services/cdn/src/stackit/cdn/models/get_custom_domain_managed_certificate.py index bb720756..55bc0f5b 100644 --- a/services/cdn/src/stackit/cdn/models/get_custom_domain_managed_certificate.py +++ b/services/cdn/src/stackit/cdn/models/get_custom_domain_managed_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py b/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py index b9b978bf..0a24ea22 100644 --- a/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py +++ b/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_custom_domain_response_certificate.py b/services/cdn/src/stackit/cdn/models/get_custom_domain_response_certificate.py index 9ad7fd39..fb95cae8 100644 --- a/services/cdn/src/stackit/cdn/models/get_custom_domain_response_certificate.py +++ b/services/cdn/src/stackit/cdn/models/get_custom_domain_response_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_distribution_response.py b/services/cdn/src/stackit/cdn/models/get_distribution_response.py index 34a26c21..dd7f8231 100644 --- a/services/cdn/src/stackit/cdn/models/get_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/get_distribution_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_logs_response.py b/services/cdn/src/stackit/cdn/models/get_logs_response.py index 6ccd9f7b..cb1e3433 100644 --- a/services/cdn/src/stackit/cdn/models/get_logs_response.py +++ b/services/cdn/src/stackit/cdn/models/get_logs_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -72,9 +72,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in logs (list) _items = [] if self.logs: - for _item in self.logs: - if _item: - _items.append(_item.to_dict()) + for _item_logs in self.logs: + if _item_logs: + _items.append(_item_logs.to_dict()) _dict["logs"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response.py b/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response.py index 14167909..12a4b1af 100644 --- a/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response.py +++ b/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block.py b/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block.py index 3682d23e..fb1a45cc 100644 --- a/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block.py +++ b/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -77,37 +77,37 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in af (list) _items = [] if self.af: - for _item in self.af: - if _item: - _items.append(_item.to_dict()) + for _item_af in self.af: + if _item_af: + _items.append(_item_af.to_dict()) _dict["AF"] = _items # override the default output from pydantic by calling `to_dict()` of each item in asia (list) _items = [] if self.asia: - for _item in self.asia: - if _item: - _items.append(_item.to_dict()) + for _item_asia in self.asia: + if _item_asia: + _items.append(_item_asia.to_dict()) _dict["ASIA"] = _items # override the default output from pydantic by calling `to_dict()` of each item in eu (list) _items = [] if self.eu: - for _item in self.eu: - if _item: - _items.append(_item.to_dict()) + for _item_eu in self.eu: + if _item_eu: + _items.append(_item_eu.to_dict()) _dict["EU"] = _items # override the default output from pydantic by calling `to_dict()` of each item in na (list) _items = [] if self.na: - for _item in self.na: - if _item: - _items.append(_item.to_dict()) + for _item_na in self.na: + if _item_na: + _items.append(_item_na.to_dict()) _dict["NA"] = _items # override the default output from pydantic by calling `to_dict()` of each item in sa (list) _items = [] if self.sa: - for _item in self.sa: - if _item: - _items.append(_item.to_dict()) + for _item_sa in self.sa: + if _item_sa: + _items.append(_item_sa.to_dict()) _dict["SA"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block_item.py b/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block_item.py index 296e6b33..db4f1589 100644 --- a/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block_item.py +++ b/services/cdn/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block_item.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/get_statistics_response.py b/services/cdn/src/stackit/cdn/models/get_statistics_response.py index 6df543b5..96eeb67f 100644 --- a/services/cdn/src/stackit/cdn/models/get_statistics_response.py +++ b/services/cdn/src/stackit/cdn/models/get_statistics_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in records (list) _items = [] if self.records: - for _item in self.records: - if _item: - _items.append(_item.to_dict()) + for _item_records in self.records: + if _item_records: + _items.append(_item_records.to_dict()) _dict["records"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/http_backend.py b/services/cdn/src/stackit/cdn/models/http_backend.py index 4b5825e0..a4710ab0 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend.py +++ b/services/cdn/src/stackit/cdn/models/http_backend.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/http_backend_create.py b/services/cdn/src/stackit/cdn/models/http_backend_create.py index dc54dd34..50e3db26 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend_create.py +++ b/services/cdn/src/stackit/cdn/models/http_backend_create.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/http_backend_patch.py b/services/cdn/src/stackit/cdn/models/http_backend_patch.py index f2bf560d..ed86d2ae 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend_patch.py +++ b/services/cdn/src/stackit/cdn/models/http_backend_patch.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/list_distributions_response.py b/services/cdn/src/stackit/cdn/models/list_distributions_response.py index 403d61e4..2817d38e 100644 --- a/services/cdn/src/stackit/cdn/models/list_distributions_response.py +++ b/services/cdn/src/stackit/cdn/models/list_distributions_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -72,9 +72,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in distributions (list) _items = [] if self.distributions: - for _item in self.distributions: - if _item: - _items.append(_item.to_dict()) + for _item_distributions in self.distributions: + if _item_distributions: + _items.append(_item_distributions.to_dict()) _dict["distributions"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/list_waf_collections_response.py b/services/cdn/src/stackit/cdn/models/list_waf_collections_response.py index fd268904..cf58448b 100644 --- a/services/cdn/src/stackit/cdn/models/list_waf_collections_response.py +++ b/services/cdn/src/stackit/cdn/models/list_waf_collections_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -71,9 +71,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in collections (list) _items = [] if self.collections: - for _item in self.collections: - if _item: - _items.append(_item.to_dict()) + for _item_collections in self.collections: + if _item_collections: + _items.append(_item_collections.to_dict()) _dict["collections"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/loki_log_sink.py b/services/cdn/src/stackit/cdn/models/loki_log_sink.py index bc2d62ec..0272985a 100644 --- a/services/cdn/src/stackit/cdn/models/loki_log_sink.py +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/loki_log_sink_create.py b/services/cdn/src/stackit/cdn/models/loki_log_sink_create.py index 4616ff48..b7e12d9a 100644 --- a/services/cdn/src/stackit/cdn/models/loki_log_sink_create.py +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink_create.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/loki_log_sink_credentials.py b/services/cdn/src/stackit/cdn/models/loki_log_sink_credentials.py index 49a7831f..5ab9b4df 100644 --- a/services/cdn/src/stackit/cdn/models/loki_log_sink_credentials.py +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink_credentials.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/loki_log_sink_patch.py b/services/cdn/src/stackit/cdn/models/loki_log_sink_patch.py index 451caf3d..0564fee4 100644 --- a/services/cdn/src/stackit/cdn/models/loki_log_sink_patch.py +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink_patch.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/match_condition.py b/services/cdn/src/stackit/cdn/models/match_condition.py index 4f2fec0b..e38a7e2e 100644 --- a/services/cdn/src/stackit/cdn/models/match_condition.py +++ b/services/cdn/src/stackit/cdn/models/match_condition.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/matcher.py b/services/cdn/src/stackit/cdn/models/matcher.py index 1e8fc82c..fd85b07f 100644 --- a/services/cdn/src/stackit/cdn/models/matcher.py +++ b/services/cdn/src/stackit/cdn/models/matcher.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/optimizer.py b/services/cdn/src/stackit/cdn/models/optimizer.py index 1cd17677..9401d7dd 100644 --- a/services/cdn/src/stackit/cdn/models/optimizer.py +++ b/services/cdn/src/stackit/cdn/models/optimizer.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/optimizer_patch.py b/services/cdn/src/stackit/cdn/models/optimizer_patch.py index 341c0b80..7539123d 100644 --- a/services/cdn/src/stackit/cdn/models/optimizer_patch.py +++ b/services/cdn/src/stackit/cdn/models/optimizer_patch.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py b/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py index e6eae85a..769a256d 100644 --- a/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/patch_distribution_response.py b/services/cdn/src/stackit/cdn/models/patch_distribution_response.py index b30f8376..23f78d27 100644 --- a/services/cdn/src/stackit/cdn/models/patch_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/patch_distribution_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/purge_cache_payload.py b/services/cdn/src/stackit/cdn/models/purge_cache_payload.py index b8d1adae..1ca6c5cb 100644 --- a/services/cdn/src/stackit/cdn/models/purge_cache_payload.py +++ b/services/cdn/src/stackit/cdn/models/purge_cache_payload.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_custom_certificate.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_custom_certificate.py index 52370e01..b4d4737c 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_custom_certificate.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_custom_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -17,7 +17,13 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) from typing_extensions import Self @@ -28,8 +34,13 @@ class PutCustomDomainCustomCertificate(BaseModel): certificate: StrictStr = Field(description="base64-encoded PEM-encoded certificate") key: StrictStr = Field(description="base64-encoded PEM encoded key") + skip_dns_check: Optional[StrictBool] = Field( + default=None, + description="When adding a new custom domain, we do a check to verify that your Domain points to the managed domain via a CNAME or ALIAS. If this is not the case, the call would usually reject. This additional property is an escape hatch to this functionality. It's useful for when you are migrating onto STACKIT CDN. It allows you to migrate without downtime. By providing a custom certificate with `skipDnsCheck` set to `true`, we will not check the Record for correctness. Then, once the CDN is set up, you can change the CNAME Record on your DNS and update the Custom Domain entry to disable this check, or switch to a managed certificate. This field is optional. If not set, the check is **not** skipped. ", + alias="skipDnsCheck", + ) type: StrictStr - __properties: ClassVar[List[str]] = ["certificate", "key", "type"] + __properties: ClassVar[List[str]] = ["certificate", "key", "skipDnsCheck", "type"] model_config = ConfigDict( populate_by_name=True, @@ -80,6 +91,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"certificate": obj.get("certificate"), "key": obj.get("key"), "type": obj.get("type")} + { + "certificate": obj.get("certificate"), + "key": obj.get("key"), + "skipDnsCheck": obj.get("skipDnsCheck"), + "type": obj.get("type"), + } ) return _obj diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_managed_certificate.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_managed_certificate.py index 5f77b8ba..37418e38 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_managed_certificate.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_managed_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py index 991c4ff3..5ebfce3e 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_payload_certificate.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_payload_certificate.py index d0493f4e..84a77009 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_payload_certificate.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_payload_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py index c095a168..255a229f 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_response_certificate.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_response_certificate.py index 4b9cfcf6..0ce1d3c3 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_response_certificate.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_response_certificate.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/redirect_config.py b/services/cdn/src/stackit/cdn/models/redirect_config.py index 8f529803..c07a18a0 100644 --- a/services/cdn/src/stackit/cdn/models/redirect_config.py +++ b/services/cdn/src/stackit/cdn/models/redirect_config.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rules (list) _items = [] if self.rules: - for _item in self.rules: - if _item: - _items.append(_item.to_dict()) + for _item_rules in self.rules: + if _item_rules: + _items.append(_item_rules.to_dict()) _dict["rules"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/redirect_rule.py b/services/cdn/src/stackit/cdn/models/redirect_rule.py index 5e79b090..de7bce82 100644 --- a/services/cdn/src/stackit/cdn/models/redirect_rule.py +++ b/services/cdn/src/stackit/cdn/models/redirect_rule.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -103,9 +103,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in matchers (list) _items = [] if self.matchers: - for _item in self.matchers: - if _item: - _items.append(_item.to_dict()) + for _item_matchers in self.matchers: + if _item_matchers: + _items.append(_item_matchers.to_dict()) _dict["matchers"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/region.py b/services/cdn/src/stackit/cdn/models/region.py index 005f7f1a..58d14eb4 100644 --- a/services/cdn/src/stackit/cdn/models/region.py +++ b/services/cdn/src/stackit/cdn/models/region.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/status_error.py b/services/cdn/src/stackit/cdn/models/status_error.py index dd236efe..351aa9bc 100644 --- a/services/cdn/src/stackit/cdn/models/status_error.py +++ b/services/cdn/src/stackit/cdn/models/status_error.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_config.py b/services/cdn/src/stackit/cdn/models/waf_config.py index 4f16e184..99f5d6fb 100644 --- a/services/cdn/src/stackit/cdn/models/waf_config.py +++ b/services/cdn/src/stackit/cdn/models/waf_config.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_config_patch.py b/services/cdn/src/stackit/cdn/models/waf_config_patch.py index 41a93c55..d3d3ded8 100644 --- a/services/cdn/src/stackit/cdn/models/waf_config_patch.py +++ b/services/cdn/src/stackit/cdn/models/waf_config_patch.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_mode.py b/services/cdn/src/stackit/cdn/models/waf_mode.py index db41c4dc..66a40d35 100644 --- a/services/cdn/src/stackit/cdn/models/waf_mode.py +++ b/services/cdn/src/stackit/cdn/models/waf_mode.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_paranoia_level.py b/services/cdn/src/stackit/cdn/models/waf_paranoia_level.py index 6089be29..4189790d 100644 --- a/services/cdn/src/stackit/cdn/models/waf_paranoia_level.py +++ b/services/cdn/src/stackit/cdn/models/waf_paranoia_level.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_rule.py b/services/cdn/src/stackit/cdn/models/waf_rule.py index 1ccbc9ef..287076c5 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_rule_action.py b/services/cdn/src/stackit/cdn/models/waf_rule_action.py index 29fe8071..db6d1b6d 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule_action.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule_action.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_rule_collection.py b/services/cdn/src/stackit/cdn/models/waf_rule_collection.py index e32f8d9f..45a3eba9 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule_collection.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule_collection.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in groups (list) _items = [] if self.groups: - for _item in self.groups: - if _item: - _items.append(_item.to_dict()) + for _item_groups in self.groups: + if _item_groups: + _items.append(_item_groups.to_dict()) _dict["groups"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/waf_rule_group.py b/services/cdn/src/stackit/cdn/models/waf_rule_group.py index 42ffdb07..4d583e3a 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule_group.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule_group.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rules (list) _items = [] if self.rules: - for _item in self.rules: - if _item: - _items.append(_item.to_dict()) + for _item_rules in self.rules: + if _item_rules: + _items.append(_item_rules.to_dict()) _dict["rules"] = _items return _dict diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block.py index 73be1c51..52b1472a 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason.py index 4e8826cc..6fceeb06 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_directly_defined.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_directly_defined.py index f73921e8..b37b3c9e 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_directly_defined.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_directly_defined.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_collection.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_collection.py index dc60ae23..aa90e7cc 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_collection.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_collection.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_group.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_group.py index e5dff23c..2bc780bb 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_group.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_group.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_invalid_waf_type.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_invalid_waf_type.py index 3bb39c4f..0e460d33 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_invalid_waf_type.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_invalid_waf_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_never_defined.py b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_never_defined.py index 2c350fd7..61ea55dd 100644 --- a/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_never_defined.py +++ b/services/cdn/src/stackit/cdn/models/waf_status_rule_block_reason_never_defined.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_type.py b/services/cdn/src/stackit/cdn/models/waf_type.py index 17390858..62ac06df 100644 --- a/services/cdn/src/stackit/cdn/models/waf_type.py +++ b/services/cdn/src/stackit/cdn/models/waf_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/models/waf_violation.py b/services/cdn/src/stackit/cdn/models/waf_violation.py index a618301b..443a3e7e 100644 --- a/services/cdn/src/stackit/cdn/models/waf_violation.py +++ b/services/cdn/src/stackit/cdn/models/waf_violation.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. diff --git a/services/cdn/src/stackit/cdn/rest.py b/services/cdn/src/stackit/cdn/rest.py index 9ebfe567..b17e4afa 100644 --- a/services/cdn/src/stackit/cdn/rest.py +++ b/services/cdn/src/stackit/cdn/rest.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - CDN API + STACKIT CDN API API used to create and manage your CDN distributions. @@ -38,12 +38,17 @@ def read(self): self.data = self.response.content return self.data + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers + def getheaders(self): - """Returns a dictionary of the response headers.""" + """Returns a dictionary of the response headers; use ``headers`` instead.""" return self.response.headers def getheader(self, name, default=None): - """Returns a given response header.""" + """Returns a given response header; use ``headers.get()`` instead.""" return self.response.headers.get(name, default) @@ -93,6 +98,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque url, data=request_body, headers=headers, + timeout=_request_timeout, ) elif content_type == "application/x-www-form-urlencoded": r = self.session.request( @@ -100,6 +106,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque url, params=post_params, headers=headers, + timeout=_request_timeout, ) elif content_type == "multipart/form-data": # must del headers['Content-Type'], or the correct @@ -113,6 +120,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque url, files=post_params, headers=headers, + timeout=_request_timeout, ) # Pass a `string` parameter directly in the body to support # other content types than JSON when `body` argument is @@ -123,10 +131,17 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque url, data=body, headers=headers, + timeout=_request_timeout, ) elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" - r = self.session.request(method, url, data=request_body, headers=headers) + r = self.session.request( + method, + url, + data=request_body, + headers=headers, + timeout=_request_timeout, + ) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -140,6 +155,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque url, params={}, headers=headers, + timeout=_request_timeout, ) except requests.exceptions.SSLError as e: msg = "\n".join([type(e).__name__, str(e)])