neurograph-core 1.202508221357__py3-none-any.whl → 1.202509152210__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 (77) hide show
  1. neurograph/v1/__init__.py +315 -5
  2. neurograph/v1/api/__init__.py +29 -2
  3. neurograph/v1/api/client_api.py +541 -0
  4. neurograph/v1/api/dagster_api.py +271 -2
  5. neurograph/v1/api/knowledge_api.py +4426 -0
  6. neurograph/v1/api/knowledge_extract_api.py +1798 -0
  7. neurograph/v1/api/persona_api.py +263 -2
  8. neurograph/v1/api_client.py +4 -1
  9. neurograph/v1/models/__init__.py +224 -2
  10. neurograph/v1/models/{client_client_create_request.py → client_client_info.py} +11 -7
  11. neurograph/v1/models/client_client_metadata_response.py +14 -2
  12. neurograph/v1/models/{client_client_creat_response.py → client_client_url_row.py} +21 -25
  13. neurograph/v1/models/client_client_url_snapshot_response.py +95 -0
  14. neurograph/v1/models/client_client_url_snapshot_row.py +99 -0
  15. neurograph/v1/models/client_client_urls_response.py +3 -3
  16. neurograph/v1/models/client_organization_brand.py +107 -0
  17. neurograph/v1/models/client_organization_detail.py +115 -0
  18. neurograph/v1/models/client_probe.py +105 -0
  19. neurograph/v1/models/client_probe_todo_row.py +89 -0
  20. neurograph/v1/models/client_trigger_probe_response.py +101 -0
  21. neurograph/v1/models/client_workbench_config.py +99 -0
  22. neurograph/v1/models/dagster_dagster_info.py +95 -0
  23. neurograph/v1/models/{atlas_atlas_version_many_response.py → dagster_dagster_log_get_response.py} +7 -7
  24. neurograph/v1/models/db_knowledge_customer.py +97 -0
  25. neurograph/v1/models/db_knowledge_order.py +177 -0
  26. neurograph/v1/models/db_knowledge_product.py +107 -0
  27. neurograph/v1/models/db_knowledge_store.py +99 -0
  28. neurograph/v1/models/knowledge_assertion.py +111 -0
  29. neurograph/v1/models/knowledge_assertion_create_request.py +103 -0
  30. neurograph/v1/models/knowledge_assertion_list_response.py +103 -0
  31. neurograph/v1/models/knowledge_assertion_query.py +99 -0
  32. neurograph/v1/models/knowledge_assertion_response.py +93 -0
  33. neurograph/v1/models/knowledge_customer_query.py +99 -0
  34. neurograph/v1/models/knowledge_customer_response.py +103 -0
  35. neurograph/v1/models/knowledge_enrichment_artifact.py +137 -0
  36. neurograph/v1/models/knowledge_enrichment_artifact_create_request.py +113 -0
  37. neurograph/v1/models/knowledge_enrichment_artifact_list_response.py +103 -0
  38. neurograph/v1/models/knowledge_enrichment_artifact_response.py +93 -0
  39. neurograph/v1/models/knowledge_enrichment_artifact_update_output_request.py +93 -0
  40. neurograph/v1/models/knowledge_enrichment_artifact_update_status_request.py +99 -0
  41. neurograph/v1/models/knowledge_enrichment_query.py +99 -0
  42. neurograph/v1/models/knowledge_entity.py +115 -0
  43. neurograph/v1/models/knowledge_entity_create_request.py +95 -0
  44. neurograph/v1/models/knowledge_entity_create_response.py +99 -0
  45. neurograph/v1/models/knowledge_entity_extra.py +91 -0
  46. neurograph/v1/models/knowledge_entity_get_many_response.py +103 -0
  47. neurograph/v1/models/knowledge_entity_in_db.py +117 -0
  48. neurograph/v1/models/knowledge_entity_relations.py +91 -0
  49. neurograph/v1/models/knowledge_entity_schema.py +89 -0
  50. neurograph/v1/models/{atlas_atlas_version_response.py → knowledge_entity_schema_row.py} +16 -18
  51. neurograph/v1/models/{organizations_organization_set_atlas_response.py → knowledge_entity_schema_upsert_request.py} +14 -16
  52. neurograph/v1/models/knowledge_entity_schemas_response.py +97 -0
  53. neurograph/v1/models/{atlas_atlas_version.py → knowledge_entity_schemas_upsert_response.py} +11 -15
  54. neurograph/v1/models/{organizations_atlas_config.py → knowledge_entity_type_row.py} +14 -14
  55. neurograph/v1/models/knowledge_entity_upsert_request.py +95 -0
  56. neurograph/v1/models/{atlas_atlas_version_upsert_request.py → knowledge_entity_upsert_row.py} +10 -12
  57. neurograph/v1/models/knowledge_err_entity_row.py +89 -0
  58. neurograph/v1/models/knowledge_ingest_raw_request.py +95 -0
  59. neurograph/v1/models/knowledge_ingest_raw_response.py +101 -0
  60. neurograph/v1/models/knowledge_ingest_raw_row.py +97 -0
  61. neurograph/v1/models/{tasks_sync_from_firebase_result.py → knowledge_kind_response.py} +8 -6
  62. neurograph/v1/models/knowledge_order_query.py +129 -0
  63. neurograph/v1/models/knowledge_order_response.py +103 -0
  64. neurograph/v1/models/knowledge_product_query.py +101 -0
  65. neurograph/v1/models/knowledge_product_response.py +103 -0
  66. neurograph/v1/models/knowledge_query.py +95 -0
  67. neurograph/v1/models/knowledge_store_query.py +97 -0
  68. neurograph/v1/models/knowledge_store_response.py +103 -0
  69. neurograph/v1/models/knowledge_type_response.py +97 -0
  70. neurograph/v1/models/{organizations_organization_set_atlas_request.py → pgtype_int8.py} +10 -14
  71. neurograph/v1/models/pgtype_text.py +89 -0
  72. {neurograph_core-1.202508221357.dist-info → neurograph_core-1.202509152210.dist-info}/METADATA +2 -1
  73. {neurograph_core-1.202508221357.dist-info → neurograph_core-1.202509152210.dist-info}/RECORD +75 -25
  74. neurograph/v1/api/atlas_api.py +0 -588
  75. neurograph/v1/api/tasks_api.py +0 -286
  76. {neurograph_core-1.202508221357.dist-info → neurograph_core-1.202509152210.dist-info}/WHEEL +0 -0
  77. {neurograph_core-1.202508221357.dist-info → neurograph_core-1.202509152210.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,115 @@
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, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neurograph.v1.models.knowledge_entity_extra import KnowledgeEntityExtra
23
+ from neurograph.v1.models.knowledge_entity_relations import KnowledgeEntityRelations
24
+ from neurograph.v1.models.knowledge_entity_schema import KnowledgeEntitySchema
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class KnowledgeEntity(BaseModel):
29
+ """
30
+ KnowledgeEntity
31
+ """ # noqa: E501
32
+ client_id: Optional[StrictStr] = Field(default=None, description="nullable.")
33
+ data: Optional[Dict[str, Any]] = None
34
+ ext: Optional[KnowledgeEntityExtra] = None
35
+ extra: Optional[Dict[str, Any]] = None
36
+ kind: Optional[StrictStr] = None
37
+ name: Optional[StrictStr] = None
38
+ relations: Optional[KnowledgeEntityRelations] = None
39
+ var_schema: Optional[KnowledgeEntitySchema] = Field(default=None, alias="schema")
40
+ ts_updated: Optional[StrictInt] = None
41
+ __properties: ClassVar[List[str]] = ["client_id", "data", "ext", "extra", "kind", "name", "relations", "schema", "ts_updated"]
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of KnowledgeEntity from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ # override the default output from pydantic by calling `to_dict()` of ext
83
+ if self.ext:
84
+ _dict['ext'] = self.ext.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of relations
86
+ if self.relations:
87
+ _dict['relations'] = self.relations.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of var_schema
89
+ if self.var_schema:
90
+ _dict['schema'] = self.var_schema.to_dict()
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of KnowledgeEntity from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "client_id": obj.get("client_id"),
104
+ "data": obj.get("data"),
105
+ "ext": KnowledgeEntityExtra.from_dict(obj["ext"]) if obj.get("ext") is not None else None,
106
+ "extra": obj.get("extra"),
107
+ "kind": obj.get("kind"),
108
+ "name": obj.get("name"),
109
+ "relations": KnowledgeEntityRelations.from_dict(obj["relations"]) if obj.get("relations") is not None else None,
110
+ "schema": KnowledgeEntitySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None,
111
+ "ts_updated": obj.get("ts_updated")
112
+ })
113
+ return _obj
114
+
115
+
@@ -0,0 +1,95 @@
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.knowledge_entity import KnowledgeEntity
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class KnowledgeEntityCreateRequest(BaseModel):
27
+ """
28
+ KnowledgeEntityCreateRequest
29
+ """ # noqa: E501
30
+ data: Optional[List[KnowledgeEntity]] = None
31
+ __properties: ClassVar[List[str]] = ["data"]
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 KnowledgeEntityCreateRequest 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 each item in data (list)
73
+ _items = []
74
+ if self.data:
75
+ for _item_data in self.data:
76
+ if _item_data:
77
+ _items.append(_item_data.to_dict())
78
+ _dict['data'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of KnowledgeEntityCreateRequest from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "data": [KnowledgeEntity.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,99 @@
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, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neurograph.v1.models.knowledge_err_entity_row import KnowledgeErrEntityRow
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class KnowledgeEntityCreateResponse(BaseModel):
27
+ """
28
+ KnowledgeEntityCreateResponse
29
+ """ # noqa: E501
30
+ error: Optional[StrictStr] = None
31
+ error_rows: Optional[List[KnowledgeErrEntityRow]] = None
32
+ rows_created: Optional[StrictInt] = None
33
+ __properties: ClassVar[List[str]] = ["error", "error_rows", "rows_created"]
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 KnowledgeEntityCreateResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in error_rows (list)
75
+ _items = []
76
+ if self.error_rows:
77
+ for _item_error_rows in self.error_rows:
78
+ if _item_error_rows:
79
+ _items.append(_item_error_rows.to_dict())
80
+ _dict['error_rows'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of KnowledgeEntityCreateResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "error": obj.get("error"),
94
+ "error_rows": [KnowledgeErrEntityRow.from_dict(_item) for _item in obj["error_rows"]] if obj.get("error_rows") is not None else None,
95
+ "rows_created": obj.get("rows_created")
96
+ })
97
+ return _obj
98
+
99
+
@@ -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, StrictInt, 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 KnowledgeEntityExtra(BaseModel):
26
+ """
27
+ KnowledgeEntityExtra
28
+ """ # noqa: E501
29
+ customer_id: Optional[StrictInt] = None
30
+ domain: Optional[StrictStr] = None
31
+ product_id: Optional[StrictInt] = None
32
+ __properties: ClassVar[List[str]] = ["customer_id", "domain", "product_id"]
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 KnowledgeEntityExtra 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
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of KnowledgeEntityExtra from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "customer_id": obj.get("customer_id"),
86
+ "domain": obj.get("domain"),
87
+ "product_id": obj.get("product_id")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,103 @@
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.knowledge_entity_in_db import KnowledgeEntityInDb
23
+ from neurograph.v1.models.knowledge_query import KnowledgeQuery
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class KnowledgeEntityGetManyResponse(BaseModel):
28
+ """
29
+ KnowledgeEntityGetManyResponse
30
+ """ # noqa: E501
31
+ data: Optional[List[KnowledgeEntityInDb]] = None
32
+ error: Optional[StrictStr] = None
33
+ query: Optional[KnowledgeQuery] = None
34
+ __properties: ClassVar[List[str]] = ["data", "error", "query"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of KnowledgeEntityGetManyResponse from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of each item in data (list)
76
+ _items = []
77
+ if self.data:
78
+ for _item_data in self.data:
79
+ if _item_data:
80
+ _items.append(_item_data.to_dict())
81
+ _dict['data'] = _items
82
+ # override the default output from pydantic by calling `to_dict()` of query
83
+ if self.query:
84
+ _dict['query'] = self.query.to_dict()
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of KnowledgeEntityGetManyResponse from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "data": [KnowledgeEntityInDb.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
98
+ "error": obj.get("error"),
99
+ "query": KnowledgeQuery.from_dict(obj["query"]) if obj.get("query") is not None else None
100
+ })
101
+ return _obj
102
+
103
+
@@ -0,0 +1,117 @@
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, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neurograph.v1.models.knowledge_entity_extra import KnowledgeEntityExtra
23
+ from neurograph.v1.models.knowledge_entity_relations import KnowledgeEntityRelations
24
+ from neurograph.v1.models.knowledge_entity_schema import KnowledgeEntitySchema
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class KnowledgeEntityInDb(BaseModel):
29
+ """
30
+ KnowledgeEntityInDb
31
+ """ # noqa: E501
32
+ client_id: Optional[StrictStr] = Field(default=None, description="nullable.")
33
+ data: Optional[Dict[str, Any]] = None
34
+ ext: Optional[KnowledgeEntityExtra] = None
35
+ extra: Optional[Dict[str, Any]] = None
36
+ id: Optional[StrictStr] = None
37
+ kind: Optional[StrictStr] = None
38
+ name: Optional[StrictStr] = None
39
+ relations: Optional[KnowledgeEntityRelations] = None
40
+ var_schema: Optional[KnowledgeEntitySchema] = Field(default=None, alias="schema")
41
+ ts_updated: Optional[StrictInt] = None
42
+ __properties: ClassVar[List[str]] = ["client_id", "data", "ext", "extra", "id", "kind", "name", "relations", "schema", "ts_updated"]
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of KnowledgeEntityInDb from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ # override the default output from pydantic by calling `to_dict()` of ext
84
+ if self.ext:
85
+ _dict['ext'] = self.ext.to_dict()
86
+ # override the default output from pydantic by calling `to_dict()` of relations
87
+ if self.relations:
88
+ _dict['relations'] = self.relations.to_dict()
89
+ # override the default output from pydantic by calling `to_dict()` of var_schema
90
+ if self.var_schema:
91
+ _dict['schema'] = self.var_schema.to_dict()
92
+ return _dict
93
+
94
+ @classmethod
95
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96
+ """Create an instance of KnowledgeEntityInDb from a dict"""
97
+ if obj is None:
98
+ return None
99
+
100
+ if not isinstance(obj, dict):
101
+ return cls.model_validate(obj)
102
+
103
+ _obj = cls.model_validate({
104
+ "client_id": obj.get("client_id"),
105
+ "data": obj.get("data"),
106
+ "ext": KnowledgeEntityExtra.from_dict(obj["ext"]) if obj.get("ext") is not None else None,
107
+ "extra": obj.get("extra"),
108
+ "id": obj.get("id"),
109
+ "kind": obj.get("kind"),
110
+ "name": obj.get("name"),
111
+ "relations": KnowledgeEntityRelations.from_dict(obj["relations"]) if obj.get("relations") is not None else None,
112
+ "schema": KnowledgeEntitySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None,
113
+ "ts_updated": obj.get("ts_updated")
114
+ })
115
+ return _obj
116
+
117
+