neurograph-core 1.202510081632__py3-none-any.whl → 1.202510092216__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 (29) hide show
  1. neurograph/v1/__init__.py +42 -0
  2. neurograph/v1/api/__init__.py +1 -0
  3. neurograph/v1/api/reporting_api.py +1739 -0
  4. neurograph/v1/models/__init__.py +20 -0
  5. neurograph/v1/models/knowledge_enrichment_artifact_create_request.py +3 -1
  6. neurograph/v1/models/reporting_affinities_response.py +89 -0
  7. neurograph/v1/models/reporting_chart_data.py +97 -0
  8. neurograph/v1/models/reporting_chart_dataset.py +93 -0
  9. neurograph/v1/models/reporting_chart_defaults.py +91 -0
  10. neurograph/v1/models/reporting_chart_options.py +93 -0
  11. neurograph/v1/models/reporting_content_config.py +113 -0
  12. neurograph/v1/models/reporting_customer_activity_response.py +89 -0
  13. neurograph/v1/models/reporting_daily_metric.py +95 -0
  14. neurograph/v1/models/reporting_daily_metrics_response.py +97 -0
  15. neurograph/v1/models/reporting_data_range.py +89 -0
  16. neurograph/v1/models/reporting_exploration_topic.py +91 -0
  17. neurograph/v1/models/reporting_header_config.py +89 -0
  18. neurograph/v1/models/reporting_meta_config.py +99 -0
  19. neurograph/v1/models/reporting_persona_activity_response.py +89 -0
  20. neurograph/v1/models/reporting_personas_response.py +89 -0
  21. neurograph/v1/models/reporting_primary_analysis.py +99 -0
  22. neurograph/v1/models/reporting_query.py +91 -0
  23. neurograph/v1/models/reporting_rich_insights_config.py +97 -0
  24. neurograph/v1/models/reporting_visualization.py +103 -0
  25. neurograph/v1/models/reporting_visualization_insights.py +91 -0
  26. {neurograph_core-1.202510081632.dist-info → neurograph_core-1.202510092216.dist-info}/METADATA +1 -1
  27. {neurograph_core-1.202510081632.dist-info → neurograph_core-1.202510092216.dist-info}/RECORD +29 -8
  28. {neurograph_core-1.202510081632.dist-info → neurograph_core-1.202510092216.dist-info}/WHEEL +0 -0
  29. {neurograph_core-1.202510081632.dist-info → neurograph_core-1.202510092216.dist-info}/top_level.txt +0 -0
@@ -182,6 +182,26 @@ from neurograph.v1.models.pgtype_infinity_modifier import PgtypeInfinityModifier
182
182
  from neurograph.v1.models.pgtype_int8 import PgtypeInt8
183
183
  from neurograph.v1.models.pgtype_text import PgtypeText
184
184
  from neurograph.v1.models.pgtype_timestamp import PgtypeTimestamp
185
+ from neurograph.v1.models.reporting_affinities_response import ReportingAffinitiesResponse
186
+ from neurograph.v1.models.reporting_chart_data import ReportingChartData
187
+ from neurograph.v1.models.reporting_chart_dataset import ReportingChartDataset
188
+ from neurograph.v1.models.reporting_chart_defaults import ReportingChartDefaults
189
+ from neurograph.v1.models.reporting_chart_options import ReportingChartOptions
190
+ from neurograph.v1.models.reporting_content_config import ReportingContentConfig
191
+ from neurograph.v1.models.reporting_customer_activity_response import ReportingCustomerActivityResponse
192
+ from neurograph.v1.models.reporting_daily_metric import ReportingDailyMetric
193
+ from neurograph.v1.models.reporting_daily_metrics_response import ReportingDailyMetricsResponse
194
+ from neurograph.v1.models.reporting_data_range import ReportingDataRange
195
+ from neurograph.v1.models.reporting_exploration_topic import ReportingExplorationTopic
196
+ from neurograph.v1.models.reporting_header_config import ReportingHeaderConfig
197
+ from neurograph.v1.models.reporting_meta_config import ReportingMetaConfig
198
+ from neurograph.v1.models.reporting_persona_activity_response import ReportingPersonaActivityResponse
199
+ from neurograph.v1.models.reporting_personas_response import ReportingPersonasResponse
200
+ from neurograph.v1.models.reporting_primary_analysis import ReportingPrimaryAnalysis
201
+ from neurograph.v1.models.reporting_query import ReportingQuery
202
+ from neurograph.v1.models.reporting_rich_insights_config import ReportingRichInsightsConfig
203
+ from neurograph.v1.models.reporting_visualization import ReportingVisualization
204
+ from neurograph.v1.models.reporting_visualization_insights import ReportingVisualizationInsights
185
205
  from neurograph.v1.models.workbench_workbench_url_check_request import WorkbenchWorkbenchUrlCheckRequest
