finatic-server-python 1.0.6__py3-none-any.whl → 1.0.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: finatic-server-python
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Python SDK for Finatic Server API
5
5
  Project-URL: Homepage, https://github.com/FinaticORG/FinaticServerSDK-Python
6
6
  Project-URL: Documentation, https://docs.finatic.com/python
@@ -153,7 +153,6 @@ src/openapi/finatic_server/models/finatic_response_fdx_broker_order.py,sha256=0e
153
153
  src/openapi/finatic_server/models/finatic_response_fdx_broker_order_command_result.py,sha256=LV7v3Rj5lCfggpiwmlS5nmROVIL-hRgX6nqOvB1uROk,4046
154
154
  src/openapi/finatic_server/models/finatic_response_fdx_consent_grant.py,sha256=aufgX-guN_ZyyKf7-t3_tOztDaILE0_z45xe-PyABVM,4812
155
155
  src/openapi/finatic_server/models/finatic_response_fdx_webhook_subscription.py,sha256=SJKv6Lh1GSPz2jIk7iHrCXNL4oYjSP5IOoogMep51q4,4870
156
- src/openapi/finatic_server/models/finatic_response_link_user_to_mcp_session_response.py,sha256=sJsi_M5JRT7QA1YMt_M5vd2UR4wbiBHOZ_2dqCKGINM,4324
157
156
  src/openapi/finatic_server/models/finatic_response_link_user_to_session_response.py,sha256=uv4fGADv-NEIpstcmyRYY0-aDyqZANVuNpKmhfxdDB8,4299
158
157
  src/openapi/finatic_server/models/finatic_response_list_connector_list_item.py,sha256=MPX8o2sWFh-cNAUneKhbKXMBDN-_4JgxmIfKdrOj5TE,4266
159
158
  src/openapi/finatic_server/models/finatic_response_list_dict_str_any.py,sha256=4zGdF9lIZZ6Ild3ISr7L4zvNimqfvS0RKhA7Wn44skk,3941
@@ -199,13 +198,10 @@ src/openapi/finatic_server/models/instrumentid.py,sha256=nPGVRvLB47eSxlUPPswL0ku
199
198
  src/openapi/finatic_server/models/ioctif.py,sha256=hwzXHfJQyvqPigpg0i7m6QTBRhs83ZKV3jKj3-iqUrc,2755
200
199
  src/openapi/finatic_server/models/lastsyncedat.py,sha256=wJY9Umjb3MSmIqmwN90fR6v3OqiAEzLrXd92o10CCSk,4913
201
200
  src/openapi/finatic_server/models/limitprice.py,sha256=IKn9lxNP_q5bkY4pH8M4gWXxjqO9jiOl-VkYaIwzSGU,4895
202
- src/openapi/finatic_server/models/link_user_to_mcp_session_request.py,sha256=imVwvKJUbYAR_s1TFJy4aE1xiEG3_Zbgxv_KEp2-wGI,2595
203
- src/openapi/finatic_server/models/link_user_to_mcp_session_response.py,sha256=vFRUBaDIL6zITSP4zd2IbK6W0DnSIc-n_QMEuWZ53SI,2772
204
201
  src/openapi/finatic_server/models/link_user_to_session_response.py,sha256=pfDkGaNvzsMqpiq9-iay9YOEoceHeUM2bduOPi41xts,2971
205
202
  src/openapi/finatic_server/models/location_inner.py,sha256=v_PaJLz7NhhvY-WVwbJuxgO_R0aQlJUzr5iD_3L1s2g,4754
206
203
  src/openapi/finatic_server/models/maintenancemargin.py,sha256=ufuaGoa9Dcbk17NpUofi5q6DnVugGILyOWcQtb6JIHA,5002
207
204
  src/openapi/finatic_server/models/marketvalue.py,sha256=aPw6o99eHFA5G0xjd2poXCF-w25Dnb0KHxymKnNh1Wk,4909
208
- src/openapi/finatic_server/models/mcp_bootstrap_request.py,sha256=DN6f-e-EuUoNmilvXFnhp_6Hx1FTyTRt8KIzLuLzHZg,2794
209
205
  src/openapi/finatic_server/models/mt_connect_request.py,sha256=s3ACqF8EqtN514orVIcwAM-KUJcSe-Ngd3AZ-SKhFj4,3928
210
206
  src/openapi/finatic_server/models/multi_step_auth_response.py,sha256=nm8gR41I5e4S5tHVpxdC9J2N5H7XZBPapIvePZDmGEQ,4092
211
207
  src/openapi/finatic_server/models/netliquidationvalue.py,sha256=kvK_DDPsEpMvXw-joAZ0NO6LwbCprWoZNknZ6ZuvLLo,5015
@@ -345,7 +341,6 @@ src/openapi/finatic_server/models/success_payload_fdx_broker_order.py,sha256=EFx
345
341
  src/openapi/finatic_server/models/success_payload_fdx_broker_order_command_result.py,sha256=-Aj3uAGSpcpx-Q7U7OLuRfZmGhfWvWSkkpiLjShpIeM,3472
346
342
  src/openapi/finatic_server/models/success_payload_fdx_consent_grant.py,sha256=eHU7_FAPScxcVHUYGjgWso8rxtoPw9-cyYljTodTlpE,4117
347
343
  src/openapi/finatic_server/models/success_payload_fdx_webhook_subscription.py,sha256=8K8npr-nr9GjoNzR6bXff9XK9D1WqgTf6a6-jzjmoMY,4175
348
- src/openapi/finatic_server/models/success_payload_link_user_to_mcp_session_response.py,sha256=Berrpl9QRzPxwO64WqjM37eYpJbS_L9nU44EjZpchhA,3629
349
344
  src/openapi/finatic_server/models/success_payload_link_user_to_session_response.py,sha256=40mmKfG3BsvZnuxjoiE8l_9O_Jd8dBW1eeRBoHiXOsg,3604
350
345
  src/openapi/finatic_server/models/success_payload_list_connector_list_item.py,sha256=pR0wwbTD-iel_bIo62rcpAzdy4L07NMGDWyxnMl1AI8,3736
351
346
  src/openapi/finatic_server/models/success_payload_list_dict_str_any.py,sha256=1AKVPSVGvaexyAFPHZl9RZEurFaeeB_9PyJKd8Dpxxc,3090
@@ -449,7 +444,7 @@ src/utils/request_id.py,sha256=R_Gcyc5rih7_keAruJHW0bg0Y0MCqQNsUgkZ4C_9sRc,200
449
444
  src/utils/url_utils.py,sha256=dtxaFEF6Li_lQ7ft0BEDsbyYUDcNXUN4WO_yVAG5MJ8,5051
450
445
  src/utils/validation.py,sha256=ODt5raui4KVH1Iz_-Tt8-VKEw-yUzIZg6o93iWLwRj0,1263
451
446
  src/wrappers/__init__.py,sha256=8puRg8uOrUR42gCwCtW5zkOtCDbgyMpZSMi2iz2bPcU,123
