Skip to content

Commit 507c975

Browse files
committed
validaiton
1 parent ed6db4f commit 507c975

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • sdk/storage/azure-storage-queue/azure/storage/queue

sdk/storage/azure-storage-queue/azure/storage/queue/_models.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ class RetentionPolicy(_BackCompatMixin):
4949
days: Optional[int] = None
5050
"""Indicates the number of days that metrics or logging or soft-deleted data should be retained."""
5151

52+
_validation = {
53+
"enabled": {"required": True},
54+
"days": {"minimum": 1},
55+
}
56+
5257
_attribute_map = {
5358
"enabled": {"key": "Enabled", "type": "bool"},
5459
"days": {"key": "Days", "type": "int"},
@@ -167,6 +172,10 @@ class Metrics(_BackCompatMixin):
167172
retention_policy: RetentionPolicy = RetentionPolicy()
168173
"""The retention policy for the metrics."""
169174

175+
_validation = {
176+
"enabled": {"required": True},
177+
}
178+
170179
_attribute_map = {
171180
"version": {"key": "Version", "type": "str"},
172181
"enabled": {"key": "Enabled", "type": "bool"},
@@ -249,6 +258,14 @@ class CorsRule(_BackCompatMixin):
249258
"""The comma-delimited string representation of the list of headers allowed to be part of the cross-origin
250259
request."""
251260

261+
_validation = {
262+
"allowed_origins": {"required": True},
263+
"allowed_methods": {"required": True},
264+
"allowed_headers": {"required": True},
265+
"exposed_headers": {"required": True},
266+
"max_age_in_seconds": {"required": True, "minimum": 0},
267+
}
268+
252269
_attribute_map = {
253270
"allowed_origins": {"key": "AllowedOrigins", "type": "str"},
254271
"allowed_methods": {"key": "AllowedMethods", "type": "str"},

0 commit comments

Comments
 (0)