diff --git a/services/cdn/src/stackit/cdn/__init__.py b/services/cdn/src/stackit/cdn/__init__.py index 6478c702..da7cae9f 100644 --- a/services/cdn/src/stackit/cdn/__init__.py +++ b/services/cdn/src/stackit/cdn/__init__.py @@ -7,7 +7,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -28,9 +28,16 @@ "ApiKeyError", "ApiAttributeError", "ApiException", + "BucketBackend", + "BucketBackendCreate", + "BucketBackendPatch", + "BucketCredentials", "Config", + "ConfigBackend", "ConfigPatch", + "ConfigPatchBackend", "CreateDistributionPayload", + "CreateDistributionPayloadBackend", "CreateDistributionResponse", "CustomDomain", "DeleteCustomDomainResponse", @@ -46,7 +53,7 @@ "ErrorDetails", "FindCachePathsResponse", "FindCachePathsResponseEntry", - "GenericJSONResponse", + "GenericJsonResponse", "GetCacheInfoResponse", "GetCacheInfoResponseHistoryEntry", "GetCustomDomainCustomCertificate", @@ -55,18 +62,20 @@ "GetCustomDomainResponseCertificate", "GetDistributionResponse", "GetLogsResponse", - "GetLogsSearchFiltersResponse", "GetStatisticsResponse", "HttpBackend", + "HttpBackendCreate", "HttpBackendPatch", "ListDistributionsResponse", - "ListWAFCollectionsResponse", + "ListWafCollectionsResponse", "LokiLogSink", + "LokiLogSinkCreate", + "LokiLogSinkCredentials", + "LokiLogSinkPatch", "Optimizer", "OptimizerPatch", "PatchDistributionPayload", "PatchDistributionResponse", - "PatchLokiLogSink", "PurgeCachePayload", "PutCustomDomainCustomCertificate", "PutCustomDomainManagedCertificate", @@ -76,13 +85,13 @@ "PutCustomDomainResponseCertificate", "Region", "StatusError", - "WAFRule", - "WAFRuleCollection", - "WAFRuleGroup", - "WAFStatusRuleBlock", "WafConfig", "WafConfigPatch", "WafMode", + "WafRule", + "WafRuleCollection", + "WafRuleGroup", + "WafStatusRuleBlock", "WafType", ] @@ -101,11 +110,26 @@ from stackit.cdn.exceptions import OpenApiException as OpenApiException # import models into sdk package +from stackit.cdn.models.bucket_backend import BucketBackend as BucketBackend +from stackit.cdn.models.bucket_backend_create import ( + BucketBackendCreate as BucketBackendCreate, +) +from stackit.cdn.models.bucket_backend_patch import ( + BucketBackendPatch as BucketBackendPatch, +) +from stackit.cdn.models.bucket_credentials import BucketCredentials as BucketCredentials from stackit.cdn.models.config import Config as Config +from stackit.cdn.models.config_backend import ConfigBackend as ConfigBackend from stackit.cdn.models.config_patch import ConfigPatch as ConfigPatch +from stackit.cdn.models.config_patch_backend import ( + ConfigPatchBackend as ConfigPatchBackend, +) from stackit.cdn.models.create_distribution_payload import ( CreateDistributionPayload as CreateDistributionPayload, ) +from stackit.cdn.models.create_distribution_payload_backend import ( + CreateDistributionPayloadBackend as CreateDistributionPayloadBackend, +) from stackit.cdn.models.create_distribution_response import ( CreateDistributionResponse as CreateDistributionResponse, ) @@ -140,7 +164,7 @@ FindCachePathsResponseEntry as FindCachePathsResponseEntry, ) from stackit.cdn.models.generic_json_response import ( - GenericJSONResponse as GenericJSONResponse, + GenericJsonResponse as GenericJsonResponse, ) from stackit.cdn.models.get_cache_info_response import ( GetCacheInfoResponse as GetCacheInfoResponse, @@ -164,21 +188,28 @@ GetDistributionResponse as GetDistributionResponse, ) from stackit.cdn.models.get_logs_response import GetLogsResponse as GetLogsResponse -from stackit.cdn.models.get_logs_search_filters_response import ( - GetLogsSearchFiltersResponse as GetLogsSearchFiltersResponse, -) from stackit.cdn.models.get_statistics_response import ( GetStatisticsResponse as GetStatisticsResponse, ) from stackit.cdn.models.http_backend import HttpBackend as HttpBackend +from stackit.cdn.models.http_backend_create import ( + HttpBackendCreate as HttpBackendCreate, +) from stackit.cdn.models.http_backend_patch import HttpBackendPatch as HttpBackendPatch from stackit.cdn.models.list_distributions_response import ( ListDistributionsResponse as ListDistributionsResponse, ) from stackit.cdn.models.list_waf_collections_response import ( - ListWAFCollectionsResponse as ListWAFCollectionsResponse, + ListWafCollectionsResponse as ListWafCollectionsResponse, ) from stackit.cdn.models.loki_log_sink import LokiLogSink as LokiLogSink +from stackit.cdn.models.loki_log_sink_create import ( + LokiLogSinkCreate as LokiLogSinkCreate, +) +from stackit.cdn.models.loki_log_sink_credentials import ( + LokiLogSinkCredentials as LokiLogSinkCredentials, +) +from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch as LokiLogSinkPatch 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 ( @@ -187,7 +218,6 @@ 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, ) @@ -214,12 +244,12 @@ from stackit.cdn.models.waf_config import WafConfig as WafConfig from stackit.cdn.models.waf_config_patch import WafConfigPatch as WafConfigPatch from stackit.cdn.models.waf_mode import WafMode as WafMode -from stackit.cdn.models.waf_rule import WAFRule as WAFRule +from stackit.cdn.models.waf_rule import WafRule as WafRule from stackit.cdn.models.waf_rule_collection import ( - WAFRuleCollection as WAFRuleCollection, + WafRuleCollection as WafRuleCollection, ) -from stackit.cdn.models.waf_rule_group import WAFRuleGroup as WAFRuleGroup +from stackit.cdn.models.waf_rule_group import WafRuleGroup as WafRuleGroup from stackit.cdn.models.waf_status_rule_block import ( - WAFStatusRuleBlock as WAFStatusRuleBlock, + WafStatusRuleBlock as WafStatusRuleBlock, ) from stackit.cdn.models.waf_type import WafType as WafType diff --git a/services/cdn/src/stackit/cdn/api/default_api.py b/services/cdn/src/stackit/cdn/api/default_api.py index 5e31fce6..f7bca6e5 100644 --- a/services/cdn/src/stackit/cdn/api/default_api.py +++ b/services/cdn/src/stackit/cdn/api/default_api.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -36,12 +36,9 @@ from stackit.cdn.models.get_custom_domain_response import GetCustomDomainResponse from stackit.cdn.models.get_distribution_response import GetDistributionResponse from stackit.cdn.models.get_logs_response import GetLogsResponse -from stackit.cdn.models.get_logs_search_filters_response import ( - GetLogsSearchFiltersResponse, -) from stackit.cdn.models.get_statistics_response import GetStatisticsResponse from stackit.cdn.models.list_distributions_response import ListDistributionsResponse -from stackit.cdn.models.list_waf_collections_response import ListWAFCollectionsResponse +from stackit.cdn.models.list_waf_collections_response import ListWafCollectionsResponse from stackit.cdn.models.patch_distribution_payload import PatchDistributionPayload from stackit.cdn.models.patch_distribution_response import PatchDistributionResponse from stackit.cdn.models.purge_cache_payload import PurgeCachePayload @@ -66,7 +63,7 @@ def __init__(self, configuration: Configuration = None) -> None: @validate_call def create_distribution( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], create_distribution_payload: CreateDistributionPayload, _request_timeout: Union[ None, @@ -82,7 +79,7 @@ def create_distribution( CreateDistribution will create a new CDN distribution - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param create_distribution_payload: (required) :type create_distribution_payload: CreateDistributionPayload @@ -119,10 +116,10 @@ def create_distribution( _response_types_map: Dict[str, Optional[str]] = { "200": "CreateDistributionResponse", - "400": "GenericJSONResponse", + "400": "GenericJsonResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -134,7 +131,7 @@ def create_distribution( @validate_call def create_distribution_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], create_distribution_payload: CreateDistributionPayload, _request_timeout: Union[ None, @@ -150,7 +147,7 @@ def create_distribution_with_http_info( CreateDistribution will create a new CDN distribution - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param create_distribution_payload: (required) :type create_distribution_payload: CreateDistributionPayload @@ -187,10 +184,10 @@ def create_distribution_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "CreateDistributionResponse", - "400": "GenericJSONResponse", + "400": "GenericJsonResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -202,7 +199,7 @@ def create_distribution_with_http_info( @validate_call def create_distribution_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], create_distribution_payload: CreateDistributionPayload, _request_timeout: Union[ None, @@ -218,7 +215,7 @@ def create_distribution_without_preload_content( CreateDistribution will create a new CDN distribution - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param create_distribution_payload: (required) :type create_distribution_payload: CreateDistributionPayload @@ -255,10 +252,10 @@ def create_distribution_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "CreateDistributionResponse", - "400": "GenericJSONResponse", + "400": "GenericJsonResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -311,7 +308,7 @@ def _create_distribution_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta/projects/{projectId}/distributions", + resource_path="/v1beta2/projects/{projectId}/distributions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -327,7 +324,7 @@ def _create_distribution_serialize( @validate_call def delete_custom_domain( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], intent_id: Optional[StrictStr] = None, @@ -345,7 +342,7 @@ def delete_custom_domain( Removes a custom domain - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -389,8 +386,8 @@ def delete_custom_domain( _response_types_map: Dict[str, Optional[str]] = { "200": "DeleteCustomDomainResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -402,7 +399,7 @@ def delete_custom_domain( @validate_call def delete_custom_domain_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], intent_id: Optional[StrictStr] = None, @@ -420,7 +417,7 @@ def delete_custom_domain_with_http_info( Removes a custom domain - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -464,8 +461,8 @@ def delete_custom_domain_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "DeleteCustomDomainResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -477,7 +474,7 @@ def delete_custom_domain_with_http_info( @validate_call def delete_custom_domain_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], intent_id: Optional[StrictStr] = None, @@ -495,7 +492,7 @@ def delete_custom_domain_without_preload_content( Removes a custom domain - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -539,8 +536,8 @@ def delete_custom_domain_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "DeleteCustomDomainResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -593,7 +590,7 @@ def _delete_custom_domain_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -609,7 +606,7 @@ def _delete_custom_domain_serialize( @validate_call def delete_distribution( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, intent_id: Annotated[ Optional[StrictStr], @@ -629,9 +626,9 @@ def delete_distribution( ) -> DeleteDistributionResponse: """Delete distribution - DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. + DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -672,8 +669,8 @@ def delete_distribution( _response_types_map: Dict[str, Optional[str]] = { "200": "DeleteDistributionResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -685,7 +682,7 @@ def delete_distribution( @validate_call def delete_distribution_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, intent_id: Annotated[ Optional[StrictStr], @@ -705,9 +702,9 @@ def delete_distribution_with_http_info( ) -> ApiResponse[DeleteDistributionResponse]: """Delete distribution - DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. + DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -748,8 +745,8 @@ def delete_distribution_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "DeleteDistributionResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -761,7 +758,7 @@ def delete_distribution_with_http_info( @validate_call def delete_distribution_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, intent_id: Annotated[ Optional[StrictStr], @@ -781,9 +778,9 @@ def delete_distribution_without_preload_content( ) -> RESTResponseType: """Delete distribution - DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. + DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -824,8 +821,8 @@ def delete_distribution_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "DeleteDistributionResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -875,7 +872,7 @@ def _delete_distribution_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -891,7 +888,7 @@ def _delete_distribution_serialize( @validate_call def find_cache_paths( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, path: Annotated[StrictStr, Field(description="A substring of the search query. ")], _request_timeout: Union[ @@ -908,7 +905,7 @@ def find_cache_paths( This returns paths that are present in the cache purging history. Only substrings of the provided input are returned. The response is sorted in descending order by the most recent purge. So, assuming you have have the following purged for a distribution - `/test/1` at `2025-01-01` - `/test/2` at `2025-01-02` - `/someOtherPath/1` at `2025-01-03` - `/test/1` at `2025-01-04` - `/test/3` at `2025-01-05`, this would return the following paths, in the following order, assuming `/te` was the search parameter: - `/test/3` - `/test/1` - `/test/2` - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -949,8 +946,8 @@ def find_cache_paths( _response_types_map: Dict[str, Optional[str]] = { "200": "FindCachePathsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -962,7 +959,7 @@ def find_cache_paths( @validate_call def find_cache_paths_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, path: Annotated[StrictStr, Field(description="A substring of the search query. ")], _request_timeout: Union[ @@ -979,7 +976,7 @@ def find_cache_paths_with_http_info( This returns paths that are present in the cache purging history. Only substrings of the provided input are returned. The response is sorted in descending order by the most recent purge. So, assuming you have have the following purged for a distribution - `/test/1` at `2025-01-01` - `/test/2` at `2025-01-02` - `/someOtherPath/1` at `2025-01-03` - `/test/1` at `2025-01-04` - `/test/3` at `2025-01-05`, this would return the following paths, in the following order, assuming `/te` was the search parameter: - `/test/3` - `/test/1` - `/test/2` - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1020,8 +1017,8 @@ def find_cache_paths_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "FindCachePathsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1033,7 +1030,7 @@ def find_cache_paths_with_http_info( @validate_call def find_cache_paths_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, path: Annotated[StrictStr, Field(description="A substring of the search query. ")], _request_timeout: Union[ @@ -1050,7 +1047,7 @@ def find_cache_paths_without_preload_content( This returns paths that are present in the cache purging history. Only substrings of the provided input are returned. The response is sorted in descending order by the most recent purge. So, assuming you have have the following purged for a distribution - `/test/1` at `2025-01-01` - `/test/2` at `2025-01-02` - `/someOtherPath/1` at `2025-01-03` - `/test/1` at `2025-01-04` - `/test/3` at `2025-01-05`, this would return the following paths, in the following order, assuming `/te` was the search parameter: - `/test/3` - `/test/1` - `/test/2` - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1091,8 +1088,8 @@ def find_cache_paths_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "FindCachePathsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1142,7 +1139,7 @@ def _find_cache_paths_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/cache/paths", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/paths", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1158,7 +1155,7 @@ def _find_cache_paths_serialize( @validate_call def get_cache_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, purge_path: Optional[StrictStr] = None, _request_timeout: Union[ @@ -1175,7 +1172,7 @@ def get_cache_info( Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. If (and only if) you provide the path query parameter, the history will also contain granular cache purges. The request will not fail if no data about a path is found. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1216,8 +1213,8 @@ def get_cache_info( _response_types_map: Dict[str, Optional[str]] = { "200": "GetCacheInfoResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1229,7 +1226,7 @@ def get_cache_info( @validate_call def get_cache_info_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, purge_path: Optional[StrictStr] = None, _request_timeout: Union[ @@ -1246,7 +1243,7 @@ def get_cache_info_with_http_info( Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. If (and only if) you provide the path query parameter, the history will also contain granular cache purges. The request will not fail if no data about a path is found. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1287,8 +1284,8 @@ def get_cache_info_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "GetCacheInfoResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1300,7 +1297,7 @@ def get_cache_info_with_http_info( @validate_call def get_cache_info_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, purge_path: Optional[StrictStr] = None, _request_timeout: Union[ @@ -1317,7 +1314,7 @@ def get_cache_info_without_preload_content( Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. If (and only if) you provide the path query parameter, the history will also contain granular cache purges. The request will not fail if no data about a path is found. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1358,8 +1355,8 @@ def get_cache_info_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "GetCacheInfoResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1409,7 +1406,7 @@ def _get_cache_info_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/cache", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/cache", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1425,7 +1422,7 @@ def _get_cache_info_serialize( @validate_call def get_custom_domain( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], _request_timeout: Union[ @@ -1442,7 +1439,7 @@ def get_custom_domain( Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1483,9 +1480,9 @@ def get_custom_domain( _response_types_map: Dict[str, Optional[str]] = { "200": "GetCustomDomainResponse", "401": "str", - "404": "GenericJSONResponse", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "404": "GenericJsonResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1497,7 +1494,7 @@ def get_custom_domain( @validate_call def get_custom_domain_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], _request_timeout: Union[ @@ -1514,7 +1511,7 @@ def get_custom_domain_with_http_info( Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1555,9 +1552,9 @@ def get_custom_domain_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "GetCustomDomainResponse", "401": "str", - "404": "GenericJSONResponse", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "404": "GenericJsonResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1569,7 +1566,7 @@ def get_custom_domain_with_http_info( @validate_call def get_custom_domain_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], _request_timeout: Union[ @@ -1586,7 +1583,7 @@ def get_custom_domain_without_preload_content( Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1627,9 +1624,9 @@ def get_custom_domain_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "GetCustomDomainResponse", "401": "str", - "404": "GenericJSONResponse", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "404": "GenericJsonResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1677,7 +1674,7 @@ def _get_custom_domain_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1693,7 +1690,7 @@ def _get_custom_domain_serialize( @validate_call def get_distribution( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, with_waf_status: Annotated[ Optional[StrictBool], @@ -1711,11 +1708,11 @@ def get_distribution( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> GetDistributionResponse: - """Get distribution by ID + """Get distribution by Id - This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1756,9 +1753,9 @@ def get_distribution( _response_types_map: Dict[str, Optional[str]] = { "200": "GetDistributionResponse", "401": "str", - "404": "GenericJSONResponse", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "404": "GenericJsonResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1770,7 +1767,7 @@ def get_distribution( @validate_call def get_distribution_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, with_waf_status: Annotated[ Optional[StrictBool], @@ -1788,11 +1785,11 @@ def get_distribution_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[GetDistributionResponse]: - """Get distribution by ID + """Get distribution by Id - This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1833,9 +1830,9 @@ def get_distribution_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "GetDistributionResponse", "401": "str", - "404": "GenericJSONResponse", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "404": "GenericJsonResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1847,7 +1844,7 @@ def get_distribution_with_http_info( @validate_call def get_distribution_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, with_waf_status: Annotated[ Optional[StrictBool], @@ -1865,11 +1862,11 @@ def get_distribution_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get distribution by ID + """Get distribution by Id - This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -1910,9 +1907,9 @@ def get_distribution_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "GetDistributionResponse", "401": "str", - "404": "GenericJSONResponse", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "404": "GenericJsonResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1962,7 +1959,7 @@ def _get_distribution_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1978,8 +1975,8 @@ def _get_distribution_serialize( @validate_call def get_logs( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], - distribution_id: Annotated[StrictStr, Field(description="Your CDN distribution ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], + distribution_id: Annotated[StrictStr, 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, @@ -2045,9 +2042,9 @@ def get_logs( """Retrieve distribution logs - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str - :param distribution_id: Your CDN distribution ID (required) + :param distribution_id: Your CDN distribution Id (required) :type distribution_id: str :param var_from: the start of the time range for which logs should be returned :type var_from: datetime @@ -2113,8 +2110,8 @@ def get_logs( _response_types_map: Dict[str, Optional[str]] = { "200": "GetLogsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2126,8 +2123,8 @@ def get_logs( @validate_call 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")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], + distribution_id: Annotated[StrictStr, 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, @@ -2193,9 +2190,9 @@ def get_logs_with_http_info( """Retrieve distribution logs - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str - :param distribution_id: Your CDN distribution ID (required) + :param distribution_id: Your CDN distribution Id (required) :type distribution_id: str :param var_from: the start of the time range for which logs should be returned :type var_from: datetime @@ -2261,8 +2258,8 @@ def get_logs_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "GetLogsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2274,8 +2271,8 @@ def get_logs_with_http_info( @validate_call 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")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], + distribution_id: Annotated[StrictStr, 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, @@ -2341,9 +2338,9 @@ def get_logs_without_preload_content( """Retrieve distribution logs - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str - :param distribution_id: Your CDN distribution ID (required) + :param distribution_id: Your CDN distribution Id (required) :type distribution_id: str :param var_from: the start of the time range for which logs should be returned :type var_from: datetime @@ -2409,8 +2406,8 @@ def get_logs_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "GetLogsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -2509,289 +2506,7 @@ def _get_logs_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/logs", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - 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")], - filter: Annotated[ - StrictStr, - Field( - description="Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetLogsSearchFiltersResponse: - """Get relevant search filters for this distribution based on user input - - - :param project_id: Your STACKIT Project ID (required) - :type project_id: str - :param distribution_id: Your CDN distribution ID (required) - :type distribution_id: str - :param filter: Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty. (required) - :type filter: str - :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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_logs_search_filters_serialize( - project_id=project_id, - distribution_id=distribution_id, - filter=filter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetLogsSearchFiltersResponse", - "400": "GenericJSONResponse", - "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - 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")], - filter: Annotated[ - StrictStr, - Field( - description="Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetLogsSearchFiltersResponse]: - """Get relevant search filters for this distribution based on user input - - - :param project_id: Your STACKIT Project ID (required) - :type project_id: str - :param distribution_id: Your CDN distribution ID (required) - :type distribution_id: str - :param filter: Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty. (required) - :type filter: str - :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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_logs_search_filters_serialize( - project_id=project_id, - distribution_id=distribution_id, - filter=filter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetLogsSearchFiltersResponse", - "400": "GenericJSONResponse", - "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - 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")], - filter: Annotated[ - StrictStr, - Field( - description="Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty." - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get relevant search filters for this distribution based on user input - - - :param project_id: Your STACKIT Project ID (required) - :type project_id: str - :param distribution_id: Your CDN distribution ID (required) - :type distribution_id: str - :param filter: Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty. (required) - :type filter: str - :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 - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_logs_search_filters_serialize( - project_id=project_id, - distribution_id=distribution_id, - filter=filter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetLogsSearchFiltersResponse", - "400": "GenericJSONResponse", - "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _get_logs_search_filters_serialize( - self, - project_id, - distribution_id, - filter, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id - if distribution_id is not None: - _path_params["distributionId"] = distribution_id - # process the query parameters - if filter is not None: - - _query_params.append(("filter", filter)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/logs/searchFilters", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/logs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2807,7 +2522,7 @@ def _get_logs_search_filters_serialize( @validate_call def get_statistics( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, var_from: Annotated[ datetime, Field(description="the start of the time range for which statistics should be returned") @@ -2838,7 +2553,7 @@ def get_statistics( Returns the statistics of the distribution in the given time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. In case no statistics for a time interval exist, no record is returned. The time range for which statistics should be returned can be configured using query parameters. Timestamps are assumed to be UTC. This is especially important for the \"buckets\" when you, for example, return daily information. A day always starts and ends at 00:00Z. **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -2885,8 +2600,8 @@ def get_statistics( _response_types_map: Dict[str, Optional[str]] = { "200": "GetStatisticsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2898,7 +2613,7 @@ def get_statistics( @validate_call def get_statistics_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, var_from: Annotated[ datetime, Field(description="the start of the time range for which statistics should be returned") @@ -2929,7 +2644,7 @@ def get_statistics_with_http_info( Returns the statistics of the distribution in the given time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. In case no statistics for a time interval exist, no record is returned. The time range for which statistics should be returned can be configured using query parameters. Timestamps are assumed to be UTC. This is especially important for the \"buckets\" when you, for example, return daily information. A day always starts and ends at 00:00Z. **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -2976,8 +2691,8 @@ def get_statistics_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "GetStatisticsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2989,7 +2704,7 @@ def get_statistics_with_http_info( @validate_call def get_statistics_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, var_from: Annotated[ datetime, Field(description="the start of the time range for which statistics should be returned") @@ -3020,7 +2735,7 @@ def get_statistics_without_preload_content( Returns the statistics of the distribution in the given time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. In case no statistics for a time interval exist, no record is returned. The time range for which statistics should be returned can be configured using query parameters. Timestamps are assumed to be UTC. This is especially important for the \"buckets\" when you, for example, return daily information. A day always starts and ends at 00:00Z. **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -3067,8 +2782,8 @@ def get_statistics_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "GetStatisticsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -3132,7 +2847,7 @@ def _get_statistics_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/statistics", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/statistics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3148,7 +2863,7 @@ def _get_statistics_serialize( @validate_call def list_distributions( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], page_size: Annotated[ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field( @@ -3170,7 +2885,7 @@ def list_distributions( sort_by: Annotated[ Optional[StrictStr], Field( - description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. " + description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. " ), ] = None, sort_order: Optional[StrictStr] = None, @@ -3186,9 +2901,9 @@ def list_distributions( ) -> ListDistributionsResponse: """List all distributions belonging to a specific project - ListDistributions returns a list of all CDN distributions associated with a given project, ordered by their distribution ID. + ListDistributions returns a list of all CDN distributions associated with a given project, ordered by their distribution Id. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param page_size: Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) :type page_size: int @@ -3196,7 +2911,7 @@ def list_distributions( :type with_waf_status: bool :param page_identifier: Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. :type page_identifier: str - :param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. + :param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. :type sort_by: str :param sort_order: :type sort_order: str @@ -3238,8 +2953,8 @@ def list_distributions( _response_types_map: Dict[str, Optional[str]] = { "200": "ListDistributionsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3251,7 +2966,7 @@ def list_distributions( @validate_call def list_distributions_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], page_size: Annotated[ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field( @@ -3273,7 +2988,7 @@ def list_distributions_with_http_info( sort_by: Annotated[ Optional[StrictStr], Field( - description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. " + description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. " ), ] = None, sort_order: Optional[StrictStr] = None, @@ -3289,9 +3004,9 @@ def list_distributions_with_http_info( ) -> ApiResponse[ListDistributionsResponse]: """List all distributions belonging to a specific project - ListDistributions returns a list of all CDN distributions associated with a given project, ordered by their distribution ID. + ListDistributions returns a list of all CDN distributions associated with a given project, ordered by their distribution Id. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param page_size: Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) :type page_size: int @@ -3299,7 +3014,7 @@ def list_distributions_with_http_info( :type with_waf_status: bool :param page_identifier: Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. :type page_identifier: str - :param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. + :param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. :type sort_by: str :param sort_order: :type sort_order: str @@ -3341,8 +3056,8 @@ def list_distributions_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "ListDistributionsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3354,7 +3069,7 @@ def list_distributions_with_http_info( @validate_call def list_distributions_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], page_size: Annotated[ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field( @@ -3376,7 +3091,7 @@ def list_distributions_without_preload_content( sort_by: Annotated[ Optional[StrictStr], Field( - description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. " + description="The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. " ), ] = None, sort_order: Optional[StrictStr] = None, @@ -3392,9 +3107,9 @@ def list_distributions_without_preload_content( ) -> RESTResponseType: """List all distributions belonging to a specific project - ListDistributions returns a list of all CDN distributions associated with a given project, ordered by their distribution ID. + ListDistributions returns a list of all CDN distributions associated with a given project, ordered by their distribution Id. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param page_size: Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) :type page_size: int @@ -3402,7 +3117,7 @@ def list_distributions_without_preload_content( :type with_waf_status: bool :param page_identifier: Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. :type page_identifier: str - :param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. + :param sort_by: The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. :type sort_by: str :param sort_order: :type sort_order: str @@ -3444,8 +3159,8 @@ def list_distributions_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "ListDistributionsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -3512,7 +3227,7 @@ def _list_distributions_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/distributions", + resource_path="/v1beta2/projects/{projectId}/distributions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3528,7 +3243,7 @@ def _list_distributions_serialize( @validate_call def list_waf_collections( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3538,12 +3253,12 @@ def list_waf_collections( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListWAFCollectionsResponse: + ) -> ListWafCollectionsResponse: """List all WAF rule collections of the project Returns all WAF rule collections available to the project - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3576,10 +3291,10 @@ def list_waf_collections( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListWAFCollectionsResponse", + "200": "ListWafCollectionsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3591,7 +3306,7 @@ def list_waf_collections( @validate_call def list_waf_collections_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3601,12 +3316,12 @@ def list_waf_collections_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListWAFCollectionsResponse]: + ) -> ApiResponse[ListWafCollectionsResponse]: """List all WAF rule collections of the project Returns all WAF rule collections available to the project - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3639,10 +3354,10 @@ def list_waf_collections_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListWAFCollectionsResponse", + "200": "ListWafCollectionsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3654,7 +3369,7 @@ def list_waf_collections_with_http_info( @validate_call def list_waf_collections_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3669,7 +3384,7 @@ def list_waf_collections_without_preload_content( Returns all WAF rule collections available to the project - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3702,10 +3417,10 @@ def list_waf_collections_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListWAFCollectionsResponse", + "200": "ListWafCollectionsResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -3747,7 +3462,7 @@ def _list_waf_collections_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1beta/projects/{projectId}/waf/collections", + resource_path="/v1beta2/projects/{projectId}/waf/collections", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3763,7 +3478,7 @@ def _list_waf_collections_serialize( @validate_call def patch_distribution( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, patch_distribution_payload: Optional[PatchDistributionPayload] = None, _request_timeout: Union[ @@ -3780,7 +3495,7 @@ def patch_distribution( Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -3821,8 +3536,8 @@ def patch_distribution( _response_types_map: Dict[str, Optional[str]] = { "200": "PatchDistributionResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3834,7 +3549,7 @@ def patch_distribution( @validate_call def patch_distribution_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, patch_distribution_payload: Optional[PatchDistributionPayload] = None, _request_timeout: Union[ @@ -3851,7 +3566,7 @@ def patch_distribution_with_http_info( Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -3892,8 +3607,8 @@ def patch_distribution_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "PatchDistributionResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3905,7 +3620,7 @@ def patch_distribution_with_http_info( @validate_call def patch_distribution_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, patch_distribution_payload: Optional[PatchDistributionPayload] = None, _request_timeout: Union[ @@ -3922,7 +3637,7 @@ def patch_distribution_without_preload_content( Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -3963,8 +3678,8 @@ def patch_distribution_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "PatchDistributionResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -4020,7 +3735,7 @@ def _patch_distribution_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4036,7 +3751,7 @@ def _patch_distribution_serialize( @validate_call def purge_cache( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, purge_cache_payload: Optional[PurgeCachePayload] = None, _request_timeout: Union[ @@ -4053,7 +3768,7 @@ def purge_cache( Clear the cache for this distribution. All content, regardless of its staleness, will get refetched from the host. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -4094,8 +3809,8 @@ def purge_cache( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4107,7 +3822,7 @@ def purge_cache( @validate_call def purge_cache_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, purge_cache_payload: Optional[PurgeCachePayload] = None, _request_timeout: Union[ @@ -4124,7 +3839,7 @@ def purge_cache_with_http_info( Clear the cache for this distribution. All content, regardless of its staleness, will get refetched from the host. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -4165,8 +3880,8 @@ def purge_cache_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4178,7 +3893,7 @@ def purge_cache_with_http_info( @validate_call def purge_cache_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, purge_cache_payload: Optional[PurgeCachePayload] = None, _request_timeout: Union[ @@ -4195,7 +3910,7 @@ def purge_cache_without_preload_content( Clear the cache for this distribution. All content, regardless of its staleness, will get refetched from the host. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -4236,8 +3951,8 @@ def purge_cache_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -4293,7 +4008,7 @@ def _purge_cache_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/cache/purge", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/purge", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4309,7 +4024,7 @@ def _purge_cache_serialize( @validate_call def put_custom_domain( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], put_custom_domain_payload: Optional[PutCustomDomainPayload] = None, @@ -4327,7 +4042,7 @@ def put_custom_domain( Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -4371,8 +4086,8 @@ def put_custom_domain( _response_types_map: Dict[str, Optional[str]] = { "200": "PutCustomDomainResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4384,7 +4099,7 @@ def put_custom_domain( @validate_call def put_custom_domain_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], put_custom_domain_payload: Optional[PutCustomDomainPayload] = None, @@ -4402,7 +4117,7 @@ def put_custom_domain_with_http_info( Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -4446,8 +4161,8 @@ def put_custom_domain_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "PutCustomDomainResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4459,7 +4174,7 @@ def put_custom_domain_with_http_info( @validate_call def put_custom_domain_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Your STACKIT Project ID")], + project_id: Annotated[StrictStr, Field(description="Your STACKIT Project Id")], distribution_id: StrictStr, domain: Annotated[str, Field(strict=True, max_length=72)], put_custom_domain_payload: Optional[PutCustomDomainPayload] = None, @@ -4477,7 +4192,7 @@ def put_custom_domain_without_preload_content( Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - :param project_id: Your STACKIT Project ID (required) + :param project_id: Your STACKIT Project Id (required) :type project_id: str :param distribution_id: (required) :type distribution_id: str @@ -4521,8 +4236,8 @@ def put_custom_domain_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "PutCustomDomainResponse", "401": "str", - "422": "GenericJSONResponse", - "500": "GenericJSONResponse", + "422": "GenericJsonResponse", + "500": "GenericJsonResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -4581,7 +4296,7 @@ def _put_custom_domain_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}", + resource_path="/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/cdn/src/stackit/cdn/api_client.py b/services/cdn/src/stackit/cdn/api_client.py index be2b57c4..11b618f9 100644 --- a/services/cdn/src/stackit/cdn/api_client.py +++ b/services/cdn/src/stackit/cdn/api_client.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/configuration.py b/services/cdn/src/stackit/cdn/configuration.py index 48372c37..92d3a9c1 100644 --- a/services/cdn/src/stackit/cdn/configuration.py +++ b/services/cdn/src/stackit/cdn/configuration.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/exceptions.py b/services/cdn/src/stackit/cdn/exceptions.py index 3b596826..2d905f93 100644 --- a/services/cdn/src/stackit/cdn/exceptions.py +++ b/services/cdn/src/stackit/cdn/exceptions.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/__init__.py b/services/cdn/src/stackit/cdn/models/__init__.py index 7d4409f3..010c5c95 100644 --- a/services/cdn/src/stackit/cdn/models/__init__.py +++ b/services/cdn/src/stackit/cdn/models/__init__.py @@ -6,7 +6,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -14,9 +14,18 @@ # import models into model package +from stackit.cdn.models.bucket_backend import BucketBackend +from stackit.cdn.models.bucket_backend_create import BucketBackendCreate +from stackit.cdn.models.bucket_backend_patch import BucketBackendPatch +from stackit.cdn.models.bucket_credentials import BucketCredentials from stackit.cdn.models.config import Config +from stackit.cdn.models.config_backend import ConfigBackend from stackit.cdn.models.config_patch import ConfigPatch +from stackit.cdn.models.config_patch_backend import ConfigPatchBackend from stackit.cdn.models.create_distribution_payload import CreateDistributionPayload +from stackit.cdn.models.create_distribution_payload_backend import ( + CreateDistributionPayloadBackend, +) from stackit.cdn.models.create_distribution_response import CreateDistributionResponse from stackit.cdn.models.custom_domain import CustomDomain from stackit.cdn.models.delete_custom_domain_response import DeleteCustomDomainResponse @@ -40,7 +49,7 @@ from stackit.cdn.models.find_cache_paths_response_entry import ( FindCachePathsResponseEntry, ) -from stackit.cdn.models.generic_json_response import GenericJSONResponse +from stackit.cdn.models.generic_json_response import GenericJsonResponse from stackit.cdn.models.get_cache_info_response import GetCacheInfoResponse from stackit.cdn.models.get_cache_info_response_history_entry import ( GetCacheInfoResponseHistoryEntry, @@ -57,20 +66,20 @@ ) from stackit.cdn.models.get_distribution_response import GetDistributionResponse from stackit.cdn.models.get_logs_response import GetLogsResponse -from stackit.cdn.models.get_logs_search_filters_response import ( - GetLogsSearchFiltersResponse, -) from stackit.cdn.models.get_statistics_response import GetStatisticsResponse from stackit.cdn.models.http_backend import HttpBackend +from stackit.cdn.models.http_backend_create import HttpBackendCreate from stackit.cdn.models.http_backend_patch import HttpBackendPatch from stackit.cdn.models.list_distributions_response import ListDistributionsResponse -from stackit.cdn.models.list_waf_collections_response import ListWAFCollectionsResponse +from stackit.cdn.models.list_waf_collections_response import ListWafCollectionsResponse from stackit.cdn.models.loki_log_sink import LokiLogSink +from stackit.cdn.models.loki_log_sink_create import LokiLogSinkCreate +from stackit.cdn.models.loki_log_sink_credentials import LokiLogSinkCredentials +from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch 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, @@ -91,8 +100,8 @@ from stackit.cdn.models.waf_config import WafConfig from stackit.cdn.models.waf_config_patch import WafConfigPatch from stackit.cdn.models.waf_mode import WafMode -from stackit.cdn.models.waf_rule import WAFRule -from stackit.cdn.models.waf_rule_collection import WAFRuleCollection -from stackit.cdn.models.waf_rule_group import WAFRuleGroup -from stackit.cdn.models.waf_status_rule_block import WAFStatusRuleBlock +from stackit.cdn.models.waf_rule import WafRule +from stackit.cdn.models.waf_rule_collection import WafRuleCollection +from stackit.cdn.models.waf_rule_group import WafRuleGroup +from stackit.cdn.models.waf_status_rule_block import WafStatusRuleBlock from stackit.cdn.models.waf_type import WafType diff --git a/services/cdn/src/stackit/cdn/models/bucket_backend.py b/services/cdn/src/stackit/cdn/models/bucket_backend.py new file mode 100644 index 00000000..ca1df6f1 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/bucket_backend.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class BucketBackend(BaseModel): + """ + BucketBackend + """ # noqa: E501 + + bucket_url: StrictStr = Field(alias="bucketUrl") + region: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["bucketUrl", "region", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BucketBackend from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BucketBackend from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"bucketUrl": obj.get("bucketUrl"), "region": obj.get("region"), "type": obj.get("type")} + ) + return _obj diff --git a/services/cdn/src/stackit/cdn/models/bucket_backend_create.py b/services/cdn/src/stackit/cdn/models/bucket_backend_create.py new file mode 100644 index 00000000..b3ed76d2 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/bucket_backend_create.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from stackit.cdn.models.bucket_credentials import BucketCredentials + + +class BucketBackendCreate(BaseModel): + """ + BucketBackendCreate + """ # noqa: E501 + + bucket_url: StrictStr = Field(alias="bucketUrl") + credentials: BucketCredentials + region: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["bucketUrl", "credentials", "region", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BucketBackendCreate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of credentials + if self.credentials: + _dict["credentials"] = self.credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BucketBackendCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "bucketUrl": obj.get("bucketUrl"), + "credentials": ( + BucketCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None + ), + "region": obj.get("region"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py b/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py new file mode 100644 index 00000000..899f6d39 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/bucket_backend_patch.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from stackit.cdn.models.bucket_credentials import BucketCredentials + + +class BucketBackendPatch(BaseModel): + """ + BucketBackendPatch + """ # noqa: E501 + + bucket_url: Optional[StrictStr] = Field(default=None, alias="bucketUrl") + credentials: Optional[BucketCredentials] = None + region: Optional[StrictStr] = None + type: StrictStr + __properties: ClassVar[List[str]] = ["bucketUrl", "credentials", "region", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BucketBackendPatch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of credentials + if self.credentials: + _dict["credentials"] = self.credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BucketBackendPatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "bucketUrl": obj.get("bucketUrl"), + "credentials": ( + BucketCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None + ), + "region": obj.get("region"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/cdn/src/stackit/cdn/models/bucket_credentials.py b/services/cdn/src/stackit/cdn/models/bucket_credentials.py new file mode 100644 index 00000000..f3ccd768 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/bucket_credentials.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class BucketCredentials(BaseModel): + """ + BucketCredentials + """ # noqa: E501 + + access_key_id: StrictStr = Field(alias="accessKeyId") + secret_access_key: StrictStr = Field(alias="secretAccessKey") + __properties: ClassVar[List[str]] = ["accessKeyId", "secretAccessKey"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BucketCredentials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BucketCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"accessKeyId": obj.get("accessKeyId"), "secretAccessKey": obj.get("secretAccessKey")} + ) + return _obj diff --git a/services/cdn/src/stackit/cdn/models/config.py b/services/cdn/src/stackit/cdn/models/config.py index 64ccf8f2..60db0d33 100644 --- a/services/cdn/src/stackit/cdn/models/config.py +++ b/services/cdn/src/stackit/cdn/models/config.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Annotated, Self -from stackit.cdn.models.http_backend import HttpBackend +from stackit.cdn.models.config_backend import ConfigBackend from stackit.cdn.models.loki_log_sink import LokiLogSink from stackit.cdn.models.optimizer import Optimizer from stackit.cdn.models.region import Region @@ -32,14 +32,14 @@ class Config(BaseModel): Config """ # noqa: E501 - backend: HttpBackend + backend: ConfigBackend blocked_countries: List[StrictStr] = Field( - description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ", + description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. ", alias="blockedCountries", ) blocked_ips: List[StrictStr] = Field( description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ", - alias="blockedIPs", + alias="blockedIps", ) default_cache_duration: Optional[StrictStr] = Field( default=None, @@ -58,7 +58,7 @@ class Config(BaseModel): __properties: ClassVar[List[str]] = [ "backend", "blockedCountries", - "blockedIPs", + "blockedIps", "defaultCacheDuration", "logSink", "monthlyLimitBytes", @@ -139,9 +139,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "backend": HttpBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, + "backend": ConfigBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, "blockedCountries": obj.get("blockedCountries"), - "blockedIPs": obj.get("blockedIPs"), + "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"), diff --git a/services/cdn/src/stackit/cdn/models/config_backend.py b/services/cdn/src/stackit/cdn/models/config_backend.py new file mode 100644 index 00000000..5f7946d6 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/config_backend.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, Dict, Optional, Set, Union + +from pydantic import ( + BaseModel, + ConfigDict, + ValidationError, + field_validator, +) +from typing_extensions import Self + +from stackit.cdn.models.bucket_backend import BucketBackend +from stackit.cdn.models.http_backend import HttpBackend + + +CONFIGBACKEND_ONE_OF_SCHEMAS = ["BucketBackend", "HttpBackend"] + + +class ConfigBackend(BaseModel): + """ + ConfigBackend + """ + + # data type: HttpBackend + oneof_schema_1_validator: Optional[HttpBackend] = None + # data type: BucketBackend + oneof_schema_2_validator: Optional[BucketBackend] = None + actual_instance: Optional[Union[BucketBackend, HttpBackend]] = None + one_of_schemas: Set[str] = {"BucketBackend", "HttpBackend"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + discriminator_value_class_map: Dict[str, str] = {} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = ConfigBackend.model_construct() + error_messages = [] + match = 0 + # validate data type: HttpBackend + if not isinstance(v, HttpBackend): + error_messages.append(f"Error! Input type `{type(v)}` is not `HttpBackend`") + else: + match += 1 + # validate data type: BucketBackend + if not isinstance(v, BucketBackend): + error_messages.append(f"Error! Input type `{type(v)}` is not `BucketBackend`") + else: + match += 1 + if match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in ConfigBackend with oneOf schemas: BucketBackend, HttpBackend. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into HttpBackend + try: + instance.actual_instance = HttpBackend.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into BucketBackend + try: + instance.actual_instance = BucketBackend.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into ConfigBackend with oneOf schemas: BucketBackend, HttpBackend. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into ConfigBackend with oneOf schemas: BucketBackend, HttpBackend. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], BucketBackend, HttpBackend]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/services/cdn/src/stackit/cdn/models/config_patch.py b/services/cdn/src/stackit/cdn/models/config_patch.py index bc99927b..4dc7cab8 100644 --- a/services/cdn/src/stackit/cdn/models/config_patch.py +++ b/services/cdn/src/stackit/cdn/models/config_patch.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,9 +20,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Annotated, Self -from stackit.cdn.models.http_backend_patch import HttpBackendPatch +from stackit.cdn.models.config_patch_backend import ConfigPatchBackend +from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch from stackit.cdn.models.optimizer_patch import OptimizerPatch -from stackit.cdn.models.patch_loki_log_sink import PatchLokiLogSink from stackit.cdn.models.region import Region from stackit.cdn.models.waf_config_patch import WafConfigPatch @@ -32,7 +32,7 @@ class ConfigPatch(BaseModel): ConfigPatch """ # noqa: E501 - backend: Optional[HttpBackendPatch] = None + backend: Optional[ConfigPatchBackend] = None blocked_countries: Optional[List[StrictStr]] = Field( default=None, description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ", @@ -41,14 +41,14 @@ class ConfigPatch(BaseModel): blocked_ips: Optional[List[StrictStr]] = Field( default=None, description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ", - alias="blockedIPs", + alias="blockedIps", ) default_cache_duration: Optional[StrictStr] = Field( default=None, description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ", alias="defaultCacheDuration", ) - log_sink: Optional[PatchLokiLogSink] = Field(default=None, alias="logSink") + log_sink: Optional[LokiLogSinkPatch] = 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. ", @@ -60,7 +60,7 @@ class ConfigPatch(BaseModel): __properties: ClassVar[List[str]] = [ "backend", "blockedCountries", - "blockedIPs", + "blockedIps", "defaultCacheDuration", "logSink", "monthlyLimitBytes", @@ -146,11 +146,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "backend": HttpBackendPatch.from_dict(obj["backend"]) if obj.get("backend") is not None else None, + "backend": ConfigPatchBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, "blockedCountries": obj.get("blockedCountries"), - "blockedIPs": obj.get("blockedIPs"), + "blockedIps": obj.get("blockedIps"), "defaultCacheDuration": obj.get("defaultCacheDuration"), - "logSink": PatchLokiLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None, + "logSink": LokiLogSinkPatch.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None, "monthlyLimitBytes": obj.get("monthlyLimitBytes"), "optimizer": OptimizerPatch.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None, "regions": obj.get("regions"), diff --git a/services/cdn/src/stackit/cdn/models/config_patch_backend.py b/services/cdn/src/stackit/cdn/models/config_patch_backend.py new file mode 100644 index 00000000..1ed67f5c --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/config_patch_backend.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, Dict, Optional, Set, Union + +from pydantic import ( + BaseModel, + ConfigDict, + ValidationError, + field_validator, +) +from typing_extensions import Self + +from stackit.cdn.models.bucket_backend_patch import BucketBackendPatch +from stackit.cdn.models.http_backend_patch import HttpBackendPatch + + +CONFIGPATCHBACKEND_ONE_OF_SCHEMAS = ["BucketBackendPatch", "HttpBackendPatch"] + + +class ConfigPatchBackend(BaseModel): + """ + ConfigPatchBackend + """ + + # data type: HttpBackendPatch + oneof_schema_1_validator: Optional[HttpBackendPatch] = None + # data type: BucketBackendPatch + oneof_schema_2_validator: Optional[BucketBackendPatch] = None + actual_instance: Optional[Union[BucketBackendPatch, HttpBackendPatch]] = None + one_of_schemas: Set[str] = {"BucketBackendPatch", "HttpBackendPatch"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + discriminator_value_class_map: Dict[str, str] = {} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = ConfigPatchBackend.model_construct() + error_messages = [] + match = 0 + # validate data type: HttpBackendPatch + if not isinstance(v, HttpBackendPatch): + error_messages.append(f"Error! Input type `{type(v)}` is not `HttpBackendPatch`") + else: + match += 1 + # validate data type: BucketBackendPatch + if not isinstance(v, BucketBackendPatch): + error_messages.append(f"Error! Input type `{type(v)}` is not `BucketBackendPatch`") + else: + match += 1 + if match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in ConfigPatchBackend with oneOf schemas: BucketBackendPatch, HttpBackendPatch. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into HttpBackendPatch + try: + instance.actual_instance = HttpBackendPatch.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into BucketBackendPatch + try: + instance.actual_instance = BucketBackendPatch.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into ConfigPatchBackend with oneOf schemas: BucketBackendPatch, HttpBackendPatch. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into ConfigPatchBackend with oneOf schemas: BucketBackendPatch, HttpBackendPatch. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], BucketBackendPatch, HttpBackendPatch]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) 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 243e9d4d..03d5fb23 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_payload.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,8 +20,11 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Annotated, Self +from stackit.cdn.models.create_distribution_payload_backend import ( + CreateDistributionPayloadBackend, +) +from stackit.cdn.models.loki_log_sink_create import LokiLogSinkCreate from stackit.cdn.models.optimizer import Optimizer -from stackit.cdn.models.patch_loki_log_sink import PatchLokiLogSink from stackit.cdn.models.region import Region from stackit.cdn.models.waf_config import WafConfig @@ -31,6 +34,7 @@ class CreateDistributionPayload(BaseModel): CreateDistributionPayload """ # noqa: E501 + backend: CreateDistributionPayloadBackend blocked_countries: Optional[List[StrictStr]] = Field( default=None, description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ", @@ -39,53 +43,38 @@ class CreateDistributionPayload(BaseModel): blocked_ips: Optional[List[StrictStr]] = Field( default=None, description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ", - alias="blockedIPs", + alias="blockedIps", ) default_cache_duration: Optional[StrictStr] = Field( default=None, description="Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) ", alias="defaultCacheDuration", ) - geofencing: Optional[Dict[str, List[StrictStr]]] = Field( - default=None, - description="An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You can not have a country be assigned to multiple alternative origins. ", - ) intent_id: Optional[StrictStr] = Field( default=None, description="While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. ", alias="intentId", ) - log_sink: Optional[PatchLokiLogSink] = Field(default=None, alias="logSink") + log_sink: Optional[LokiLogSinkCreate] = 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. ", alias="monthlyLimitBytes", ) optimizer: Optional[Optimizer] = None - origin_request_headers: Optional[Dict[str, StrictStr]] = Field( - default=None, - description="Headers that will be sent with every request to the configured origin. WARNING: Do not store sensitive values in the headers. The data is stores as plain text. ", - alias="originRequestHeaders", - ) - origin_url: StrictStr = Field( - description="The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` ", - alias="originUrl", - ) regions: Annotated[List[Region], Field(min_length=1)] = Field( description="Define in which regions you would like your content to be cached. " ) waf: Optional[WafConfig] = None __properties: ClassVar[List[str]] = [ + "backend", "blockedCountries", - "blockedIPs", + "blockedIps", "defaultCacheDuration", - "geofencing", "intentId", "logSink", "monthlyLimitBytes", "optimizer", - "originRequestHeaders", - "originUrl", "regions", "waf", ] @@ -127,6 +116,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # 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() @@ -149,16 +141,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "backend": ( + CreateDistributionPayloadBackend.from_dict(obj["backend"]) + if obj.get("backend") is not None + else None + ), "blockedCountries": obj.get("blockedCountries"), - "blockedIPs": obj.get("blockedIPs"), + "blockedIps": obj.get("blockedIps"), "defaultCacheDuration": obj.get("defaultCacheDuration"), - "geofencing": obj.get("geofencing"), "intentId": obj.get("intentId"), - "logSink": PatchLokiLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None, + "logSink": LokiLogSinkCreate.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, - "originRequestHeaders": obj.get("originRequestHeaders"), - "originUrl": obj.get("originUrl"), "regions": obj.get("regions"), "waf": WafConfig.from_dict(obj["waf"]) if obj.get("waf") is not None else None, } 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 new file mode 100644 index 00000000..4334f311 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/create_distribution_payload_backend.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, Dict, Optional, Set, Union + +from pydantic import ( + BaseModel, + ConfigDict, + ValidationError, + field_validator, +) +from typing_extensions import Self + +from stackit.cdn.models.bucket_backend_create import BucketBackendCreate +from stackit.cdn.models.http_backend_create import HttpBackendCreate + + +CREATEDISTRIBUTIONPAYLOADBACKEND_ONE_OF_SCHEMAS = ["BucketBackendCreate", "HttpBackendCreate"] + + +class CreateDistributionPayloadBackend(BaseModel): + """ + Configuration for the content origin backend. + """ + + # data type: HttpBackendCreate + oneof_schema_1_validator: Optional[HttpBackendCreate] = None + # data type: BucketBackendCreate + oneof_schema_2_validator: Optional[BucketBackendCreate] = None + actual_instance: Optional[Union[BucketBackendCreate, HttpBackendCreate]] = None + one_of_schemas: Set[str] = {"BucketBackendCreate", "HttpBackendCreate"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + discriminator_value_class_map: Dict[str, str] = {} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = CreateDistributionPayloadBackend.model_construct() + error_messages = [] + match = 0 + # validate data type: HttpBackendCreate + if not isinstance(v, HttpBackendCreate): + error_messages.append(f"Error! Input type `{type(v)}` is not `HttpBackendCreate`") + else: + match += 1 + # validate data type: BucketBackendCreate + if not isinstance(v, BucketBackendCreate): + error_messages.append(f"Error! Input type `{type(v)}` is not `BucketBackendCreate`") + else: + match += 1 + if match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in CreateDistributionPayloadBackend with oneOf schemas: BucketBackendCreate, HttpBackendCreate. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into HttpBackendCreate + try: + instance.actual_instance = HttpBackendCreate.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into BucketBackendCreate + try: + instance.actual_instance = BucketBackendCreate.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into CreateDistributionPayloadBackend with oneOf schemas: BucketBackendCreate, HttpBackendCreate. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into CreateDistributionPayloadBackend with oneOf schemas: BucketBackendCreate, HttpBackendCreate. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], BucketBackendCreate, HttpBackendCreate]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) 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 c9d8fe87..2b23088b 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/custom_domain.py b/services/cdn/src/stackit/cdn/models/custom_domain.py index 1fc53bff..8928d5eb 100644 --- a/services/cdn/src/stackit/cdn/models/custom_domain.py +++ b/services/cdn/src/stackit/cdn/models/custom_domain.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 9c7c47d0..1ae20991 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 45472773..5f12bd6c 100644 --- a/services/cdn/src/stackit/cdn/models/delete_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/delete_distribution_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/distribution.py b/services/cdn/src/stackit/cdn/models/distribution.py index de3faf9a..773ec50b 100644 --- a/services/cdn/src/stackit/cdn/models/distribution.py +++ b/services/cdn/src/stackit/cdn/models/distribution.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 348b69a9..f256a027 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_logs_record.py +++ b/services/cdn/src/stackit/cdn/models/distribution_logs_record.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -38,7 +38,7 @@ class DistributionLogsRecord(BaseModel): cache_hit: StrictBool = Field(alias="cacheHit") data_center_region: StrictStr = Field(alias="dataCenterRegion") - distribution_id: StrictStr = Field(alias="distributionID") + distribution_id: StrictStr = Field(alias="distributionId") host: StrictStr path: StrictStr request_country_code: Annotated[str, Field(min_length=2, strict=True, max_length=2)] = Field( @@ -50,7 +50,7 @@ class DistributionLogsRecord(BaseModel): __properties: ClassVar[List[str]] = [ "cacheHit", "dataCenterRegion", - "distributionID", + "distributionId", "host", "path", "requestCountryCode", @@ -124,7 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "cacheHit": obj.get("cacheHit"), "dataCenterRegion": obj.get("dataCenterRegion"), - "distributionID": obj.get("distributionID"), + "distributionId": obj.get("distributionId"), "host": obj.get("host"), "path": obj.get("path"), "requestCountryCode": obj.get("requestCountryCode"), 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 13e0154a..76746aa1 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 52d72b21..52877e9b 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 d3567eee..d5fc8995 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/distribution_waf.py b/services/cdn/src/stackit/cdn/models/distribution_waf.py index c6c63134..1958d3f9 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_waf.py +++ b/services/cdn/src/stackit/cdn/models/distribution_waf.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Self -from stackit.cdn.models.waf_status_rule_block import WAFStatusRuleBlock +from stackit.cdn.models.waf_status_rule_block import WafStatusRuleBlock class DistributionWaf(BaseModel): @@ -28,9 +28,9 @@ class DistributionWaf(BaseModel): For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** """ # noqa: E501 - disabled_rules: List[WAFStatusRuleBlock] = Field(alias="disabledRules") - enabled_rules: List[WAFStatusRuleBlock] = Field(alias="enabledRules") - log_only_rules: List[WAFStatusRuleBlock] = Field(alias="logOnlyRules") + disabled_rules: List[WafStatusRuleBlock] = Field(alias="disabledRules") + enabled_rules: List[WafStatusRuleBlock] = Field(alias="enabledRules") + log_only_rules: List[WafStatusRuleBlock] = Field(alias="logOnlyRules") __properties: ClassVar[List[str]] = ["disabledRules", "enabledRules", "logOnlyRules"] model_config = ConfigDict( @@ -105,17 +105,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "disabledRules": ( - [WAFStatusRuleBlock.from_dict(_item) for _item in obj["disabledRules"]] + [WafStatusRuleBlock.from_dict(_item) for _item in obj["disabledRules"]] if obj.get("disabledRules") is not None else None ), "enabledRules": ( - [WAFStatusRuleBlock.from_dict(_item) for _item in obj["enabledRules"]] + [WafStatusRuleBlock.from_dict(_item) for _item in obj["enabledRules"]] if obj.get("enabledRules") is not None else None ), "logOnlyRules": ( - [WAFStatusRuleBlock.from_dict(_item) for _item in obj["logOnlyRules"]] + [WafStatusRuleBlock.from_dict(_item) for _item in obj["logOnlyRules"]] if obj.get("logOnlyRules") is not None else None ), diff --git a/services/cdn/src/stackit/cdn/models/domain.py b/services/cdn/src/stackit/cdn/models/domain.py index c05036ef..84b94544 100644 --- a/services/cdn/src/stackit/cdn/models/domain.py +++ b/services/cdn/src/stackit/cdn/models/domain.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/domain_status.py b/services/cdn/src/stackit/cdn/models/domain_status.py index 7b8ff562..aafaeded 100644 --- a/services/cdn/src/stackit/cdn/models/domain_status.py +++ b/services/cdn/src/stackit/cdn/models/domain_status.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/error_details.py b/services/cdn/src/stackit/cdn/models/error_details.py index 3b625206..43974884 100644 --- a/services/cdn/src/stackit/cdn/models/error_details.py +++ b/services/cdn/src/stackit/cdn/models/error_details.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -29,13 +29,12 @@ class ErrorDetails(BaseModel): de: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field( default=None, description="German description of the error" ) - description: Annotated[str, Field(min_length=1, strict=True)] en: Annotated[str, Field(min_length=1, strict=True)] = Field(description="English description of the error") var_field: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field( default=None, description="Optional field in the request this error detail refers to", alias="field" ) key: Annotated[str, Field(min_length=1, strict=True)] - __properties: ClassVar[List[str]] = ["de", "description", "en", "field", "key"] + __properties: ClassVar[List[str]] = ["de", "en", "field", "key"] @field_validator("key") def key_validate_enum(cls, value): @@ -95,12 +94,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - { - "de": obj.get("de"), - "description": obj.get("description"), - "en": obj.get("en"), - "field": obj.get("field"), - "key": obj.get("key"), - } + {"de": obj.get("de"), "en": obj.get("en"), "field": obj.get("field"), "key": obj.get("key")} ) return _obj 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 e7c0f2d5..dfb3ac95 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 630dd226..10c2b11f 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 c93ee9ac..a7201d0c 100644 --- a/services/cdn/src/stackit/cdn/models/generic_json_response.py +++ b/services/cdn/src/stackit/cdn/models/generic_json_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -23,9 +23,9 @@ from stackit.cdn.models.error_details import ErrorDetails -class GenericJSONResponse(BaseModel): +class GenericJsonResponse(BaseModel): """ - GenericJSONResponse + GenericJsonResponse """ # noqa: E501 details: Optional[List[ErrorDetails]] = Field(default=None, description="Listing of issues with your request") @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GenericJSONResponse from a JSON string""" + """Create an instance of GenericJsonResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GenericJSONResponse from a dict""" + """Create an instance of GenericJsonResponse from a dict""" if obj is None: return None 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 8f07720b..f4709056 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 ce16e992..ce8515b1 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -28,23 +28,9 @@ class GetCacheInfoResponseHistoryEntry(BaseModel): GetCacheInfoResponseHistoryEntry """ # noqa: E501 - occured_at: datetime = Field(alias="occuredAt") occurred_at: datetime = Field(alias="occurredAt") type: StrictStr - __properties: ClassVar[List[str]] = ["occuredAt", "occurredAt", "type"] - - @field_validator("occured_at", mode="before") - def occured_at_change_year_zero_to_one(cls, value): - """Workaround which prevents year 0 issue""" - if isinstance(value, str): - # Check for year "0000" at the beginning of the string - # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ - if value.startswith("0000-01-01T") and re.match( - r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value - ): - # Workaround: Replace "0000" with "0001" - return "0001" + value[4:] # Take "0001" and append the rest of the string - return value + __properties: ClassVar[List[str]] = ["occurredAt", "type"] @field_validator("occurred_at", mode="before") def occurred_at_change_year_zero_to_one(cls, value): @@ -114,7 +100,5 @@ 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( - {"occuredAt": obj.get("occuredAt"), "occurredAt": obj.get("occurredAt"), "type": obj.get("type")} - ) + _obj = cls.model_validate({"occurredAt": obj.get("occurredAt"), "type": obj.get("type")}) return _obj 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 d0c01624..f03eabc7 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 ca488ee0..09f5819f 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 afdc42d9..694bd12f 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -15,11 +15,10 @@ import json import pprint -import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator -from typing_extensions import Annotated, Self +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self from stackit.cdn.models.custom_domain import CustomDomain from stackit.cdn.models.get_custom_domain_response_certificate import ( @@ -34,15 +33,7 @@ class GetCustomDomainResponse(BaseModel): certificate: GetCustomDomainResponseCertificate custom_domain: CustomDomain = Field(alias="customDomain") - domain: Annotated[str, Field(strict=True, max_length=72)] - __properties: ClassVar[List[str]] = ["certificate", "customDomain", "domain"] - - @field_validator("domain") - def domain_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[.\-A-Za-z0-9]*$", value): - raise ValueError(r"must validate the regular expression /^[.\-A-Za-z0-9]*$/") - return value + __properties: ClassVar[List[str]] = ["certificate", "customDomain"] model_config = ConfigDict( populate_by_name=True, @@ -108,7 +99,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "customDomain": ( CustomDomain.from_dict(obj["customDomain"]) if obj.get("customDomain") is not None else None ), - "domain": obj.get("domain"), } ) return _obj 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 e43b7631..cfcb508e 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 d2fd5223..79cd65a2 100644 --- a/services/cdn/src/stackit/cdn/models/get_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/get_distribution_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 06478ab4..6d43b032 100644 --- a/services/cdn/src/stackit/cdn/models/get_logs_response.py +++ b/services/cdn/src/stackit/cdn/models/get_logs_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 81e608f0..9361250f 100644 --- a/services/cdn/src/stackit/cdn/models/get_statistics_response.py +++ b/services/cdn/src/stackit/cdn/models/get_statistics_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/http_backend.py b/services/cdn/src/stackit/cdn/models/http_backend.py index 03f46c2e..09efe9ca 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend.py +++ b/services/cdn/src/stackit/cdn/models/http_backend.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -33,7 +33,10 @@ class HttpBackend(BaseModel): description="Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. ", alias="originRequestHeaders", ) - origin_url: StrictStr = Field(alias="originUrl") + origin_url: StrictStr = Field( + description="The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` ", + alias="originUrl", + ) type: StrictStr __properties: ClassVar[List[str]] = ["geofencing", "originRequestHeaders", "originUrl", "type"] diff --git a/services/cdn/src/stackit/cdn/models/http_backend_create.py b/services/cdn/src/stackit/cdn/models/http_backend_create.py new file mode 100644 index 00000000..7f09fd67 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/http_backend_create.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class HttpBackendCreate(BaseModel): + """ + HttpBackendCreate + """ # noqa: E501 + + geofencing: Optional[Dict[str, List[StrictStr]]] = Field( + default=None, + description="An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. ", + ) + origin_request_headers: Optional[Dict[str, StrictStr]] = Field( + default=None, + description="Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. ", + alias="originRequestHeaders", + ) + origin_url: StrictStr = Field( + description="The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` ", + alias="originUrl", + ) + type: StrictStr + __properties: ClassVar[List[str]] = ["geofencing", "originRequestHeaders", "originUrl", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpBackendCreate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpBackendCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "geofencing": obj.get("geofencing"), + "originRequestHeaders": obj.get("originRequestHeaders"), + "originUrl": obj.get("originUrl"), + "type": obj.get("type"), + } + ) + return _obj 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 f40b606e..ba3911fd 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend_patch.py +++ b/services/cdn/src/stackit/cdn/models/http_backend_patch.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 9d08206c..19085270 100644 --- a/services/cdn/src/stackit/cdn/models/list_distributions_response.py +++ b/services/cdn/src/stackit/cdn/models/list_distributions_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 eb81ba02..2f5330e6 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,15 +20,15 @@ from pydantic import BaseModel, ConfigDict from typing_extensions import Self -from stackit.cdn.models.waf_rule_collection import WAFRuleCollection +from stackit.cdn.models.waf_rule_collection import WafRuleCollection -class ListWAFCollectionsResponse(BaseModel): +class ListWafCollectionsResponse(BaseModel): """ - ListWAFCollectionsResponse + ListWafCollectionsResponse """ # noqa: E501 - collections: List[WAFRuleCollection] + collections: List[WafRuleCollection] __properties: ClassVar[List[str]] = ["collections"] model_config = ConfigDict( @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListWAFCollectionsResponse from a JSON string""" + """Create an instance of ListWafCollectionsResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListWAFCollectionsResponse from a dict""" + """Create an instance of ListWafCollectionsResponse from a dict""" if obj is None: return None @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "collections": ( - [WAFRuleCollection.from_dict(_item) for _item in obj["collections"]] + [WafRuleCollection.from_dict(_item) for _item in obj["collections"]] if obj.get("collections") is not None else None ) 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 954fddda..8fb950da 100644 --- a/services/cdn/src/stackit/cdn/models/loki_log_sink.py +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 new file mode 100644 index 00000000..c0abcc96 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink_create.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from stackit.cdn.models.loki_log_sink_credentials import LokiLogSinkCredentials + + +class LokiLogSinkCreate(BaseModel): + """ + LokiLogSinkCreate + """ # noqa: E501 + + credentials: LokiLogSinkCredentials + push_url: StrictStr = Field(alias="pushUrl") + type: StrictStr + __properties: ClassVar[List[str]] = ["credentials", "pushUrl", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LokiLogSinkCreate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of credentials + if self.credentials: + _dict["credentials"] = self.credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LokiLogSinkCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "credentials": ( + LokiLogSinkCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None + ), + "pushUrl": obj.get("pushUrl"), + "type": obj.get("type"), + } + ) + return _obj 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 new file mode 100644 index 00000000..227d6aaf --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink_credentials.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing_extensions import Self + + +class LokiLogSinkCredentials(BaseModel): + """ + LokiLogSinkCredentials + """ # noqa: E501 + + password: StrictStr + username: StrictStr + __properties: ClassVar[List[str]] = ["password", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LokiLogSinkCredentials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LokiLogSinkCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"password": obj.get("password"), "username": obj.get("username")}) + return _obj 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 new file mode 100644 index 00000000..2863e825 --- /dev/null +++ b/services/cdn/src/stackit/cdn/models/loki_log_sink_patch.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + CDN API + + API used to create and manage your CDN distributions. + + The version of the OpenAPI document: 1beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from stackit.cdn.models.loki_log_sink_credentials import LokiLogSinkCredentials + + +class LokiLogSinkPatch(BaseModel): + """ + LokiLogSinkPatch + """ # noqa: E501 + + credentials: Optional[LokiLogSinkCredentials] = None + push_url: Optional[StrictStr] = Field(default=None, alias="pushUrl") + type: StrictStr + __properties: ClassVar[List[str]] = ["credentials", "pushUrl", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LokiLogSinkPatch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of credentials + if self.credentials: + _dict["credentials"] = self.credentials.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LokiLogSinkPatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "credentials": ( + LokiLogSinkCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None + ), + "pushUrl": obj.get("pushUrl"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/cdn/src/stackit/cdn/models/optimizer.py b/services/cdn/src/stackit/cdn/models/optimizer.py index 1ab8c33d..ca2e3d23 100644 --- a/services/cdn/src/stackit/cdn/models/optimizer.py +++ b/services/cdn/src/stackit/cdn/models/optimizer.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/optimizer_patch.py b/services/cdn/src/stackit/cdn/models/optimizer_patch.py index 76ec4657..a453b227 100644 --- a/services/cdn/src/stackit/cdn/models/optimizer_patch.py +++ b/services/cdn/src/stackit/cdn/models/optimizer_patch.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 66f9dcfc..05f35333 100644 --- a/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 dacb3b98..634ea59d 100644 --- a/services/cdn/src/stackit/cdn/models/patch_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/patch_distribution_response.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 37e995d3..85922d58 100644 --- a/services/cdn/src/stackit/cdn/models/purge_cache_payload.py +++ b/services/cdn/src/stackit/cdn/models/purge_cache_payload.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 8cd6b4d5..53532fee 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 66573b2e..df32773e 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 1014da22..ff82f32f 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 804d3def..71fe8107 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. 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 ca5f69e2..e9779129 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -15,11 +15,10 @@ import json import pprint -import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator -from typing_extensions import Annotated, Self +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self from stackit.cdn.models.custom_domain import CustomDomain from stackit.cdn.models.put_custom_domain_response_certificate import ( @@ -34,15 +33,7 @@ class PutCustomDomainResponse(BaseModel): certificate: Optional[PutCustomDomainResponseCertificate] = None custom_domain: CustomDomain = Field(alias="customDomain") - domain: Annotated[str, Field(strict=True, max_length=72)] - __properties: ClassVar[List[str]] = ["certificate", "customDomain", "domain"] - - @field_validator("domain") - def domain_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[.\-A-Za-z0-9]*$", value): - raise ValueError(r"must validate the regular expression /^[.\-A-Za-z0-9]*$/") - return value + __properties: ClassVar[List[str]] = ["certificate", "customDomain"] model_config = ConfigDict( populate_by_name=True, @@ -108,7 +99,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "customDomain": ( CustomDomain.from_dict(obj["customDomain"]) if obj.get("customDomain") is not None else None ), - "domain": obj.get("domain"), } ) return _obj 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 a23fc0e1..7e694f90 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/region.py b/services/cdn/src/stackit/cdn/models/region.py index ef941477..e7af423f 100644 --- a/services/cdn/src/stackit/cdn/models/region.py +++ b/services/cdn/src/stackit/cdn/models/region.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/status_error.py b/services/cdn/src/stackit/cdn/models/status_error.py index 9883bdd8..5428f5b5 100644 --- a/services/cdn/src/stackit/cdn/models/status_error.py +++ b/services/cdn/src/stackit/cdn/models/status_error.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/waf_config.py b/services/cdn/src/stackit/cdn/models/waf_config.py index 830d9376..8edc7f7e 100644 --- a/services/cdn/src/stackit/cdn/models/waf_config.py +++ b/services/cdn/src/stackit/cdn/models/waf_config.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -30,7 +30,7 @@ class WafConfig(BaseModel): """ # noqa: E501 enabled_rule_ids: List[StrictStr] = Field( - description="IDs of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. ", + description="Ids of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. ", alias="enabledRuleIds", ) mode: WafMode 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 6235b772..b7212e79 100644 --- a/services/cdn/src/stackit/cdn/models/waf_config_patch.py +++ b/services/cdn/src/stackit/cdn/models/waf_config_patch.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/waf_mode.py b/services/cdn/src/stackit/cdn/models/waf_mode.py index 7e7b41c7..1cbaceb0 100644 --- a/services/cdn/src/stackit/cdn/models/waf_mode.py +++ b/services/cdn/src/stackit/cdn/models/waf_mode.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/models/waf_rule.py b/services/cdn/src/stackit/cdn/models/waf_rule.py index 910b4fd6..a99c4dc8 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -21,13 +21,13 @@ from typing_extensions import Self -class WAFRule(BaseModel): +class WafRule(BaseModel): """ - WAFRule + WafRule """ # noqa: E501 code: Optional[StrictStr] = Field( - default=None, description="Optional CoreRuleSet rule ID in case this is a CRS rule" + default=None, description="Optional CoreRuleSet rule Id in case this is a CRS rule" ) description: Dict[str, StrictStr] = Field(description="LocalizedString is a map from language to string value") id: StrictStr @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WAFRule from a JSON string""" + """Create an instance of WafRule from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WAFRule from a dict""" + """Create an instance of WafRule from a dict""" if obj is None: return None 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 3e5c48b9..a9430279 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule_collection.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule_collection.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,15 +20,15 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Self -from stackit.cdn.models.waf_rule_group import WAFRuleGroup +from stackit.cdn.models.waf_rule_group import WafRuleGroup -class WAFRuleCollection(BaseModel): +class WafRuleCollection(BaseModel): """ - WAFRuleCollection + WafRuleCollection """ # noqa: E501 - groups: List[WAFRuleGroup] + groups: List[WafRuleGroup] id: StrictStr name: Dict[str, StrictStr] = Field(description="LocalizedString is a map from language to string value") __properties: ClassVar[List[str]] = ["groups", "id", "name"] @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WAFRuleCollection from a JSON string""" + """Create an instance of WafRuleCollection from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WAFRuleCollection from a dict""" + """Create an instance of WafRuleCollection from a dict""" if obj is None: return None @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "groups": ( - [WAFRuleGroup.from_dict(_item) for _item in obj["groups"]] + [WafRuleGroup.from_dict(_item) for _item in obj["groups"]] if obj.get("groups") is not None else None ), 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 904931ac..edbf35bc 100644 --- a/services/cdn/src/stackit/cdn/models/waf_rule_group.py +++ b/services/cdn/src/stackit/cdn/models/waf_rule_group.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,17 +20,17 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Self -from stackit.cdn.models.waf_rule import WAFRule +from stackit.cdn.models.waf_rule import WafRule -class WAFRuleGroup(BaseModel): +class WafRuleGroup(BaseModel): """ - WAFRuleGroup + WafRuleGroup """ # noqa: E501 description: Dict[str, StrictStr] = Field(description="LocalizedString is a map from language to string value") name: Dict[str, StrictStr] = Field(description="LocalizedString is a map from language to string value") - rules: List[WAFRule] + rules: List[WafRule] __properties: ClassVar[List[str]] = ["description", "name", "rules"] model_config = ConfigDict( @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WAFRuleGroup from a JSON string""" + """Create an instance of WafRuleGroup from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WAFRuleGroup from a dict""" + """Create an instance of WafRuleGroup from a dict""" if obj is None: return None @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "description": obj.get("description"), "name": obj.get("name"), - "rules": [WAFRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "rules": [WafRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, } ) return _obj 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 ad8f0e27..30a9327f 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 @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -21,12 +21,12 @@ from typing_extensions import Self -class WAFStatusRuleBlock(BaseModel): +class WafStatusRuleBlock(BaseModel): """ - WAFStatusRuleBlock + WafStatusRuleBlock """ # noqa: E501 - id: StrictStr = Field(description="Specifies the ID of the Rule.") + id: StrictStr = Field(description="Specifies the Id of the Rule.") __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( @@ -46,7 +46,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WAFStatusRuleBlock from a JSON string""" + """Create an instance of WafStatusRuleBlock from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,7 +70,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WAFStatusRuleBlock from a dict""" + """Create an instance of WafStatusRuleBlock from a dict""" if obj is None: return None diff --git a/services/cdn/src/stackit/cdn/models/waf_type.py b/services/cdn/src/stackit/cdn/models/waf_type.py index 33bd06d9..0008643a 100644 --- a/services/cdn/src/stackit/cdn/models/waf_type.py +++ b/services/cdn/src/stackit/cdn/models/waf_type.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/cdn/src/stackit/cdn/rest.py b/services/cdn/src/stackit/cdn/rest.py index 394ca0ad..b67aac15 100644 --- a/services/cdn/src/stackit/cdn/rest.py +++ b/services/cdn/src/stackit/cdn/rest.py @@ -5,7 +5,7 @@ API used to create and manage your CDN distributions. - The version of the OpenAPI document: 1beta.0.0 + The version of the OpenAPI document: 1beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually.