stackit-cdn 2.2.0__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/PKG-INFO +1 -1
  2. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/pyproject.toml +1 -1
  3. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/__init__.py +8 -0
  4. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/__init__.py +4 -0
  5. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/config.py +7 -0
  6. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/config_patch.py +7 -0
  7. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/create_distribution_payload.py +7 -0
  8. stackit_cdn-2.3.0/src/stackit/cdn/models/match_condition.py +37 -0
  9. stackit_cdn-2.3.0/src/stackit/cdn/models/matcher.py +93 -0
  10. stackit_cdn-2.3.0/src/stackit/cdn/models/redirect_config.py +98 -0
  11. stackit_cdn-2.3.0/src/stackit/cdn/models/redirect_rule.py +135 -0
  12. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/status_error.py +2 -1
  13. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/LICENSE.md +0 -0
  14. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/NOTICE.txt +0 -0
  15. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/README.md +0 -0
  16. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/api/__init__.py +0 -0
  17. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/api/default_api.py +0 -0
  18. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/api_client.py +0 -0
  19. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/api_response.py +0 -0
  20. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/configuration.py +0 -0
  21. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/exceptions.py +0 -0
  22. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/bucket_backend.py +0 -0
  23. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/bucket_backend_create.py +0 -0
  24. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/bucket_backend_patch.py +0 -0
  25. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/bucket_credentials.py +0 -0
  26. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/config_backend.py +0 -0
  27. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/config_patch_backend.py +0 -0
  28. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/create_distribution_payload_backend.py +0 -0
  29. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/create_distribution_response.py +0 -0
  30. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/custom_domain.py +0 -0
  31. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/delete_custom_domain_response.py +0 -0
  32. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/delete_distribution_response.py +0 -0
  33. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/distribution.py +0 -0
  34. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/distribution_logs_record.py +0 -0
  35. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/distribution_statistics_record.py +0 -0
  36. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/distribution_statistics_record_entry.py +0 -0
  37. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/distribution_statistics_record_regions.py +0 -0
  38. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/distribution_waf.py +0 -0
  39. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/domain.py +0 -0
  40. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/domain_status.py +0 -0
  41. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/error_details.py +0 -0
  42. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/find_cache_paths_response.py +0 -0
  43. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/find_cache_paths_response_entry.py +0 -0
  44. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/generic_json_response.py +0 -0
  45. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_cache_info_response.py +0 -0
  46. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_cache_info_response_history_entry.py +0 -0
  47. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_custom_domain_custom_certificate.py +0 -0
  48. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_custom_domain_managed_certificate.py +0 -0
  49. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_custom_domain_response.py +0 -0
  50. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_custom_domain_response_certificate.py +0 -0
  51. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_distribution_response.py +0 -0
  52. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_logs_response.py +0 -0
  53. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_logs_search_filters_response.py +0 -0
  54. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block.py +0 -0
  55. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_logs_search_filters_response_datacenter_block_item.py +0 -0
  56. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/get_statistics_response.py +0 -0
  57. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/http_backend.py +0 -0
  58. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/http_backend_create.py +0 -0
  59. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/http_backend_patch.py +0 -0
  60. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/list_distributions_response.py +0 -0
  61. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/list_waf_collections_response.py +0 -0
  62. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/loki_log_sink.py +0 -0
  63. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/loki_log_sink_create.py +0 -0
  64. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/loki_log_sink_credentials.py +0 -0
  65. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/loki_log_sink_patch.py +0 -0
  66. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/optimizer.py +0 -0
  67. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/optimizer_patch.py +0 -0
  68. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/patch_distribution_payload.py +0 -0
  69. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/patch_distribution_response.py +0 -0
  70. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/purge_cache_payload.py +0 -0
  71. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/put_custom_domain_custom_certificate.py +0 -0
  72. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/put_custom_domain_managed_certificate.py +0 -0
  73. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/put_custom_domain_payload.py +0 -0
  74. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/put_custom_domain_payload_certificate.py +0 -0
  75. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/put_custom_domain_response.py +0 -0
  76. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/put_custom_domain_response_certificate.py +0 -0
  77. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/region.py +0 -0
  78. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_config.py +0 -0
  79. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_config_patch.py +0 -0
  80. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_mode.py +0 -0
  81. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_paranoia_level.py +0 -0
  82. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_rule.py +0 -0
  83. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_rule_action.py +0 -0
  84. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_rule_collection.py +0 -0
  85. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_rule_group.py +0 -0
  86. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block.py +0 -0
  87. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block_reason.py +0 -0
  88. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block_reason_directly_defined.py +0 -0
  89. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_collection.py +0 -0
  90. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block_reason_inherited_from_group.py +0 -0
  91. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block_reason_invalid_waf_type.py +0 -0
  92. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_status_rule_block_reason_never_defined.py +0 -0
  93. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_type.py +0 -0
  94. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/models/waf_violation.py +0 -0
  95. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/py.typed +0 -0
  96. {stackit_cdn-2.2.0 → stackit_cdn-2.3.0}/src/stackit/cdn/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-cdn
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: CDN API
5
5
  License-File: LICENSE.md
6
6
  License-File: NOTICE.txt
@@ -3,7 +3,7 @@ name = "stackit-cdn"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "stackit-cdn"
6
- version = "v2.2.0"
6
+ version = "v2.3.0"
7
7
  authors = [
8
8
  "STACKIT Developer Tools <developer-tools@stackit.cloud>",
9
9
  ]
@@ -75,6 +75,8 @@ __all__ = [
75
75
  "LokiLogSinkCreate",
76
76
  "LokiLogSinkCredentials",
77
77
  "LokiLogSinkPatch",
78
+ "MatchCondition",
79
+ "Matcher",
78
80
  "Optimizer",
79
81
  "OptimizerPatch",
80
82
  "PatchDistributionPayload",
@@ -86,6 +88,8 @@ __all__ = [
86
88
  "PutCustomDomainPayloadCertificate",
87
89
  "PutCustomDomainResponse",
88
90
  "PutCustomDomainResponseCertificate",
91
+ "RedirectConfig",
92
+ "RedirectRule",
89
93
  "Region",
90
94
  "StatusError",
91
95
  "WAFRuleAction",
@@ -231,6 +235,8 @@ from stackit.cdn.models.loki_log_sink_credentials import (
231
235
  LokiLogSinkCredentials as LokiLogSinkCredentials,
232
236
  )
233
237
  from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch as LokiLogSinkPatch
238
+ from stackit.cdn.models.match_condition import MatchCondition as MatchCondition
239
+ from stackit.cdn.models.matcher import Matcher as Matcher
234
240
  from stackit.cdn.models.optimizer import Optimizer as Optimizer
235
241
  from stackit.cdn.models.optimizer_patch import OptimizerPatch as OptimizerPatch
236
242
  from stackit.cdn.models.patch_distribution_payload import (
@@ -260,6 +266,8 @@ from stackit.cdn.models.put_custom_domain_response import (
260
266
  from stackit.cdn.models.put_custom_domain_response_certificate import (
261
267
  PutCustomDomainResponseCertificate as PutCustomDomainResponseCertificate,
262
268
  )
269
+ from stackit.cdn.models.redirect_config import RedirectConfig as RedirectConfig
270
+ from stackit.cdn.models.redirect_rule import RedirectRule as RedirectRule
263
271
  from stackit.cdn.models.region import Region as Region
264
272
  from stackit.cdn.models.status_error import StatusError as StatusError
265
273
  from stackit.cdn.models.waf_config import WafConfig as WafConfig
@@ -85,6 +85,8 @@ from stackit.cdn.models.loki_log_sink import LokiLogSink
85
85
  from stackit.cdn.models.loki_log_sink_create import LokiLogSinkCreate
86
86
  from stackit.cdn.models.loki_log_sink_credentials import LokiLogSinkCredentials
87
87
  from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch
88
+ from stackit.cdn.models.match_condition import MatchCondition
89
+ from stackit.cdn.models.matcher import Matcher
88
90
  from stackit.cdn.models.optimizer import Optimizer
89
91
  from stackit.cdn.models.optimizer_patch import OptimizerPatch
90
92
  from stackit.cdn.models.patch_distribution_payload import PatchDistributionPayload
@@ -104,6 +106,8 @@ from stackit.cdn.models.put_custom_domain_response import PutCustomDomainRespons
104
106
  from stackit.cdn.models.put_custom_domain_response_certificate import (
105
107
  PutCustomDomainResponseCertificate,
106
108
  )
109
+ from stackit.cdn.models.redirect_config import RedirectConfig
110
+ from stackit.cdn.models.redirect_rule import RedirectRule
107
111
  from stackit.cdn.models.region import Region
108
112
  from stackit.cdn.models.status_error import StatusError
109
113
  from stackit.cdn.models.waf_config import WafConfig
@@ -23,6 +23,7 @@ from typing_extensions import Annotated, Self
23
23
  from stackit.cdn.models.config_backend import ConfigBackend
24
24
  from stackit.cdn.models.loki_log_sink import LokiLogSink
25
25
  from stackit.cdn.models.optimizer import Optimizer
26
+ from stackit.cdn.models.redirect_config import RedirectConfig
26
27
  from stackit.cdn.models.region import Region
27
28
  from stackit.cdn.models.waf_config import WafConfig
28
29
 
@@ -53,6 +54,7 @@ class Config(BaseModel):
53
54
  alias="monthlyLimitBytes",
54
55
  )
55
56
  optimizer: Optional[Optimizer] = None
57
+ redirects: Optional[RedirectConfig] = None
56
58
  regions: Annotated[List[Region], Field(min_length=1)]
57
59
  waf: WafConfig
58
60
  __properties: ClassVar[List[str]] = [
@@ -63,6 +65,7 @@ class Config(BaseModel):
63
65
  "logSink",
64
66
  "monthlyLimitBytes",
65
67
  "optimizer",
68
+ "redirects",
66
69
  "regions",
67
70
  "waf",
68
71
  ]
@@ -113,6 +116,9 @@ class Config(BaseModel):
113
116
  # override the default output from pydantic by calling `to_dict()` of optimizer
114
117
  if self.optimizer:
115
118
  _dict["optimizer"] = self.optimizer.to_dict()
119
+ # override the default output from pydantic by calling `to_dict()` of redirects
120
+ if self.redirects:
121
+ _dict["redirects"] = self.redirects.to_dict()
116
122
  # override the default output from pydantic by calling `to_dict()` of waf
117
123
  if self.waf:
118
124
  _dict["waf"] = self.waf.to_dict()
@@ -146,6 +152,7 @@ class Config(BaseModel):
146
152
  "logSink": LokiLogSink.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
147
153
  "monthlyLimitBytes": obj.get("monthlyLimitBytes"),
148
154
  "optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
155
+ "redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,
149
156
  "regions": obj.get("regions"),
150
157
  "waf": WafConfig.from_dict(obj["waf"]) if obj.get("waf") is not None else None,
151
158
  }
@@ -23,6 +23,7 @@ from typing_extensions import Annotated, Self
23
23
  from stackit.cdn.models.config_patch_backend import ConfigPatchBackend
24
24
  from stackit.cdn.models.loki_log_sink_patch import LokiLogSinkPatch
25
25
  from stackit.cdn.models.optimizer_patch import OptimizerPatch
26
+ from stackit.cdn.models.redirect_config import RedirectConfig
26
27
  from stackit.cdn.models.region import Region
27
28
  from stackit.cdn.models.waf_config_patch import WafConfigPatch
28
29
 
@@ -55,6 +56,7 @@ class ConfigPatch(BaseModel):
55
56
  alias="monthlyLimitBytes",
56
57
  )
57
58
  optimizer: Optional[OptimizerPatch] = None
59
+ redirects: Optional[RedirectConfig] = None
58
60
  regions: Optional[Annotated[List[Region], Field(min_length=1)]] = None
59
61
  waf: Optional[WafConfigPatch] = None
60
62
  __properties: ClassVar[List[str]] = [
@@ -65,6 +67,7 @@ class ConfigPatch(BaseModel):
65
67
  "logSink",
66
68
  "monthlyLimitBytes",
67
69
  "optimizer",
70
+ "redirects",
68
71
  "regions",
69
72
  "waf",
70
73
  ]
@@ -115,6 +118,9 @@ class ConfigPatch(BaseModel):
115
118
  # override the default output from pydantic by calling `to_dict()` of optimizer
116
119
  if self.optimizer:
117
120
  _dict["optimizer"] = self.optimizer.to_dict()
121
+ # override the default output from pydantic by calling `to_dict()` of redirects
122
+ if self.redirects:
123
+ _dict["redirects"] = self.redirects.to_dict()
118
124
  # override the default output from pydantic by calling `to_dict()` of waf
119
125
  if self.waf:
120
126
  _dict["waf"] = self.waf.to_dict()
@@ -153,6 +159,7 @@ class ConfigPatch(BaseModel):
153
159
  "logSink": LokiLogSinkPatch.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
154
160
  "monthlyLimitBytes": obj.get("monthlyLimitBytes"),
155
161
  "optimizer": OptimizerPatch.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
162
+ "redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,
156
163
  "regions": obj.get("regions"),
157
164
  "waf": WafConfigPatch.from_dict(obj["waf"]) if obj.get("waf") is not None else None,
158
165
  }