186
206
  from neurograph.v1.models.workbench_workbench_url_check_response import WorkbenchWorkbenchUrlCheckResponse
187
207
  from neurograph.v1.models.workbench_workbench_version import WorkbenchWorkbenchVersion
@@ -26,6 +26,7 @@ class KnowledgeEnrichmentArtifactCreateRequest(BaseModel):
26
26
  """
27
27
  KnowledgeEnrichmentArtifactCreateRequest
28
28
  """ # noqa: E501
29
+ client_id: Optional[StrictStr] = None
29
30
  cloud_run_job_name: Optional[StrictStr] = None
30
31
  confidence: Optional[Union[StrictFloat, StrictInt]] = None
31
32
  config_entity_id: Optional[StrictStr] = None
@@ -41,7 +42,7 @@ class KnowledgeEnrichmentArtifactCreateRequest(BaseModel):
41
42
  supersedes_artifact_id: Optional[StrictInt] = None
42
43
  task_name: Optional[StrictStr] = None
43
44
  task_queue_name: Optional[StrictStr] = None
44
- __properties: ClassVar[List[str]] = ["cloud_run_job_name", "confidence", "config_entity_id", "config_snapshot", "input_params", "job_name", "kind", "output_json", "output_schema_id", "output_text", "spec_version", "subject_entity_id", "supersedes_artifact_id", "task_name", "task_queue_name"]
45
+ __properties: ClassVar[List[str]] = ["client_id", "cloud_run_job_name", "confidence", "config_entity_id", "config_snapshot", "input_params", "job_name", "kind", "output_json", "output_schema_id", "output_text", "spec_version", "subject_entity_id", "supersedes_artifact_id", "task_name", "task_queue_name"]
45
46
 
