robosystems-client 0.1.11__py3-none-any.whl → 0.1.13__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.

Potentially problematic release.


This version of robosystems-client might be problematic. Click here for more details.

Files changed (69) hide show
  1. robosystems_client/api/agent/query_financial_agent.py +4 -4
  2. robosystems_client/api/backup/create_backup.py +1 -1
  3. robosystems_client/api/backup/export_backup.py +14 -19
  4. robosystems_client/api/backup/get_backup_download_url.py +1 -1
  5. robosystems_client/api/backup/get_backup_stats.py +19 -1
  6. robosystems_client/api/backup/list_backups.py +19 -1
  7. robosystems_client/api/backup/restore_backup.py +1 -1
  8. robosystems_client/api/copy/copy_data_to_graph.py +314 -0
  9. robosystems_client/api/{credits_ → graph_credits}/check_credit_balance.py +42 -20
  10. robosystems_client/api/graph_health/__init__.py +1 -0
  11. robosystems_client/api/{graph_status → graph_health}/get_database_health.py +1 -1
  12. robosystems_client/api/graph_info/__init__.py +1 -0
  13. robosystems_client/api/{graph_status → graph_info}/get_database_info.py +1 -1
  14. robosystems_client/api/graph_limits/__init__.py +1 -0
  15. robosystems_client/api/graph_limits/get_graph_limits.py +259 -0
  16. robosystems_client/api/subgraphs/__init__.py +1 -0
  17. robosystems_client/api/{billing/upgrade_graph_subscription_v1_graph_id_billing_subscription_upgrade_post.py → subgraphs/create_subgraph.py} +82 -36
  18. robosystems_client/api/subgraphs/delete_subgraph.py +317 -0
  19. robosystems_client/api/subgraphs/get_subgraph_info.py +300 -0
  20. robosystems_client/api/subgraphs/get_subgraph_quota.py +276 -0
  21. robosystems_client/api/{billing/get_credit_billing_info_v1_graph_id_billing_credits_get.py → subgraphs/list_subgraphs.py} +58 -32
  22. robosystems_client/api/user/get_all_credit_summaries.py +1 -1
  23. robosystems_client/extensions/README.md +2 -6
  24. robosystems_client/models/__init__.py +46 -10
  25. robosystems_client/models/copy_response.py +223 -0
  26. robosystems_client/models/{kuzu_backup_health_response_kuzubackuphealth.py → copy_response_error_details_type_0.py} +5 -5
  27. robosystems_client/models/copy_response_status.py +10 -0
  28. robosystems_client/models/create_subgraph_request.py +185 -0
  29. robosystems_client/models/create_subgraph_request_metadata_type_0.py +44 -0
  30. robosystems_client/models/credit_summary_response.py +0 -8
  31. robosystems_client/models/custom_schema_definition.py +2 -2
  32. robosystems_client/models/data_frame_copy_request.py +125 -0
  33. robosystems_client/models/data_frame_copy_request_format.py +10 -0
  34. robosystems_client/models/delete_subgraph_request.py +89 -0
  35. robosystems_client/models/delete_subgraph_response.py +120 -0
  36. robosystems_client/models/get_graph_limits_response_getgraphlimits.py +44 -0
  37. robosystems_client/models/list_subgraphs_response.py +148 -0
  38. robosystems_client/models/s3_copy_request.py +375 -0
  39. robosystems_client/models/s3_copy_request_file_format.py +12 -0
  40. robosystems_client/models/s3_copy_request_s3_url_style_type_0.py +9 -0
  41. robosystems_client/models/subgraph_quota_response.py +158 -0
  42. robosystems_client/models/subgraph_response.py +279 -0
  43. robosystems_client/models/subgraph_response_metadata_type_0.py +44 -0
  44. robosystems_client/models/subgraph_summary.py +155 -0
  45. robosystems_client/models/subgraph_type.py +11 -0
  46. robosystems_client/models/url_copy_request.py +157 -0
  47. robosystems_client/models/url_copy_request_file_format.py +10 -0
  48. robosystems_client/models/url_copy_request_headers_type_0.py +44 -0
  49. {robosystems_client-0.1.11.dist-info → robosystems_client-0.1.13.dist-info}/METADATA +1 -1
  50. {robosystems_client-0.1.11.dist-info → robosystems_client-0.1.13.dist-info}/RECORD +62 -39
  51. robosystems_client/api/backup/kuzu_backup_health.py +0 -202
  52. robosystems_client/api/billing/get_available_subscription_plans_v1_graph_id_billing_available_plans_get.py +0 -198
  53. robosystems_client/api/billing/get_graph_pricing_info_v1_graph_id_billing_pricing_get.py +0 -198
  54. robosystems_client/api/billing/get_graph_subscription_v1_graph_id_billing_subscription_get.py +0 -198
  55. robosystems_client/models/backup_export_request.py +0 -72
  56. robosystems_client/models/credit_check_request.py +0 -82
  57. robosystems_client/models/upgrade_subscription_request.py +0 -82
  58. /robosystems_client/api/{billing → copy}/__init__.py +0 -0
  59. /robosystems_client/api/{credits_ → graph_billing}/__init__.py +0 -0
  60. /robosystems_client/api/{billing → graph_billing}/get_current_graph_bill.py +0 -0
  61. /robosystems_client/api/{billing → graph_billing}/get_graph_billing_history.py +0 -0
  62. /robosystems_client/api/{billing → graph_billing}/get_graph_monthly_bill.py +0 -0
  63. /robosystems_client/api/{billing → graph_billing}/get_graph_usage_details.py +0 -0
  64. /robosystems_client/api/{graph_status → graph_credits}/__init__.py +0 -0
  65. /robosystems_client/api/{credits_ → graph_credits}/check_storage_limits.py +0 -0
  66. /robosystems_client/api/{credits_ → graph_credits}/get_credit_summary.py +0 -0
  67. /robosystems_client/api/{credits_ → graph_credits}/get_storage_usage.py +0 -0
  68. /robosystems_client/api/{credits_ → graph_credits}/list_credit_transactions.py +0 -0
  69. {robosystems_client-0.1.11.dist-info → robosystems_client-0.1.13.dist-info}/WHEEL +0 -0