@@ -25,6 +25,7 @@ from stackit.cdn.models.create_distribution_payload_backend import (
25
25
  )
26
26
  from stackit.cdn.models.loki_log_sink_create import LokiLogSinkCreate
27
27
  from stackit.cdn.models.optimizer import Optimizer
28
+ from stackit.cdn.models.redirect_config import RedirectConfig
28
29
  from stackit.cdn.models.region import Region
29
30
  from stackit.cdn.models.waf_config import WafConfig
30
31
 
@@ -62,6 +63,7 @@ class CreateDistributionPayload(BaseModel):
62
63
  alias="monthlyLimitBytes",
63
64
  )
64
65
  optimizer: Optional[Optimizer] = None
66
+ redirects: Optional[RedirectConfig] = None
65
67
  regions: Annotated[List[Region], Field(min_length=1)] = Field(
66
68
  description="Define in which regions you would like your content to be cached. "
67
69
  )
@@ -75,6 +77,7 @@ class CreateDistributionPayload(BaseModel):
75
77
  "logSink",
76
78
  "monthlyLimitBytes",
77
79
  "optimizer",
80
+ "redirects",
78
81
  "regions",
79
82
  "waf",
80
83
  ]
@@ -125,6 +128,9 @@ class CreateDistributionPayload(BaseModel):
125
128
  # override the default output from pydantic by calling `to_dict()` of optimizer
