|
64 | 64 | from PowerPlatform.Dataverse.operations.query import QueryOperations |
65 | 65 | from PowerPlatform.Dataverse.operations.tables import TableOperations |
66 | 66 |
|
| 67 | +try: |
| 68 | + from PowerPlatform.Dataverse.operations.files import FileOperations |
| 69 | +except ImportError: |
| 70 | + FileOperations = None # type: ignore[assignment,misc] |
| 71 | + |
67 | 72 |
|
68 | 73 | def validate_imports(): |
69 | 74 | """Validate that all key imports work correctly.""" |
@@ -123,18 +128,35 @@ def validate_client_methods(DataverseClient): |
123 | 128 | print("\nValidating Client Methods...") |
124 | 129 | print("-" * 50) |
125 | 130 |
|
126 | | - # Validate namespace API: client.records, client.query, client.tables |
| 131 | + # Validate namespace API: client.records, client.query, client.tables, client.files |
127 | 132 | expected_namespaces = { |
128 | | - "records": ["create", "get", "update", "delete"], |
129 | | - "query": ["get", "sql"], |
130 | | - "tables": ["create", "get", "list", "delete", "add_columns", "remove_columns"], |
| 133 | + "records": ["create", "get", "update", "delete", "upsert"], |
| 134 | + "query": ["sql"], |
| 135 | + "tables": [ |
| 136 | + "create", |
| 137 | + "get", |
| 138 | + "list", |
| 139 | + "delete", |
| 140 | + "add_columns", |
| 141 | + "remove_columns", |
| 142 | + "create_one_to_many_relationship", |
| 143 | + "create_many_to_many_relationship", |
| 144 | + "delete_relationship", |
| 145 | + "get_relationship", |
| 146 | + "create_lookup_field", |
| 147 | + ], |
131 | 148 | } |
132 | 149 |
|
| 150 | + if FileOperations is not None: |
| 151 | + expected_namespaces["files"] = ["upload"] |
| 152 | + |
133 | 153 | ns_classes = { |
134 | 154 | "records": RecordOperations, |
135 | 155 | "query": QueryOperations, |
136 | 156 | "tables": TableOperations, |
137 | 157 | } |
| 158 | + if FileOperations is not None: |
| 159 | + ns_classes["files"] = FileOperations |
138 | 160 |
|
139 | 161 | missing_methods = [] |
140 | 162 | for ns, methods in expected_namespaces.items(): |
|
0 commit comments