@@ -1,198 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.http_validation_error import HTTPValidationError
9
- from ...types import UNSET, Response, Unset
10
-
11
-
12
- def _get_kwargs(
13
- graph_id: str,
14
- *,
15
- authorization: Union[None, Unset, str] = UNSET,
16
- auth_token: Union[None, Unset, str] = UNSET,
17
- ) -> dict[str, Any]:
18
- headers: dict[str, Any] = {}
19
- if not isinstance(authorization, Unset):
20
- headers["authorization"] = authorization
21
-
22
- cookies = {}
23
- if auth_token is not UNSET:
24
- cookies["auth-token"] = auth_token
25
-
26
- _kwargs: dict[str, Any] = {
27
- "method": "get",
28
- "url": f"/v1/{graph_id}/billing/pricing",
29
- "cookies": cookies,
30
- }
31
-
32
- _kwargs["headers"] = headers
33
- return _kwargs
34
-
35
-
36
- def _parse_response(
37
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
38
- ) -> Optional[Union[Any, HTTPValidationError]]:
39
- if response.status_code == 200:
40
- response_200 = response.json()
41
- return response_200
42
- if response.status_code == 422:
43
- response_422 = HTTPValidationError.from_dict(response.json())
44
-
45
- return response_422
46
- if client.raise_on_unexpected_status:
47
- raise errors.UnexpectedStatus(response.status_code, response.content)
48
- else:
49
- return None
50
-
51
-
52
- def _build_response(
53
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
54
- ) -> Response[Union[Any, HTTPValidationError]]:
55
- return Response(
56
- status_code=HTTPStatus(response.status_code),
57
- content=response.content,
58
- headers=response.headers,
59
- parsed=_parse_response(client=client, response=response),
60
- )
61
-
62
-
63
- def sync_detailed(
64
- graph_id: str,
65
- *,
66
- client: AuthenticatedClient,
67
- authorization: Union[None, Unset, str] = UNSET,
68
- auth_token: Union[None, Unset, str] = UNSET,
69
- ) -> Response[Union[Any, HTTPValidationError]]:
70
- """Get Graph Pricing Info
71
-
72
- Get pricing information for a specific graph database.
73
-
74
- Args:
75
- graph_id (str): Graph database ID
76
- authorization (Union[None, Unset, str]):
77
- auth_token (Union[None, Unset, str]):
78
-
79
- Raises:
80
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
- httpx.TimeoutException: If the request takes longer than Client.timeout.
82
-
83
- Returns:
84
- Response[Union[Any, HTTPValidationError]]
85
- """
86
-
87
- kwargs = _get_kwargs(
88
- graph_id=graph_id,
89
- authorization=authorization,
90
- auth_token=auth_token,
91
- )
92
-
93
- response = client.get_httpx_client().request(
94
- **kwargs,
95
- )
96
-
97
- return _build_response(client=client, response=response)
98
-
99
-
100
- def sync(
101
- graph_id: str,
102
- *,
103
- client: AuthenticatedClient,
104
- authorization: Union[None, Unset, str] = UNSET,
105
- auth_token: Union[None, Unset, str] = UNSET,
106
- ) -> Optional[Union[Any, HTTPValidationError]]:
107
- """Get Graph Pricing Info
108
-
109
- Get pricing information for a specific graph database.
110
-
111
- Args:
112
- graph_id (str): Graph database ID
113
- authorization (Union[None, Unset, str]):
114
- auth_token (Union[None, Unset, str]):
115
-
116
- Raises:
117
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
- httpx.TimeoutException: If the request takes longer than Client.timeout.
119
-
120
- Returns:
121
- Union[Any, HTTPValidationError]
122
- """
123
-
124
- return sync_detailed(
125
- graph_id=graph_id,
126
- client=client,
127
- authorization=authorization,
128
- auth_token=auth_token,
129
- ).parsed
130
-
131
-
132
- async def asyncio_detailed(
133
- graph_id: str,
134
- *,
135
- client: AuthenticatedClient,
136
- authorization: Union[None, Unset, str] = UNSET,
137
- auth_token: Union[None, Unset, str] = UNSET,
138
- ) -> Response[Union[Any, HTTPValidationError]]:
139
- """Get Graph Pricing Info
140
-
141
- Get pricing information for a specific graph database.
142
-
143
- Args:
144
- graph_id (str): Graph database ID
145
- authorization (Union[None, Unset, str]):
146
- auth_token (Union[None, Unset, str]):
147
-
148
- Raises:
149
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150
- httpx.TimeoutException: If the request takes longer than Client.timeout.
151
-
152
- Returns:
153
- Response[Union[Any, HTTPValidationError]]
154
- """
155
-
156
- kwargs = _get_kwargs(
157
- graph_id=graph_id,
158
- authorization=authorization,
159
- auth_token=auth_token,
160
- )
161
-
162
- response = await client.get_async_httpx_client().request(**kwargs)
163
-
164
- return _build_response(client=client, response=response)
165
-
166
-
167
- async def asyncio(
168
- graph_id: str,
169
- *,
170
- client: AuthenticatedClient,
171
- authorization: Union[None, Unset, str] = UNSET,
172
- auth_token: Union[None, Unset, str] = UNSET,
173
- ) -> Optional[Union[Any, HTTPValidationError]]:
174
- """Get Graph Pricing Info
175
-
176
- Get pricing information for a specific graph database.
177
-
178
- Args:
179
- graph_id (str): Graph database ID
180
- authorization (Union[None, Unset, str]):
181
- auth_token (Union[None, Unset, str]):
182
-
183
- Raises:
184
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
185
- httpx.TimeoutException: If the request takes longer than Client.timeout.
186
-
187
- Returns:
188
- Union[Any, HTTPValidationError]
189
- """
190
-
191
- return (
192
- await asyncio_detailed(
193
- graph_id=graph_id,
194
- client=client,
195
- authorization=authorization,
196
- auth_token=auth_token,
197
- )
198
- ).parsed
@@ -1,198 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.http_validation_error import HTTPValidationError
9
- from ...types import UNSET, Response, Unset
10
-
11
-
12
- def _get_kwargs(
13
- graph_id: str,
14
- *,
15
- authorization: Union[None, Unset, str] = UNSET,
16
- auth_token: Union[None, Unset, str] = UNSET,
17
- ) -> dict[str, Any]:
18
- headers: dict[str, Any] = {}
19
- if not isinstance(authorization, Unset):
20
- headers["authorization"] = authorization
21
-
22
- cookies = {}
23
- if auth_token is not UNSET:
24
- cookies["auth-token"] = auth_token
25
-
26
- _kwargs: dict[str, Any] = {
27
- "method": "get",
28
- "url": f"/v1/{graph_id}/billing/subscription",
29
- "cookies": cookies,
30
- }
31
-
32
- _kwargs["headers"] = headers
33
- return _kwargs
34
-
35
-
36
- def _parse_response(
37
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
38
- ) -> Optional[Union[Any, HTTPValidationError]]:
39
- if response.status_code == 200:
40
- response_200 = response.json()
41
- return response_200
42
- if response.status_code == 422:
43
- response_422 = HTTPValidationError.from_dict(response.json())
44
-
45
- return response_422
46
- if client.raise_on_unexpected_status:
47
- raise errors.UnexpectedStatus(response.status_code, response.content)
48
- else:
49
- return None
50
-
51
-
52
- def _build_response(
53
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
54
- ) -> Response[Union[Any, HTTPValidationError]]:
55
- return Response(
56
- status_code=HTTPStatus(response.status_code),
57
- content=response.content,
58
- headers=response.headers,
59
- parsed=_parse_response(client=client, response=response),
60
- )
61
-
62
-
63
- def sync_detailed(
64
- graph_id: str,
65
- *,
66
- client: AuthenticatedClient,
67
- authorization: Union[None, Unset, str] = UNSET,
68
- auth_token: Union[None, Unset, str] = UNSET,
69
- ) -> Response[Union[Any, HTTPValidationError]]:
70
- """Get Graph Subscription
71
-
72
- Get current subscription for a graph database.
73
-
74
- Args:
75
- graph_id (str): Graph database ID
76
- authorization (Union[None, Unset, str]):
77
- auth_token (Union[None, Unset, str]):
78
-
79
- Raises:
80
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
- httpx.TimeoutException: If the request takes longer than Client.timeout.
82
-
83
- Returns:
84
- Response[Union[Any, HTTPValidationError]]
85
- """
86
-
87
- kwargs = _get_kwargs(
88
- graph_id=graph_id,
89
- authorization=authorization,
90
- auth_token=auth_token,
91
- )
92
-
93
- response = client.get_httpx_client().request(
94
- **kwargs,
95
- )
96
-
97
- return _build_response(client=client, response=response)
98
-
99
-
100
- def sync(
101
- graph_id: str,
102
- *,
103
- client: AuthenticatedClient,
104
- authorization: Union[None, Unset, str] = UNSET,
105
- auth_token: Union[None, Unset, str] = UNSET,
106
- ) -> Optional[Union[Any, HTTPValidationError]]:
107
- """Get Graph Subscription
108
-
109
- Get current subscription for a graph database.
110
-
111
- Args:
112
- graph_id (str): Graph database ID
113
- authorization (Union[None, Unset, str]):
114
- auth_token (Union[None, Unset, str]):
115
-
116
- Raises:
117
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
- httpx.TimeoutException: If the request takes longer than Client.timeout.
119
-
120
- Returns:
121
- Union[Any, HTTPValidationError]
122
- """
123
-
124
- return sync_detailed(
125
- graph_id=graph_id,
126
- client=client,
127
- authorization=authorization,
128
- auth_token=auth_token,
129
- ).parsed
130
-
131
-
132
- async def asyncio_detailed(
133
- graph_id: str,
134
- *,
135
- client: AuthenticatedClient,
136
- authorization: Union[None, Unset, str] = UNSET,
137
- auth_token: Union[None, Unset, str] = UNSET,
138
- ) -> Response[Union[Any, HTTPValidationError]]:
139
- """Get Graph Subscription
140
-
141
- Get current subscription for a graph database.
142
-
143
- Args:
144
- graph_id (str): Graph database ID
145
- authorization (Union[None, Unset, str]):
146
- auth_token (Union[None, Unset, str]):
147
-
148
- Raises:
149
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150
- httpx.TimeoutException: If the request takes longer than Client.timeout.
151
-
152
- Returns:
153
- Response[Union[Any, HTTPValidationError]]
154
- """
155
-
156
- kwargs = _get_kwargs(
157
- graph_id=graph_id,
158
- authorization=authorization,
159
- auth_token=auth_token,
160
- )
161
-
162
- response = await client.get_async_httpx_client().request(**kwargs)
163
-
164
- return _build_response(client=client, response=response)
165
-
166
-
167
- async def asyncio(
168
- graph_id: str,
169
- *,
170
- client: AuthenticatedClient,
171
- authorization: Union[None, Unset, str] = UNSET,
172
- auth_token: Union[None, Unset, str] = UNSET,
173
- ) -> Optional[Union[Any, HTTPValidationError]]:
174
- """Get Graph Subscription
175
-
176
- Get current subscription for a graph database.
177
-
178
- Args:
179
- graph_id (str): Graph database ID
180
- authorization (Union[None, Unset, str]):
181
- auth_token (Union[None, Unset, str]):
182
-
183
- Raises:
184
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
185
- httpx.TimeoutException: If the request takes longer than Client.timeout.
186
-
187
- Returns:
188
- Union[Any, HTTPValidationError]
189
- """
190
-
191
- return (
192
- await asyncio_detailed(
193
- graph_id=graph_id,
194
- client=client,
195
- authorization=authorization,
196
- auth_token=auth_token,
197
- )
198
- ).parsed
@@ -1,72 +0,0 @@
1
- from collections.abc import Mapping
2
- from typing import Any, TypeVar, Union
3
-
4
- from attrs import define as _attrs_define
5
- from attrs import field as _attrs_field
6
-
7
- from ..types import UNSET, Unset
8
-
9
- T = TypeVar("T", bound="BackupExportRequest")
10
-
11
-
12
- @_attrs_define
13
- class BackupExportRequest:
14
- """Request model for exporting a backup.
15
-
16
- Attributes:
17
- backup_id (str): ID of backup to export
18
- export_format (Union[Unset, str]): Export format - only 'original' is supported (compressed .kuzu file) Default:
19
- 'original'.
20
- """
21
-
22
- backup_id: str
23
- export_format: Union[Unset, str] = "original"
24
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
-
26
- def to_dict(self) -> dict[str, Any]:
27
- backup_id = self.backup_id
28
-
29
- export_format = self.export_format
30
-
31
- field_dict: dict[str, Any] = {}
32
- field_dict.update(self.additional_properties)
33
- field_dict.update(
34
- {
35
- "backup_id": backup_id,
36
- }
37
- )
38
- if export_format is not UNSET:
39
- field_dict["export_format"] = export_format
40
-
41
- return field_dict
42
-
43
- @classmethod
44
- def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
45
- d = dict(src_dict)
46
- backup_id = d.pop("backup_id")
47
-
48
- export_format = d.pop("export_format", UNSET)
49
-
50
- backup_export_request = cls(
51
- backup_id=backup_id,
52
- export_format=export_format,
53
- )
54
-
55
- backup_export_request.additional_properties = d
56
- return backup_export_request
57
-
58
- @property
59
- def additional_keys(self) -> list[str]:
60
- return list(self.additional_properties.keys())
61
-
62
- def __getitem__(self, key: str) -> Any:
63
- return self.additional_properties[key]
64
-
65
- def __setitem__(self, key: str, value: Any) -> None:
66
- self.additional_properties[key] = value
67
-
68
- def __delitem__(self, key: str) -> None:
69
- del self.additional_properties[key]
70
-
71
- def __contains__(self, key: str) -> bool:
72
- return key in self.additional_properties
@@ -1,82 +0,0 @@
1
- from collections.abc import Mapping
2
- from typing import Any, TypeVar, Union, cast
3
-
4
- from attrs import define as _attrs_define
5
- from attrs import field as _attrs_field
6
-
7
- from ..types import UNSET, Unset
8
-
9
- T = TypeVar("T", bound="CreditCheckRequest")
10
-
11
-
12
- @_attrs_define
13
- class CreditCheckRequest:
14
- """Request to check credit balance.
15
-
16
- Attributes:
17
- operation_type (str): Type of operation to check
18
- base_cost (Union[None, Unset, float]): Custom base cost (uses default if not provided)
19
- """
20
-
21
- operation_type: str
22
- base_cost: Union[None, Unset, float] = UNSET
23
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
24
-
25
- def to_dict(self) -> dict[str, Any]:
26
- operation_type = self.operation_type
27
-
28
- base_cost: Union[None, Unset, float]
29
- if isinstance(self.base_cost, Unset):
30
- base_cost = UNSET
31
- else:
32
- base_cost = self.base_cost
33
-
34
- field_dict: dict[str, Any] = {}
35
- field_dict.update(self.additional_properties)
36
- field_dict.update(
37
- {
38
- "operation_type": operation_type,
39
- }
40
- )
41
- if base_cost is not UNSET:
42
- field_dict["base_cost"] = base_cost
43
-
44
- return field_dict
45
-
46
- @classmethod
47
- def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
48
- d = dict(src_dict)
49
- operation_type = d.pop("operation_type")
50
-
51
- def _parse_base_cost(data: object) -> Union[None, Unset, float]:
52
- if data is None:
53
- return data
54
- if isinstance(data, Unset):
55
- return data
56
- return cast(Union[None, Unset, float], data)
57
-
58
- base_cost = _parse_base_cost(d.pop("base_cost", UNSET))
59
-
60
- credit_check_request = cls(
61
- operation_type=operation_type,
62
- base_cost=base_cost,
63
- )
64
-
65
- credit_check_request.additional_properties = d
66
- return credit_check_request
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
@@ -1,82 +0,0 @@
1
- from collections.abc import Mapping
2
- from typing import Any, TypeVar, Union, cast
3
-
4
- from attrs import define as _attrs_define
5
- from attrs import field as _attrs_field
6
-
7
- from ..types import UNSET, Unset
8
-
9
- T = TypeVar("T", bound="UpgradeSubscriptionRequest")
10
-
11
-
12
- @_attrs_define
13
- class UpgradeSubscriptionRequest:
14
- """Request to upgrade a graph database subscription.
15
-
16
- Attributes:
17
- plan_name (str):
18
- payment_method_id (Union[None, Unset, str]):
19
- """
20
-
21
- plan_name: str
22
- payment_method_id: Union[None, Unset, str] = UNSET
23
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
24
-
25
- def to_dict(self) -> dict[str, Any]:
26
- plan_name = self.plan_name
27
-
28
- payment_method_id: Union[None, Unset, str]
29
- if isinstance(self.payment_method_id, Unset):
30
- payment_method_id = UNSET
31
- else:
32
- payment_method_id = self.payment_method_id
33
-
34
- field_dict: dict[str, Any] = {}
35
- field_dict.update(self.additional_properties)
36
- field_dict.update(
37
- {
38
- "plan_name": plan_name,
39
- }
40
- )
41
- if payment_method_id is not UNSET:
42
- field_dict["payment_method_id"] = payment_method_id
43
-
44
- return field_dict
45
-
46
- @classmethod
47
- def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
48
- d = dict(src_dict)
49
- plan_name = d.pop("plan_name")
50
-
51
- def _parse_payment_method_id(data: object) -> Union[None, Unset, str]:
52
- if data is None:
53
- return data
54
- if isinstance(data, Unset):
55
- return data
56
- return cast(Union[None, Unset, str], data)
57
-
58
- payment_method_id = _parse_payment_method_id(d.pop("payment_method_id", UNSET))
59
-
60
- upgrade_subscription_request = cls(
61
- plan_name=plan_name,
62
- payment_method_id=payment_method_id,
63
- )
64
-
65
- upgrade_subscription_request.additional_properties = d
66
- return upgrade_subscription_request
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
File without changes