46
47
  model_config = ConfigDict(
47
48
  populate_by_name=True,
@@ -94,6 +95,7 @@ class KnowledgeEnrichmentArtifactCreateRequest(BaseModel):
94
95
  return cls.model_validate(obj)
95
96
 
96
97
  _obj = cls.model_validate({
98
+ "client_id": obj.get("client_id"),
97
99
  "cloud_run_job_name": obj.get("cloud_run_job_name"),
98
100
  "confidence": obj.get("confidence"),
99
101
  "config_entity_id": obj.get("config_entity_id"),
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neurograph Core
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ReportingAffinitiesResponse(BaseModel):
26
+ """
27
+ ReportingAffinitiesResponse
28
+ """ # noqa: E501
29
+ affinities: Optional[Dict[str, Any]] = None
30
+ error: Optional[StrictStr] = None
31
+ __properties: ClassVar[List[str]] = ["affinities", "error"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ReportingAffinitiesResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of ReportingAffinitiesResponse from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "affinities": obj.get("affinities"),
85
+ "error": obj.get("error")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neurograph Core
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neurograph.v1.models.reporting_chart_dataset import ReportingChartDataset
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ReportingChartData(BaseModel):
27
+ """
28
+ ReportingChartData
29
+ """ # noqa: E501
30
+ datasets: Optional[List[ReportingChartDataset]] = None
31
+ labels: Optional[List[StrictStr]] = None
32
+ __properties: ClassVar[List[str]] = ["datasets", "labels"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ReportingChartData from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in datasets (list)
74
+ _items = []
75
+ if self.datasets:
76
+ for _item_datasets in self.datasets:
77
+ if _item_datasets:
78
+ _items.append(_item_datasets.to_dict())
79
+ _dict['datasets'] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of ReportingChartData from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "datasets": [ReportingChartDataset.from_dict(_item) for _item in obj["datasets"]] if obj.get("datasets") is not None else None,
93
+ "labels": obj.get("labels")
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neurograph Core
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ReportingChartDataset(BaseModel):
26
+ """
27
+ ReportingChartDataset
28
+ """ # noqa: E501
29
+ background_color: Optional[StrictStr] = Field(default=None, alias="backgroundColor")
30
+ bar_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="barPercentage")
31
+ data: Optional[List[Union[StrictFloat, StrictInt]]] = None
32
+ label: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["backgroundColor", "barPercentage", "data", "label"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ReportingChartDataset from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of ReportingChartDataset from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "backgroundColor": obj.get("backgroundColor"),
87
+ "barPercentage": obj.get("barPercentage"),
88
+ "data": obj.get("data"),
89
+ "label": obj.get("label")
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neurograph Core
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neurograph.v1.models.reporting_chart_options import ReportingChartOptions
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ReportingChartDefaults(BaseModel):
27
+ """
28
+ ReportingChartDefaults
29
+ """ # noqa: E501
30
+ options: Optional[ReportingChartOptions] = None
31
+ __properties: ClassVar[List[str]] = ["options"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ReportingChartDefaults from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of options
73
+ if self.options:
74
+ _dict['options'] = self.options.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of ReportingChartDefaults from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "options": ReportingChartOptions.from_dict(obj["options"]) if obj.get("options") is not None else None
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neurograph Core
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ReportingChartOptions(BaseModel):
26
+ """
27
+ ReportingChartOptions
28
+ """ # noqa: E501
29
+ maintain_aspect_ratio: Optional[StrictBool] = Field(default=None, alias="maintainAspectRatio")
30
+ plugins: Optional[Dict[str, Dict[str, Any]]] = None
31
+ responsive: Optional[StrictBool] = None
32
+ scales: Optional[Dict[str, Dict[str, Any]]] = None
33
+ __properties: ClassVar[List[str]] = ["maintainAspectRatio", "plugins", "responsive", "scales"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ReportingChartOptions from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of ReportingChartOptions from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "maintainAspectRatio": obj.get("maintainAspectRatio"),
87
+ "plugins": obj.get("plugins"),
88
+ "responsive": obj.get("responsive"),
89
+ "scales": obj.get("scales")
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,113 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neurograph Core
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neurograph.v1.models.reporting_chart_defaults import ReportingChartDefaults
23
+ from neurograph.v1.models.reporting_header_config import ReportingHeaderConfig
24
+ from neurograph.v1.models.reporting_primary_analysis import ReportingPrimaryAnalysis
25
+ from neurograph.v1.models.reporting_visualization import ReportingVisualization
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class ReportingContentConfig(BaseModel):
30
+ """
31
+ ReportingContentConfig
32
+ """ # noqa: E501
33
+ chart_defaults: Optional[ReportingChartDefaults] = Field(default=None, alias="chartDefaults")
34
+ header: Optional[ReportingHeaderConfig] = None
35
+ primary_analysis: Optional[ReportingPrimaryAnalysis] = Field(default=None, alias="primaryAnalysis")
36
+ visualizations: Optional[List[ReportingVisualization]] = None
37
+ __properties: ClassVar[List[str]] = ["chartDefaults", "header", "primaryAnalysis", "visualizations"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of ReportingContentConfig from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of chart_defaults
79
+ if self.chart_defaults:
80
+ _dict['chartDefaults'] = self.chart_defaults.to_dict()
81
+ # override the default output from pydantic by calling `to_dict()` of header
82
+ if self.header:
83
+ _dict['header'] = self.header.to_dict()
84
+ # override the default output from pydantic by calling `to_dict()` of primary_analysis
85
+ if self.primary_analysis:
86
+ _dict['primaryAnalysis'] = self.primary_analysis.to_dict()
87
+ # override the default output from pydantic by calling `to_dict()` of each item in visualizations (list)
88
+ _items = []
89
+ if self.visualizations:
90
+ for _item_visualizations in self.visualizations:
91
+ if _item_visualizations:
92
+ _items.append(_item_visualizations.to_dict())
93
+ _dict['visualizations'] = _items
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of ReportingContentConfig from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "chartDefaults": ReportingChartDefaults.from_dict(obj["chartDefaults"]) if obj.get("chartDefaults") is not None else None,
107
+ "header": ReportingHeaderConfig.from_dict(obj["header"]) if obj.get("header") is not None else None,
108
+ "primaryAnalysis": ReportingPrimaryAnalysis.from_dict(obj["primaryAnalysis"]) if obj.get("primaryAnalysis") is not None else None,
109
+ "visualizations": [ReportingVisualization.from_dict(_item) for _item in obj["visualizations"]] if obj.get("visualizations") is not None else None
110
+ })
111
+ return _obj
112
+
113
+