|
| 1 | +from typing import Any, Dict, List, Optional, Union |
| 2 | +from dataclasses import dataclass |
| 3 | +from ..utils.deep_attr_dict import DeepAttrDict |
| 4 | + |
| 5 | + |
| 6 | +@dataclass |
| 7 | +class UnmanagedAccessGrant: |
| 8 | + access_grant_id: str |
| 9 | + access_method_ids: List[str] |
| 10 | + created_at: str |
| 11 | + display_name: str |
| 12 | + ends_at: str |
| 13 | + errors: List[Dict[str, Any]] |
| 14 | + location_ids: List[str] |
| 15 | + name: str |
| 16 | + pending_mutations: List[Dict[str, Any]] |
| 17 | + requested_access_methods: List[Dict[str, Any]] |
| 18 | + reservation_key: str |
| 19 | + space_ids: List[str] |
| 20 | + starts_at: str |
| 21 | + user_identity_id: str |
| 22 | + warnings: List[Dict[str, Any]] |
| 23 | + workspace_id: str |
| 24 | + |
| 25 | + @staticmethod |
| 26 | + def from_dict(d: Dict[str, Any]): |
| 27 | + return UnmanagedAccessGrant( |
| 28 | + access_grant_id=d.get("access_grant_id", None), |
| 29 | + access_method_ids=d.get("access_method_ids", None), |
| 30 | + created_at=d.get("created_at", None), |
| 31 | + display_name=d.get("display_name", None), |
| 32 | + ends_at=d.get("ends_at", None), |
| 33 | + errors=d.get("errors", None), |
| 34 | + location_ids=d.get("location_ids", None), |
| 35 | + name=d.get("name", None), |
| 36 | + pending_mutations=d.get("pending_mutations", None), |
| 37 | + requested_access_methods=d.get("requested_access_methods", None), |
| 38 | + reservation_key=d.get("reservation_key", None), |
| 39 | + space_ids=d.get("space_ids", None), |
| 40 | + starts_at=d.get("starts_at", None), |
| 41 | + user_identity_id=d.get("user_identity_id", None), |
| 42 | + warnings=d.get("warnings", None), |
| 43 | + workspace_id=d.get("workspace_id", None), |
| 44 | + ) |
0 commit comments