11from __future__ import annotations
22
33from collections .abc import Mapping
4- from typing import Any , TypeVar
4+ from typing import Any , TypeVar , cast
55
66from attrs import define as _attrs_define
77from attrs import field as _attrs_field
88
9+ from ..types import UNSET , Unset
10+
911T = TypeVar ("T" , bound = "BackupLimits" )
1012
1113
@@ -14,48 +16,62 @@ class BackupLimits:
1416 """Backup operation limits.
1517
1618 Attributes:
17- max_backup_size_gb (float): Maximum backup size in GB
1819 backup_retention_days (int): Backup retention period in days
19- max_backups_per_day (int): Maximum backups per day
20+ max_backups_per_day (int): Maximum user-initiated backups per day (-1 for unlimited)
21+ max_downloads_per_month (int | None | Unset): Backup downloads allowed per user per calendar month (UTC)
2022 """
2123
22- max_backup_size_gb : float
2324 backup_retention_days : int
2425 max_backups_per_day : int
26+ max_downloads_per_month : int | None | Unset = UNSET
2527 additional_properties : dict [str , Any ] = _attrs_field (init = False , factory = dict )
2628
2729 def to_dict (self ) -> dict [str , Any ]:
28- max_backup_size_gb = self .max_backup_size_gb
29-
3030 backup_retention_days = self .backup_retention_days
3131
3232 max_backups_per_day = self .max_backups_per_day
3333
34+ max_downloads_per_month : int | None | Unset
35+ if isinstance (self .max_downloads_per_month , Unset ):
36+ max_downloads_per_month = UNSET
37+ else :
38+ max_downloads_per_month = self .max_downloads_per_month
39+
3440 field_dict : dict [str , Any ] = {}
3541 field_dict .update (self .additional_properties )
3642 field_dict .update (
3743 {
38- "max_backup_size_gb" : max_backup_size_gb ,
3944 "backup_retention_days" : backup_retention_days ,
4045 "max_backups_per_day" : max_backups_per_day ,
4146 }
4247 )
48+ if max_downloads_per_month is not UNSET :
49+ field_dict ["max_downloads_per_month" ] = max_downloads_per_month
4350
4451 return field_dict
4552
4653 @classmethod
4754 def from_dict (cls : type [T ], src_dict : Mapping [str , Any ]) -> T :
4855 d = dict (src_dict )
49- max_backup_size_gb = d .pop ("max_backup_size_gb" )
50-
5156 backup_retention_days = d .pop ("backup_retention_days" )
5257
5358 max_backups_per_day = d .pop ("max_backups_per_day" )
5459
60+ def _parse_max_downloads_per_month (data : object ) -> int | None | Unset :
61+ if data is None :
62+ return data
63+ if isinstance (data , Unset ):
64+ return data
65+ return cast (int | None | Unset , data )
66+
67+ max_downloads_per_month = _parse_max_downloads_per_month (
68+ d .pop ("max_downloads_per_month" , UNSET )
69+ )
70+
5571 backup_limits = cls (
56- max_backup_size_gb = max_backup_size_gb ,
5772 backup_retention_days = backup_retention_days ,
5873 max_backups_per_day = max_backups_per_day ,
74+ max_downloads_per_month = max_downloads_per_month ,
5975 )
6076
6177 backup_limits .additional_properties = d
0 commit comments