Skip to content

Commit 867820f

Browse files
author
Victor Santos
committed
feat(api): add from_dict method to DynamicSecretLease for nested DynamicSecret handling
1 parent b028db5 commit 867820f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

infisical_sdk/api_types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,15 @@ class DynamicSecretLease(BaseModel):
365365
config: Optional[Any] = None
366366
dynamicSecret: Optional[DynamicSecret] = None
367367

368+
@classmethod
369+
def from_dict(cls, data: Dict) -> 'DynamicSecretLease':
370+
"""Create model from dictionary with nested DynamicSecret"""
371+
lease_data = data.copy()
372+
if 'dynamicSecret' in data and data['dynamicSecret'] is not None:
373+
lease_data['dynamicSecret'] = DynamicSecret.from_dict(data['dynamicSecret'])
374+
375+
return super().from_dict(lease_data)
376+
368377
@dataclass
369378
class CreateLeaseResponse(BaseModel):
370379
"""Response model for create lease API - returns lease, dynamicSecret, and data"""

0 commit comments

Comments
 (0)