452
- finatic_server_python-1.0.6.dist-info/METADATA,sha256=UdC63o4AMFNgGS5YDzLknB4K5ZnnRx-j7J1xknc84lk,7725
453
- finatic_server_python-1.0.6.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
454
- finatic_server_python-1.0.6.dist-info/licenses/LICENSE,sha256=hE35tOCe7uZCeYglYc-sjRSjad4jPyB3i53-QW1YfLk,3590
455
- finatic_server_python-1.0.6.dist-info/RECORD,,
447
+ finatic_server_python-1.0.7.dist-info/METADATA,sha256=GIcI0ZxwpViIuefxxxK90iUGT9SuMehZj4lBBn2J_5c,7725
448
+ finatic_server_python-1.0.7.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
449
+ finatic_server_python-1.0.7.dist-info/licenses/LICENSE,sha256=hE35tOCe7uZCeYglYc-sjRSjad4jPyB3i53-QW1YfLk,3590
450
+ finatic_server_python-1.0.7.dist-info/RECORD,,
@@ -1,111 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Finatic FastAPI Backend
5
-
6
- FinaticAPI REST API
7
-
8
- The version of the OpenAPI document: 1.0.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, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from finatic_server.models.success_payload_link_user_to_mcp_session_response import SuccessPayloadLinkUserToMCPSessionResponse
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
- from pydantic_core import to_jsonable_python
26
-
27
- class FinaticResponseLinkUserToMCPSessionResponse(BaseModel):
28
- """
29
- FinaticResponseLinkUserToMCPSessionResponse
30
- """ # noqa: E501
31
- error: Optional[Dict[str, Any]] = Field(default=None, description="Optional error object with message, code, status, and details")
32
- success: Optional[SuccessPayloadLinkUserToMCPSessionResponse] = Field(default=None, description="Success payload containing data and optional meta. None when error is present.")
33
- trace_id: Optional[StrictStr] = Field(default='', description="Request trace identifier for tracking and debugging. Auto-generated if not provided.")
34
- warning: Optional[List[Dict[str, Any]]] = Field(default=None, description="Optional array of warning objects")
35
- __properties: ClassVar[List[str]] = ["error", "success", "trace_id", "warning"]
36
-
37
- model_config = ConfigDict(
38
- validate_by_name=True,
39
- validate_by_alias=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- return json.dumps(to_jsonable_python(self.to_dict()))
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of FinaticResponseLinkUserToMCPSessionResponse from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([
69
- ])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of success
77
- if self.success:
78
- _dict['success'] = self.success.to_dict()
79
- # set to None if error (nullable) is None
80
- # and model_fields_set contains the field
81
- if self.error is None and "error" in self.model_fields_set:
82
- _dict['error'] = None
83
-
84
- # set to None if success (nullable) is None
85
- # and model_fields_set contains the field
86
- if self.success is None and "success" in self.model_fields_set:
87
- _dict['success'] = None
88
-
89
- # set to None if warning (nullable) is None
90
- # and model_fields_set contains the field
91
- if self.warning is None and "warning" in self.model_fields_set:
92
- _dict['warning'] = None
93
-
94
- return _dict
95
-
96
- @classmethod
97
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
- """Create an instance of FinaticResponseLinkUserToMCPSessionResponse 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
- "error": obj.get("error"),
107
- "success": SuccessPayloadLinkUserToMCPSessionResponse.from_dict(obj["success"]) if obj.get("success") is not None else None,
108
- "trace_id": obj.get("trace_id") if obj.get("trace_id") is not None else '',
109
- "warning": obj.get("warning")
110
- })
111
- return _obj
@@ -1,88 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Finatic FastAPI Backend
5
-
6
- FinaticAPI REST API
7
-
8
- The version of the OpenAPI document: 1.0.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
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
- from pydantic_core import to_jsonable_python
25
-
26
- class LinkUserToMCPSessionRequest(BaseModel):
27
- """
28
- Request model for linking user to MCP session.
29
- """ # noqa: E501
30
- link_context_id: StrictStr
31
- user_id: StrictStr
32
- __properties: ClassVar[List[str]] = ["link_context_id", "user_id"]
33
-
34
- model_config = ConfigDict(
35
- validate_by_name=True,
36
- validate_by_alias=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
- return json.dumps(to_jsonable_python(self.to_dict()))
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of LinkUserToMCPSessionRequest 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 LinkUserToMCPSessionRequest 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
- "link_context_id": obj.get("link_context_id"),
86
- "user_id": obj.get("user_id")
87
- })
88
- return _obj
@@ -1,90 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Finatic FastAPI Backend
5
-
6
- FinaticAPI REST API
7
-
8
- The version of the OpenAPI document: 1.0.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, StrictBool, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
- from pydantic_core import to_jsonable_python
25
-
26
- class LinkUserToMCPSessionResponse(BaseModel):
27
- """
28
- MCP link completion response model.
29
- """ # noqa: E501
30
- linked_user_id: StrictStr
31
- mcp_session_id: StrictStr
32
- success: Optional[StrictBool] = True
33
- __properties: ClassVar[List[str]] = ["linked_user_id", "mcp_session_id", "success"]
34
-
35
- model_config = ConfigDict(
36
- validate_by_name=True,
37
- validate_by_alias=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
- return json.dumps(to_jsonable_python(self.to_dict()))
50
-
51
- @classmethod
52
- def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of LinkUserToMCPSessionResponse 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 LinkUserToMCPSessionResponse 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
- "linked_user_id": obj.get("linked_user_id"),
87
- "mcp_session_id": obj.get("mcp_session_id"),
88
- "success": obj.get("success") if obj.get("success") is not None else True
89
- })
90
- return _obj
@@ -1,91 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Finatic FastAPI Backend
5
-
6
- FinaticAPI REST API
7
-
8
- The version of the OpenAPI document: 1.0.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, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
- from pydantic_core import to_jsonable_python
25
-
26
- class MCPBootstrapRequest(BaseModel):
27
- """
28
- Request model for MCP bearer bootstrap.
29
- """ # noqa: E501
30
- scopes: Optional[List[StrictStr]] = Field(default=None, description="Optional MCP scopes to request. Defaults to all supported scopes.")
31
- __properties: ClassVar[List[str]] = ["scopes"]
32
-
33
- model_config = ConfigDict(
34
- validate_by_name=True,
35
- validate_by_alias=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
- return json.dumps(to_jsonable_python(self.to_dict()))
48
-
49
- @classmethod
50
- def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of MCPBootstrapRequest 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
- # set to None if scopes (nullable) is None
73
- # and model_fields_set contains the field
74
- if self.scopes is None and "scopes" in self.model_fields_set:
75
- _dict['scopes'] = None
76
-
77
- return _dict
78
-
79
- @classmethod
80
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
- """Create an instance of MCPBootstrapRequest from a dict"""
82
- if obj is None:
83
- return None
84
-
85
- if not isinstance(obj, dict):
86
- return cls.model_validate(obj)
87
-
88
- _obj = cls.model_validate({
89
- "scopes": obj.get("scopes")
90
- })
91
- return _obj
@@ -1,104 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Finatic FastAPI Backend
5
-
6
- FinaticAPI REST API
7
-
8
- The version of the OpenAPI document: 1.0.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, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from finatic_server.models.link_user_to_mcp_session_response import LinkUserToMCPSessionResponse
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
- from pydantic_core import to_jsonable_python
26
-
27
- class SuccessPayloadLinkUserToMCPSessionResponse(BaseModel):
28
- """
29
- SuccessPayloadLinkUserToMCPSessionResponse
30
- """ # noqa: E501
31
- id: Optional[StrictStr] = Field(default=None, alias="_id")
32
- data: Optional[LinkUserToMCPSessionResponse] = Field(default=None, description="The response data (None when error is present)")
33
- meta: Optional[Dict[str, Any]] = Field(default=None, description="Optional metadata (pagination, etc.)")
34
- __properties: ClassVar[List[str]] = ["_id", "data", "meta"]
35
-
36
- model_config = ConfigDict(
37
- validate_by_name=True,
38
- validate_by_alias=True,
39
- validate_assignment=True,
40
- protected_namespaces=(),
41
- )
42
-
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- return json.dumps(to_jsonable_python(self.to_dict()))
51
-
52
- @classmethod
53
- def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of SuccessPayloadLinkUserToMCPSessionResponse 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 data
76
- if self.data:
77
- _dict['data'] = self.data.to_dict()
78
- # set to None if data (nullable) is None
79
- # and model_fields_set contains the field
80
- if self.data is None and "data" in self.model_fields_set:
81
- _dict['data'] = None
82
-
83
- # set to None if meta (nullable) is None
84
- # and model_fields_set contains the field
85
- if self.meta is None and "meta" in self.model_fields_set:
86
- _dict['meta'] = None
87
-
88
- return _dict
89
-
90
- @classmethod
91
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
- """Create an instance of SuccessPayloadLinkUserToMCPSessionResponse from a dict"""
93
- if obj is None:
94
- return None
95
-
96
- if not isinstance(obj, dict):
97
- return cls.model_validate(obj)
98
-
99
- _obj = cls.model_validate({
100
- "_id": obj.get("_id"),
101
- "data": LinkUserToMCPSessionResponse.from_dict(obj["data"]) if obj.get("data") is not None else None,
102
- "meta": obj.get("meta")
103
- })
104
- return _obj