|
5 | 5 | import base64 |
6 | 6 | import io |
7 | 7 | import json |
| 8 | +from datetime import date |
8 | 9 | from time import sleep |
9 | 10 | from typing import Dict, List, Optional, Union |
10 | 11 | from urllib.parse import urljoin |
|
16 | 17 |
|
17 | 18 | from vws._result_codes import raise_for_result_code |
18 | 19 | from vws.exceptions import TargetProcessingTimeout |
19 | | -from vws.reports import DatabaseSummaryReport |
| 20 | +from vws.reports import DatabaseSummaryReport, TargetSummaryReport, TargetStatuses |
20 | 21 |
|
21 | 22 |
|
22 | 23 | def _target_api_request( |
@@ -378,7 +379,18 @@ def get_target_summary_report( |
378 | 379 | expected_result_code='Success', |
379 | 380 | ) |
380 | 381 |
|
381 | | - return dict(response.json()) |
| 382 | + result_data = dict(response.json()) |
| 383 | + return TargetSummaryReport( |
| 384 | + status=TargetStatuses(result_data['status']), |
| 385 | + database_name=result_data['database_name'], |
| 386 | + target_name=result_data['target_name'], |
| 387 | + upload_date=date.fromisoformat(result_data['upload_date']), |
| 388 | + active_flag=result_data['active_flag'], |
| 389 | + tracking_rating=result_data['tracking_rating'], |
| 390 | + total_recos=result_data['total_recos'], |
| 391 | + current_month_recos=result_data['current_month_recos'], |
| 392 | + previous_month_recos=result_data['previous_month_recos'], |
| 393 | + ) |
382 | 394 |
|
383 | 395 | def get_database_summary_report(self) -> DatabaseSummaryReport: |
384 | 396 | """ |
|
0 commit comments