funapi-sciencedb 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. funapi_sciencedb-1.0.1.dist-info/LICENSE +21 -0
  2. funapi_sciencedb-1.0.1.dist-info/METADATA +10 -0
  3. funapi_sciencedb-1.0.1.dist-info/RECORD +54 -0
  4. funapi_sciencedb-1.0.1.dist-info/WHEEL +5 -0
  5. funapi_sciencedb-1.0.1.dist-info/top_level.txt +1 -0
  6. sciencedb/__init__.py +8 -0
  7. sciencedb/api/__init__.py +1 -0
  8. sciencedb/api/open_api_controller/__init__.py +0 -0
  9. sciencedb/api/open_api_controller/harvest_using_get.py +211 -0
  10. sciencedb/api/open_api_controller/json_using_get.py +164 -0
  11. sciencedb/api/open_api_controller/metrics_using_get.py +166 -0
  12. sciencedb/api/open_api_controller/search_using_get.py +196 -0
  13. sciencedb/api/sushi_controller/__init__.py +0 -0
  14. sciencedb/api/sushi_controller/get_api_status.py +171 -0
  15. sciencedb/api/sushi_controller/get_report_by_id_using_get.py +173 -0
  16. sciencedb/api/sushi_controller/get_reports.py +181 -0
  17. sciencedb/client.py +286 -0
  18. sciencedb/errors.py +16 -0
  19. sciencedb/models/__init__.py +75 -0
  20. sciencedb/models/api_result_metrics_result.py +99 -0
  21. sciencedb/models/api_result_search_result.py +99 -0
  22. sciencedb/models/counter_dataset_attributes.py +69 -0
  23. sciencedb/models/counter_dataset_attributes_type.py +10 -0
  24. sciencedb/models/counter_dataset_contributors.py +68 -0
  25. sciencedb/models/counter_dataset_contributors_type.py +10 -0
  26. sciencedb/models/counter_dataset_dates.py +68 -0
  27. sciencedb/models/counter_dataset_dates_type.py +10 -0
  28. sciencedb/models/counter_dataset_identifiers.py +68 -0
  29. sciencedb/models/counter_dataset_identifiers_type.py +10 -0
  30. sciencedb/models/counter_dataset_instance.py +98 -0
  31. sciencedb/models/counter_dataset_instance_access_method.py +9 -0
  32. sciencedb/models/counter_dataset_instance_metric_type.py +11 -0
  33. sciencedb/models/counter_dataset_performance.py +82 -0
  34. sciencedb/models/counter_dataset_period.py +83 -0
  35. sciencedb/models/counter_dataset_report.py +106 -0
  36. sciencedb/models/counter_dataset_usage.py +230 -0
  37. sciencedb/models/counter_dataset_usage_data_type.py +8 -0
  38. sciencedb/models/counter_publisher_identifiers.py +68 -0
  39. sciencedb/models/counter_publisher_identifiers_type.py +10 -0
  40. sciencedb/models/metrics_result.py +95 -0
  41. sciencedb/models/search_record.py +150 -0
  42. sciencedb/models/search_result.py +111 -0
  43. sciencedb/models/sushi_error_model.py +97 -0
  44. sciencedb/models/sushi_error_model_severity.py +11 -0
  45. sciencedb/models/sushi_page_meta.py +77 -0
  46. sciencedb/models/sushi_report.py +72 -0
  47. sciencedb/models/sushi_report_header.py +189 -0
  48. sciencedb/models/sushi_report_header_report_attributes_item.py +43 -0
  49. sciencedb/models/sushi_report_header_report_filters_item.py +43 -0
  50. sciencedb/models/sushi_report_list.py +82 -0
  51. sciencedb/models/sushi_report_page.py +93 -0
  52. sciencedb/models/sushi_service_status.py +118 -0
  53. sciencedb/models/sushi_service_status_alerts_item.py +43 -0
  54. sciencedb/types.py +53 -0