126
129
  if self.optimizer:
127
130
  _dict["optimizer"] = self.optimizer.to_dict()
131
+ # override the default output from pydantic by calling `to_dict()` of redirects
132
+ if self.redirects:
133
+ _dict["redirects"] = self.redirects.to_dict()
128
134
  # override the default output from pydantic by calling `to_dict()` of waf
129
135
  if self.waf:
130
136
  _dict["waf"] = self.waf.to_dict()
@@ -153,6 +159,7 @@ class CreateDistributionPayload(BaseModel):
153
159
  "logSink": LokiLogSinkCreate.from_dict(obj["logSink"]) if obj.get("logSink") is not None else None,
154
160
  "monthlyLimitBytes": obj.get("monthlyLimitBytes"),
155
161
  "optimizer": Optimizer.from_dict(obj["optimizer"]) if obj.get("optimizer") is not None else None,
162
+ "redirects": RedirectConfig.from_dict(obj["redirects"]) if obj.get("redirects") is not None else None,
156
163
  "regions": obj.get("regions"),
157
164
  "waf": WafConfig.from_dict(obj["waf"]) if obj.get("waf") is not None else None,
158
165
  }
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CDN API
5
+
6
+ API used to create and manage your CDN distributions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ from enum import Enum
18
+
19
+ from typing_extensions import Self
20
+
21
+
22
+ class MatchCondition(str, Enum):
23
+ """
24
+ Defines how multiple matchers within this rule are combined (ALL, ANY, NONE). Defaults to ANY.
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ ANY = "ANY"
31
+ ALL = "ALL"
32
+ NONE = "NONE"
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of MatchCondition from a JSON string"""
37
+ return cls(json.loads(json_str))
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CDN API
5
+
6
+ API used to create and manage your CDN distributions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing_extensions import Annotated, Self
22
+
23
+ from stackit.cdn.models.match_condition import MatchCondition
24
+
25
+
26
+ class Matcher(BaseModel):
27
+ """
28
+ A matcher containing a list of string values to compare against the request path.
29
+ """ # noqa: E501
30
+
31
+ value_match_condition: Optional[MatchCondition] = Field(default=MatchCondition.ANY, alias="valueMatchCondition")
32
+ values: Annotated[List[StrictStr], Field(min_length=1)] = Field(
33
+ description='A list of glob patterns to match against the request path. At least one value is required. Examples: "/shop/*" or "*/img/*"'
34
+ )
35
+ __properties: ClassVar[List[str]] = ["valueMatchCondition", "values"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Matcher from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of Matcher from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate(
86
+ {
87
+ "valueMatchCondition": (
88
+ obj.get("valueMatchCondition") if obj.get("valueMatchCondition") is not None else MatchCondition.ANY
89
+ ),
90
+ "values": obj.get("values"),
91
+ }
92
+ )
93
+ return _obj
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CDN API
5
+
6
+ API used to create and manage your CDN distributions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing_extensions import Self
22
+
23
+ from stackit.cdn.models.redirect_rule import RedirectRule
24
+
25
+
26
+ class RedirectConfig(BaseModel):
27
+ """
28
+ A wrapper for a list of redirect rules that allows for redirect settings on a distribution.
29
+ """ # noqa: E501
30
+
31
+ rules: Optional[List[RedirectRule]] = Field(
32
+ default=None, description="A list of redirect rules. The order of rules matters for evaluation."
33
+ )
34
+ __properties: ClassVar[List[str]] = ["rules"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of RedirectConfig from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in rules (list)
74
+ _items = []
75
+ if self.rules:
76
+ for _item in self.rules:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict["rules"] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of RedirectConfig from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate(
92
+ {
93
+ "rules": (
94
+ [RedirectRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None
95
+ )
96
+ }
97
+ )
98
+ return _obj
@@ -0,0 +1,135 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CDN API
5
+
6
+ API used to create and manage your CDN distributions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import (
21
+ BaseModel,
22
+ ConfigDict,
23
+ Field,
24
+ StrictBool,
25
+ StrictStr,
26
+ field_validator,
27
+ )
28
+ from typing_extensions import Annotated, Self
29
+
30
+ from stackit.cdn.models.match_condition import MatchCondition
31
+ from stackit.cdn.models.matcher import Matcher
32
+
33
+
34
+ class RedirectRule(BaseModel):
35
+ """
36
+ A single redirect rule defining a source pattern and a target URL.
37
+ """ # noqa: E501
38
+
39
+ description: Optional[StrictStr] = Field(default=None, description="An optional description for the redirect rule.")
40
+ enabled: Optional[StrictBool] = Field(default=True, description="A toggle to enable or disable the redirect rule.")
41
+ matchers: Annotated[List[Matcher], Field(min_length=1)] = Field(
42
+ description="A list of matchers that define when this rule should apply. At least one matcher is required."
43
+ )
44
+ rule_match_condition: Optional[MatchCondition] = Field(default=MatchCondition.ANY, alias="ruleMatchCondition")
45
+ status_code: Annotated[int, Field(le=399, strict=True, ge=300)] = Field(
46
+ description="The HTTP status code for the redirect. Must be one of 301, 302, 303, 307, or 308.",
47
+ alias="statusCode",
48
+ )
49
+ target_url: StrictStr = Field(description="The target URL to redirect to. Must be a valid URI.", alias="targetUrl")
50
+ __properties: ClassVar[List[str]] = [
51
+ "description",
52
+ "enabled",
53
+ "matchers",
54
+ "ruleMatchCondition",
55
+ "statusCode",
56
+ "targetUrl",
57
+ ]
58
+
59
+ @field_validator("status_code")
60
+ def status_code_validate_enum(cls, value):
61
+ """Validates the enum"""
62
+ if value not in set([301, 302, 303, 307, 308]):
63
+ raise ValueError("must be one of enum values (301, 302, 303, 307, 308)")
64
+ return value
65
+
66
+ model_config = ConfigDict(
67
+ populate_by_name=True,
68
+ validate_assignment=True,
69
+ protected_namespaces=(),
70
+ )
71
+
72
+ def to_str(self) -> str:
73
+ """Returns the string representation of the model using alias"""
74
+ return pprint.pformat(self.model_dump(by_alias=True))
75
+
76
+ def to_json(self) -> str:
77
+ """Returns the JSON representation of the model using alias"""
78
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
79
+ return json.dumps(self.to_dict())
80
+
81
+ @classmethod
82
+ def from_json(cls, json_str: str) -> Optional[Self]:
83
+ """Create an instance of RedirectRule from a JSON string"""
84
+ return cls.from_dict(json.loads(json_str))
85
+
86
+ def to_dict(self) -> Dict[str, Any]:
87
+ """Return the dictionary representation of the model using alias.
88
+
89
+ This has the following differences from calling pydantic's
90
+ `self.model_dump(by_alias=True)`:
91
+
92
+ * `None` is only added to the output dict for nullable fields that
93
+ were set at model initialization. Other fields with value `None`
94
+ are ignored.
95
+ """
96
+ excluded_fields: Set[str] = set([])
97
+
98
+ _dict = self.model_dump(
99
+ by_alias=True,
100
+ exclude=excluded_fields,
101
+ exclude_none=True,
102
+ )
103
+ # override the default output from pydantic by calling `to_dict()` of each item in matchers (list)
104
+ _items = []
105
+ if self.matchers:
106
+ for _item in self.matchers:
107
+ if _item:
108
+ _items.append(_item.to_dict())
109
+ _dict["matchers"] = _items
110
+ return _dict
111
+
112
+ @classmethod
113
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114
+ """Create an instance of RedirectRule from a dict"""
115
+ if obj is None:
116
+ return None
117
+
118
+ if not isinstance(obj, dict):
119
+ return cls.model_validate(obj)
120
+
121
+ _obj = cls.model_validate(
122
+ {
123
+ "description": obj.get("description"),
124
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
125
+ "matchers": (
126
+ [Matcher.from_dict(_item) for _item in obj["matchers"]] if obj.get("matchers") is not None else None
127
+ ),
128
+ "ruleMatchCondition": (
129
+ obj.get("ruleMatchCondition") if obj.get("ruleMatchCondition") is not None else MatchCondition.ANY
130
+ ),
131
+ "statusCode": obj.get("statusCode"),
132
+ "targetUrl": obj.get("targetUrl"),
133
+ }
134
+ )
135
+ return _obj
@@ -48,10 +48,11 @@ class StatusError(BaseModel):
48
48
  "CUSTOM_DOMAIN_ALREADY_IN_USE",
49
49
  "PUBLIC_BETA_QUOTA_REACHED",
50
50
  "LOG_SINK_INSTANCE_UNAVAILABLE",
51
+ "EXTERNAL_QUOTA_REACHED",
51
52
  ]
52
53
  ):
53
54
  raise ValueError(
54
- "must be one of enum values ('UNKNOWN', 'CUSTOM_DOMAIN_CNAME_MISSING', 'CUSTOM_DOMAIN_ALREADY_IN_USE', 'PUBLIC_BETA_QUOTA_REACHED', 'LOG_SINK_INSTANCE_UNAVAILABLE')"
55
+ "must be one of enum values ('UNKNOWN', 'CUSTOM_DOMAIN_CNAME_MISSING', 'CUSTOM_DOMAIN_ALREADY_IN_USE', 'PUBLIC_BETA_QUOTA_REACHED', 'LOG_SINK_INSTANCE_UNAVAILABLE', 'EXTERNAL_QUOTA_REACHED')"
55
56
  )
56
57
  return value
57
58
 
File without changes
File without changes
File without changes