@@ -0,0 +1,68 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.counter_dataset_contributors_type import COUNTERDatasetContributorsType
7
+
8
+ T = TypeVar("T", bound="COUNTERDatasetContributors")
9
+
10
+
11
+ @_attrs_define
12
+ class COUNTERDatasetContributors:
13
+ """
14
+ Attributes:
15
+ type (COUNTERDatasetContributorsType): Example: name.
16
+ value (str): Value of the contributor identifier Example: John Smith.
17
+ """
18
+
19
+ type: COUNTERDatasetContributorsType
20
+ value: str
21
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
22
+
23
+ def to_dict(self) -> Dict[str, Any]:
24
+ type = self.type.value
25
+
26
+ value = self.value
27
+
28
+ field_dict: Dict[str, Any] = {}
29
+ field_dict.update(self.additional_properties)
30
+ field_dict.update(
31
+ {
32
+ "Type": type,
33
+ "Value": value,
34
+ }
35
+ )
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
41
+ d = src_dict.copy()
42
+ type = COUNTERDatasetContributorsType(d.pop("Type"))
43
+
44
+ value = d.pop("Value")
45
+
46
+ counter_dataset_contributors = cls(
47
+ type=type,
48
+ value=value,
49
+ )
50
+
51
+ counter_dataset_contributors.additional_properties = d
52
+ return counter_dataset_contributors
53
+
54
+ @property
55
+ def additional_keys(self) -> List[str]:
56
+ return list(self.additional_properties.keys())
57
+
58
+ def __getitem__(self, key: str) -> Any:
59
+ return self.additional_properties[key]
60
+
61
+ def __setitem__(self, key: str, value: Any) -> None:
62
+ self.additional_properties[key] = value
63
+
64
+ def __delitem__(self, key: str) -> None:
65
+ del self.additional_properties[key]
66
+
67
+ def __contains__(self, key: str) -> bool:
68
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class COUNTERDatasetContributorsType(str, Enum):
5
+ ISNI = "isni"
6
+ NAME = "name"
7
+ ORCID = "orcid"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,68 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.counter_dataset_dates_type import COUNTERDatasetDatesType
7
+
8
+ T = TypeVar("T", bound="COUNTERDatasetDates")
9
+
10
+
11
+ @_attrs_define
12
+ class COUNTERDatasetDates:
13
+ """
14
+ Attributes:
15
+ type (COUNTERDatasetDatesType): Example: pub-date.
16
+ value (str): Value of the dataset date Example: 2002-01-15.
17
+ """
18
+
19
+ type: COUNTERDatasetDatesType
20
+ value: str
21
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
22
+
23
+ def to_dict(self) -> Dict[str, Any]:
24
+ type = self.type.value
25
+
26
+ value = self.value
27
+
28
+ field_dict: Dict[str, Any] = {}
29
+ field_dict.update(self.additional_properties)
30
+ field_dict.update(
31
+ {
32
+ "type": type,
33
+ "value": value,
34
+ }
35
+ )
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
41
+ d = src_dict.copy()
42
+ type = COUNTERDatasetDatesType(d.pop("type"))
43
+
44
+ value = d.pop("value")
45
+
46
+ counter_dataset_dates = cls(
47
+ type=type,
48
+ value=value,
49
+ )
50
+
51
+ counter_dataset_dates.additional_properties = d
52
+ return counter_dataset_dates
53
+
54
+ @property
55
+ def additional_keys(self) -> List[str]:
56
+ return list(self.additional_properties.keys())
57
+
58
+ def __getitem__(self, key: str) -> Any:
59
+ return self.additional_properties[key]
60
+
61
+ def __setitem__(self, key: str, value: Any) -> None:
62
+ self.additional_properties[key] = value
63
+
64
+ def __delitem__(self, key: str) -> None:
65
+ del self.additional_properties[key]
66
+
67
+ def __contains__(self, key: str) -> bool:
68
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class COUNTERDatasetDatesType(str, Enum):
5
+ FIRST_ACCESSED_ONLINE = "first-accessed-online"
6
+ PROPRIETARY = "proprietary"
7
+ PUB_DATE = "pub-date"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,68 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.counter_dataset_identifiers_type import COUNTERDatasetIdentifiersType
7
+
8
+ T = TypeVar("T", bound="COUNTERDatasetIdentifiers")
9
+
10
+
11
+ @_attrs_define
12
+ class COUNTERDatasetIdentifiers:
13
+ """
14
+ Attributes:
15
+ type (COUNTERDatasetIdentifiersType): Example: doi.
16
+ value (str): Value of the dataset identifier Example: 0931-865.
17
+ """
18
+
19
+ type: COUNTERDatasetIdentifiersType
20
+ value: str
21
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
22
+
23
+ def to_dict(self) -> Dict[str, Any]:
24
+ type = self.type.value
25
+
26
+ value = self.value
27
+
28
+ field_dict: Dict[str, Any] = {}
29
+ field_dict.update(self.additional_properties)
30
+ field_dict.update(
31
+ {
32
+ "type": type,
33
+ "value": value,
34
+ }
35
+ )
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
41
+ d = src_dict.copy()
42
+ type = COUNTERDatasetIdentifiersType(d.pop("type"))
43
+
44
+ value = d.pop("value")
45
+
46
+ counter_dataset_identifiers = cls(
47
+ type=type,
48
+ value=value,
49
+ )
50
+
51
+ counter_dataset_identifiers.additional_properties = d
52
+ return counter_dataset_identifiers
53
+
54
+ @property
55
+ def additional_keys(self) -> List[str]:
56
+ return list(self.additional_properties.keys())
57
+
58
+ def __getitem__(self, key: str) -> Any:
59
+ return self.additional_properties[key]
60
+
61
+ def __setitem__(self, key: str, value: Any) -> None:
62
+ self.additional_properties[key] = value
63
+
64
+ def __delitem__(self, key: str) -> None:
65
+ del self.additional_properties[key]
66
+
67
+ def __contains__(self, key: str) -> bool:
68
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class COUNTERDatasetIdentifiersType(str, Enum):
5
+ DOI = "doi"
6
+ PROPRIETARY = "proprietary"
7
+ URI = "uri"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,98 @@
1
+ from typing import Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.counter_dataset_instance_access_method import (
7
+ COUNTERDatasetInstanceAccessMethod,
8
+ )
9
+ from ..models.counter_dataset_instance_metric_type import (
10
+ COUNTERDatasetInstanceMetricType,
11
+ )
12
+ from ..types import UNSET, Unset
13
+
14
+ T = TypeVar("T", bound="COUNTERDatasetInstance")
15
+
16
+
17
+ @_attrs_define
18
+ class COUNTERDatasetInstance:
19
+ """
20
+ Attributes:
21
+ access_method (Union[Unset, COUNTERDatasetInstanceAccessMethod]): Identifies if the usage activity was 'Regular'
22
+ usage - a user doing research on a content site, or if the usage activity was 'Machine' - for the purpose of
23
+ retrieving content for Text and Data Mining (TDM) Example: regular.
24
+ count (Union[Unset, int]):
25
+ metric_type (Union[Unset, COUNTERDatasetInstanceMetricType]):
26
+ """
27
+
28
+ access_method: Union[Unset, COUNTERDatasetInstanceAccessMethod] = UNSET
29
+ count: Union[Unset, int] = UNSET
30
+ metric_type: Union[Unset, COUNTERDatasetInstanceMetricType] = UNSET
31
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
32
+
33
+ def to_dict(self) -> Dict[str, Any]:
34
+ access_method: Union[Unset, str] = UNSET
35
+ if not isinstance(self.access_method, Unset):
36
+ access_method = self.access_method.value
37
+
38
+ count = self.count
39
+
40
+ metric_type: Union[Unset, str] = UNSET
41
+ if not isinstance(self.metric_type, Unset):
42
+ metric_type = self.metric_type.value
43
+
44
+ field_dict: Dict[str, Any] = {}
45
+ field_dict.update(self.additional_properties)
46
+ field_dict.update({})
47
+ if access_method is not UNSET:
48
+ field_dict["access-method"] = access_method
49
+ if count is not UNSET:
50
+ field_dict["count"] = count
51
+ if metric_type is not UNSET:
52
+ field_dict["metric-type"] = metric_type
53
+
54
+ return field_dict
55
+
56
+ @classmethod
57
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
58
+ d = src_dict.copy()
59
+ _access_method = d.pop("access-method", UNSET)
60
+ access_method: Union[Unset, COUNTERDatasetInstanceAccessMethod]
61
+ if isinstance(_access_method, Unset):
62
+ access_method = UNSET
63
+ else:
64
+ access_method = COUNTERDatasetInstanceAccessMethod(_access_method)
65
+
66
+ count = d.pop("count", UNSET)
67
+
68
+ _metric_type = d.pop("metric-type", UNSET)
69
+ metric_type: Union[Unset, COUNTERDatasetInstanceMetricType]
70
+ if isinstance(_metric_type, Unset):
71
+ metric_type = UNSET
72
+ else:
73
+ metric_type = COUNTERDatasetInstanceMetricType(_metric_type)
74
+
75
+ counter_dataset_instance = cls(
76
+ access_method=access_method,
77
+ count=count,
78
+ metric_type=metric_type,
79
+ )
80
+
81
+ counter_dataset_instance.additional_properties = d
82
+ return counter_dataset_instance
83
+
84
+ @property
85
+ def additional_keys(self) -> List[str]:
86
+ return list(self.additional_properties.keys())
87
+
88
+ def __getitem__(self, key: str) -> Any:
89
+ return self.additional_properties[key]
90
+
91
+ def __setitem__(self, key: str, value: Any) -> None:
92
+ self.additional_properties[key] = value
93
+
94
+ def __delitem__(self, key: str) -> None:
95
+ del self.additional_properties[key]
96
+
97
+ def __contains__(self, key: str) -> bool:
98
+ return key in self.additional_properties
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class COUNTERDatasetInstanceAccessMethod(str, Enum):
5
+ MACHINE = "machine"
6
+ REGULAR = "regular"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,11 @@
1
+ from enum import Enum
2
+
3
+
4
+ class COUNTERDatasetInstanceMetricType(str, Enum):
5
+ TOTAL_DATASET_INVESTIGATIONS = "total-dataset-investigations"
6
+ TOTAL_DATASET_REQUESTS = "total-dataset-requests"
7
+ UNIQUE_DATASET_INVESTIGATIONS = "unique-dataset-investigations"
8
+ UNIQUE_DATASET_REQUESTS = "unique-dataset-requests"
9
+
10
+ def __str__(self) -> str:
11
+ return str(self.value)
@@ -0,0 +1,82 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ if TYPE_CHECKING:
7
+ from ..models.counter_dataset_instance import COUNTERDatasetInstance
8
+ from ..models.counter_dataset_period import COUNTERDatasetPeriod
9
+
10
+
11
+ T = TypeVar("T", bound="COUNTERDatasetPerformance")
12
+
13
+
14
+ @_attrs_define
15
+ class COUNTERDatasetPerformance:
16
+ """
17
+ Attributes:
18
+ instance (List['COUNTERDatasetInstance']):
19
+ period (COUNTERDatasetPeriod):
20
+ """
21
+
22
+ instance: List["COUNTERDatasetInstance"]
23
+ period: "COUNTERDatasetPeriod"
24
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> Dict[str, Any]:
27
+ instance = []
28
+ for instance_item_data in self.instance:
29
+ instance_item = instance_item_data.to_dict()
30
+ instance.append(instance_item)
31
+
32
+ period = self.period.to_dict()
33
+
34
+ field_dict: Dict[str, Any] = {}
35
+ field_dict.update(self.additional_properties)
36
+ field_dict.update(
37
+ {
38
+ "instance": instance,
39
+ "period": period,
40
+ }
41
+ )
42
+
43
+ return field_dict
44
+
45
+ @classmethod
46
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
47
+ from ..models.counter_dataset_instance import COUNTERDatasetInstance
48
+ from ..models.counter_dataset_period import COUNTERDatasetPeriod
49
+
50
+ d = src_dict.copy()
51
+ instance = []
52
+ _instance = d.pop("instance")
53
+ for instance_item_data in _instance:
54
+ instance_item = COUNTERDatasetInstance.from_dict(instance_item_data)
55
+
56
+ instance.append(instance_item)
57
+
58
+ period = COUNTERDatasetPeriod.from_dict(d.pop("period"))
59
+
60
+ counter_dataset_performance = cls(
61
+ instance=instance,
62
+ period=period,
63
+ )
64
+
65
+ counter_dataset_performance.additional_properties = d
66
+ return counter_dataset_performance
67
+
68
+ @property
69
+ def additional_keys(self) -> List[str]:
70
+ return list(self.additional_properties.keys())
71
+
72
+ def __getitem__(self, key: str) -> Any:
73
+ return self.additional_properties[key]
74
+
75
+ def __setitem__(self, key: str, value: Any) -> None:
76
+ self.additional_properties[key] = value
77
+
78
+ def __delitem__(self, key: str) -> None:
79
+ del self.additional_properties[key]
80
+
81
+ def __contains__(self, key: str) -> bool:
82
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
1
+ import datetime
2
+ from typing import Any, Dict, List, Type, TypeVar, Union
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+ from dateutil.parser import isoparse
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="COUNTERDatasetPeriod")
11
+
12
+
13
+ @_attrs_define
14
+ class COUNTERDatasetPeriod:
15
+ """
16
+ Attributes:
17
+ begin_date (Union[Unset, datetime.datetime]):
18
+ end_date (Union[Unset, datetime.datetime]):
19
+ """
20
+
21
+ begin_date: Union[Unset, datetime.datetime] = UNSET
22
+ end_date: Union[Unset, datetime.datetime] = UNSET
23
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
24
+
25
+ def to_dict(self) -> Dict[str, Any]:
26
+ begin_date: Union[Unset, str] = UNSET
27
+ if not isinstance(self.begin_date, Unset):
28
+ begin_date = self.begin_date.isoformat()
29
+
30
+ end_date: Union[Unset, str] = UNSET
31
+ if not isinstance(self.end_date, Unset):
32
+ end_date = self.end_date.isoformat()
33
+
34
+ field_dict: Dict[str, Any] = {}
35
+ field_dict.update(self.additional_properties)
36
+ field_dict.update({})
37
+ if begin_date is not UNSET:
38
+ field_dict["begin-date"] = begin_date
39
+ if end_date is not UNSET:
40
+ field_dict["end-date"] = end_date
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
46
+ d = src_dict.copy()
47
+ _begin_date = d.pop("begin-date", UNSET)
48
+ begin_date: Union[Unset, datetime.datetime]
49
+ if isinstance(_begin_date, Unset):
50
+ begin_date = UNSET
51
+ else:
52
+ begin_date = isoparse(_begin_date)
53
+
54
+ _end_date = d.pop("end-date", UNSET)
55
+ end_date: Union[Unset, datetime.datetime]
56
+ if isinstance(_end_date, Unset):
57
+ end_date = UNSET
58
+ else:
59
+ end_date = isoparse(_end_date)
60
+
61
+ counter_dataset_period = cls(
62
+ begin_date=begin_date,
63
+ end_date=end_date,
64
+ )
65
+
66
+ counter_dataset_period.additional_properties = d
67
+ return counter_dataset_period
68
+
69
+ @property
70
+ def additional_keys(self) -> List[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,106 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.counter_dataset_usage import COUNTERDatasetUsage
10
+ from ..models.sushi_report_header import SUSHIReportHeader
11
+
12
+
13
+ T = TypeVar("T", bound="COUNTERDatasetReport")
14
+
15
+
16
+ @_attrs_define
17
+ class COUNTERDatasetReport:
18
+ """Describes the formatting needs for the COUNTER Dataset Report. Response may include the Report_Header (optional),
19
+ Report_Datasets (usage stats).
20
+
21
+ Attributes:
22
+ id (Union[Unset, str]): id of report.
23
+ report_header (Union[Unset, SUSHIReportHeader]): Generalized report header that defines the requested report,
24
+ the requestor, the customer, filters applied, reportAttributes applied and any exceptions.
25
+ report_datasets (Union[Unset, List['COUNTERDatasetUsage']]): list of datasets .
26
+ """
27
+
28
+ id: Union[Unset, str] = UNSET
29
+ report_header: Union[Unset, "SUSHIReportHeader"] = UNSET
30
+ report_datasets: Union[Unset, List["COUNTERDatasetUsage"]] = UNSET
31
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
32
+
33
+ def to_dict(self) -> Dict[str, Any]:
34
+ id = self.id
35
+
36
+ report_header: Union[Unset, Dict[str, Any]] = UNSET
37
+ if not isinstance(self.report_header, Unset):
38
+ report_header = self.report_header.to_dict()
39
+
40
+ report_datasets: Union[Unset, List[Dict[str, Any]]] = UNSET
41
+ if not isinstance(self.report_datasets, Unset):
42
+ report_datasets = []
43
+ for report_datasets_item_data in self.report_datasets:
44
+ report_datasets_item = report_datasets_item_data.to_dict()
45
+ report_datasets.append(report_datasets_item)
46
+
47
+ field_dict: Dict[str, Any] = {}
48
+ field_dict.update(self.additional_properties)
49
+ field_dict.update({})
50
+ if id is not UNSET:
51
+ field_dict["id"] = id
52
+ if report_header is not UNSET:
53
+ field_dict["report-header"] = report_header
54
+ if report_datasets is not UNSET:
55
+ field_dict["report-datasets"] = report_datasets
56
+
57
+ return field_dict
58
+
59
+ @classmethod
60
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
61
+ from ..models.counter_dataset_usage import COUNTERDatasetUsage
62
+ from ..models.sushi_report_header import SUSHIReportHeader
63
+
64
+ d = src_dict.copy()
65
+ id = d.pop("id", UNSET)
66
+
67
+ _report_header = d.pop("report-header", UNSET)
68
+ report_header: Union[Unset, SUSHIReportHeader]
69
+ if isinstance(_report_header, Unset):
70
+ report_header = UNSET
71
+ else:
72
+ report_header = SUSHIReportHeader.from_dict(_report_header)
73
+
74
+ report_datasets = []
75
+ _report_datasets = d.pop("report-datasets", UNSET)
76
+ for report_datasets_item_data in _report_datasets or []:
77
+ report_datasets_item = COUNTERDatasetUsage.from_dict(
78
+ report_datasets_item_data
79
+ )
80
+
81
+ report_datasets.append(report_datasets_item)
82
+
83
+ counter_dataset_report = cls(
84
+ id=id,
85
+ report_header=report_header,
86
+ report_datasets=report_datasets,
87
+ )
88
+
89
+ counter_dataset_report.additional_properties = d
90
+ return counter_dataset_report
91
+
92
+ @property
93
+ def additional_keys(self) -> List[str]:
94
+ return list(self.additional_properties.keys())
95
+
96
+ def __getitem__(self, key: str) -> Any:
97
+ return self.additional_properties[key]
98
+
99
+ def __setitem__(self, key: str, value: Any) -> None:
100
+ self.additional_properties[key] = value
101
+
102
+ def __delitem__(self, key: str) -> None:
103
+ del self.additional_properties[key]
104
+
105
+ def __contains__(self, key: str) -> bool:
106
+ return key in self.additional_properties