robosystems-client 0.2.8__py3-none-any.whl → 0.2.10__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. robosystems_client/api/graphs/get_graphs.py +120 -92
  2. robosystems_client/api/{user_subscriptions/cancel_shared_repository_subscription.py → subscriptions/cancel_subscription.py} +41 -25
  3. robosystems_client/api/subscriptions/create_repository_subscription.py +217 -0
  4. robosystems_client/api/subscriptions/get_graph_subscription.py +197 -0
  5. robosystems_client/api/{user_subscriptions/upgrade_shared_repository_subscription.py → subscriptions/upgrade_subscription.py} +57 -55
  6. robosystems_client/api/usage/get_graph_usage_analytics.py +377 -0
  7. robosystems_client/api/{user_limits/get_user_usage.py → user/get_user_limits.py} +13 -9
  8. robosystems_client/models/__init__.py +18 -82
  9. robosystems_client/models/{credits_summary_response_credits_by_addon_type_0_item.py → create_repository_subscription_request.py} +22 -6
  10. robosystems_client/models/credit_summary.py +55 -89
  11. robosystems_client/models/{graph_usage_response_storage_usage.py → credit_summary_operation_breakdown.py} +6 -6
  12. robosystems_client/models/graph_info.py +33 -2
  13. robosystems_client/models/graph_subscription_response.py +200 -0
  14. robosystems_client/models/graph_tier_instance.py +7 -7
  15. robosystems_client/models/graph_usage_response.py +136 -39
  16. robosystems_client/models/{user_analytics_response_limits.py → graph_usage_response_recent_events_item.py} +6 -6
  17. robosystems_client/models/performance_insights.py +120 -0
  18. robosystems_client/models/{graph_usage_response_recent_activity.py → performance_insights_operation_stats.py} +6 -6
  19. robosystems_client/models/{user_analytics_response_api_usage.py → performance_insights_slow_queries_item.py} +6 -6
  20. robosystems_client/models/storage_summary.py +100 -0
  21. robosystems_client/models/{tier_upgrade_request.py → upgrade_subscription_request.py} +12 -14
  22. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/METADATA +1 -1
  23. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/RECORD +34 -71
  24. robosystems_client/api/graph_analytics/get_graph_usage_stats.py +0 -289
  25. robosystems_client/api/graph_billing/get_current_graph_bill.py +0 -253
  26. robosystems_client/api/graph_billing/get_graph_billing_history.py +0 -298
  27. robosystems_client/api/graph_billing/get_graph_monthly_bill.py +0 -284
  28. robosystems_client/api/graph_billing/get_graph_usage_details.py +0 -320
  29. robosystems_client/api/user/get_all_credit_summaries.py +0 -169
  30. robosystems_client/api/user_analytics/__init__.py +0 -1
  31. robosystems_client/api/user_analytics/get_detailed_user_analytics.py +0 -188
  32. robosystems_client/api/user_analytics/get_user_usage_overview.py +0 -135
  33. robosystems_client/api/user_limits/__init__.py +0 -1
  34. robosystems_client/api/user_limits/get_all_shared_repository_limits.py +0 -141
  35. robosystems_client/api/user_limits/get_shared_repository_limits.py +0 -213
  36. robosystems_client/api/user_limits/get_user_limits.py +0 -139
  37. robosystems_client/api/user_subscriptions/__init__.py +0 -1
  38. robosystems_client/api/user_subscriptions/get_repository_credits.py +0 -173
  39. robosystems_client/api/user_subscriptions/get_shared_repository_credits.py +0 -143
  40. robosystems_client/api/user_subscriptions/get_user_shared_subscriptions.py +0 -181
  41. robosystems_client/api/user_subscriptions/subscribe_to_shared_repository.py +0 -186
  42. robosystems_client/models/add_on_credit_info.py +0 -119
  43. robosystems_client/models/credits_summary_response.py +0 -148
  44. robosystems_client/models/get_all_credit_summaries_response_getallcreditsummaries.py +0 -44
  45. robosystems_client/models/get_all_shared_repository_limits_response_getallsharedrepositorylimits.py +0 -46
  46. robosystems_client/models/get_current_graph_bill_response_getcurrentgraphbill.py +0 -44
  47. robosystems_client/models/get_graph_billing_history_response_getgraphbillinghistory.py +0 -44
  48. robosystems_client/models/get_graph_monthly_bill_response_getgraphmonthlybill.py +0 -44
  49. robosystems_client/models/get_graph_usage_details_response_getgraphusagedetails.py +0 -44
  50. robosystems_client/models/get_shared_repository_limits_response_getsharedrepositorylimits.py +0 -44
  51. robosystems_client/models/graph_usage_response_query_statistics.py +0 -44
  52. robosystems_client/models/repository_credits_response.py +0 -128
  53. robosystems_client/models/repository_plan.py +0 -10
  54. robosystems_client/models/repository_type.py +0 -10
  55. robosystems_client/models/subscription_info.py +0 -152
  56. robosystems_client/models/subscription_info_metadata.py +0 -44
  57. robosystems_client/models/subscription_request.py +0 -80
  58. robosystems_client/models/subscription_response.py +0 -74
  59. robosystems_client/models/user_analytics_response.py +0 -132
  60. robosystems_client/models/user_analytics_response_graph_usage.py +0 -44
  61. robosystems_client/models/user_analytics_response_recent_activity_item.py +0 -44
  62. robosystems_client/models/user_analytics_response_user_info.py +0 -44
  63. robosystems_client/models/user_graph_summary.py +0 -134
  64. robosystems_client/models/user_subscriptions_response.py +0 -90
  65. robosystems_client/models/user_usage_summary_response.py +0 -130
  66. robosystems_client/models/user_usage_summary_response_usage_vs_limits.py +0 -44
  67. /robosystems_client/api/{graph_analytics → credits_}/__init__.py +0 -0
  68. /robosystems_client/api/{graph_credits → credits_}/check_credit_balance.py +0 -0
  69. /robosystems_client/api/{graph_credits → credits_}/check_storage_limits.py +0 -0
  70. /robosystems_client/api/{graph_credits → credits_}/get_credit_summary.py +0 -0
  71. /robosystems_client/api/{graph_credits → credits_}/get_storage_usage.py +0 -0
  72. /robosystems_client/api/{graph_credits → credits_}/list_credit_transactions.py +0 -0
  73. /robosystems_client/api/{graph_billing → subscriptions}/__init__.py +0 -0
  74. /robosystems_client/api/{graph_credits → usage}/__init__.py +0 -0
  75. /robosystems_client/api/{graph_analytics → usage}/get_graph_metrics.py +0 -0
  76. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/WHEEL +0 -0
  77. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/licenses/LICENSE +0 -0
@@ -51,39 +51,46 @@ def sync_detailed(
51
51
  *,
52
52
  client: AuthenticatedClient,
53
53
  ) -> Response[Union[Any, UserGraphsResponse]]:
54
- r"""Get User Graphs
54
+ r"""Get User Graphs and Repositories
55
55
 
56
- List all graph databases accessible to the current user with roles and selection status.
56
+ List all graph databases and shared repositories accessible to the current user.
57
57
 
58
- Returns a comprehensive list of all graphs the user can access, including their
59
- role in each graph (admin or member) and which graph is currently selected as
60
- the active workspace.
58
+ Returns a unified list of both user-created graphs and shared repositories (like SEC data)
59
+ that the user has access to, including their role/access level and selection status.
61
60
 
62
61
  **Returned Information:**
63
- - Graph ID and display name for each accessible graph
64
- - User's role (admin/member) indicating permission level
65
- - Selection status (one graph can be marked as \"selected\")
66
- - Creation timestamp for each graph
67
-
68
- **Graph Roles:**
69
- - `admin`: Full access - can manage graph settings, invite users, delete graph
70
- - `member`: Read/write access - can query and modify data, cannot manage settings
62
+ - Graph/Repository ID and display name
63
+ - User's role/access level (admin/member for graphs, read/write/admin for repositories)
64
+ - Selection status (only user graphs can be selected)
65
+ - Creation timestamp
66
+ - Repository type indicator (isRepository: true for shared repositories)
67
+
68
+ **User Graphs (isRepository: false):**
69
+ - Collaborative workspaces that can be shared with other users
70
+ - Roles: `admin` (full access, can invite users) or `member` (read/write access)
71
+ - Can be selected as active workspace
72
+ - Graphs you create or have been invited to
73
+
74
+ **Shared Repositories (isRepository: true):**
75
+ - Read-only data repositories like SEC filings, industry benchmarks
76
+ - Access levels: `read`, `write` (for data contributions), `admin`
77
+ - Cannot be selected (each has separate subscription)
78
+ - Require separate subscriptions (personal, cannot be shared)
71
79
 
72
80
  **Selected Graph Concept:**
73
- The \"selected\" graph is the user's currently active workspace. Many API operations
74
- default to the selected graph if no graph_id is provided. Users can change their
75
- selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
81
+ The \"selected\" graph is the user's currently active workspace (user graphs only).
82
+ Many API operations default to the selected graph if no graph_id is provided.
83
+ Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
76
84
 
77
85
  **Use Cases:**
78
- - Display graph selector in UI
79
- - Show user's accessible workspaces
80
- - Identify which graph is currently active
81
- - Filter graphs by role for permission-based features
86
+ - Display unified graph/repository selector in UI
87
+ - Show all accessible data sources (both owned graphs and subscribed repositories)
88
+ - Identify currently active workspace
89
+ - Filter by type (user graphs vs repositories)
82
90
 
83
91
  **Empty Response:**
84
- New users or users without graph access will receive an empty list with
85
- `selectedGraphId: null`. Users should create a new graph or request access
86
- to an existing graph.
92
+ New users receive an empty list with `selectedGraphId: null`. Users should create
93
+ a graph or subscribe to a repository.
87
94
 
88
95
  **Note:**
89
96
  Graph listing is included - no credit consumption required.
@@ -109,39 +116,46 @@ def sync(
109
116
  *,
110
117
  client: AuthenticatedClient,
111
118
  ) -> Optional[Union[Any, UserGraphsResponse]]:
112
- r"""Get User Graphs
119
+ r"""Get User Graphs and Repositories
113
120
 
114
- List all graph databases accessible to the current user with roles and selection status.
121
+ List all graph databases and shared repositories accessible to the current user.
115
122
 
116
- Returns a comprehensive list of all graphs the user can access, including their
117
- role in each graph (admin or member) and which graph is currently selected as
118
- the active workspace.
123
+ Returns a unified list of both user-created graphs and shared repositories (like SEC data)
124
+ that the user has access to, including their role/access level and selection status.
119
125
 
120
126
  **Returned Information:**
121
- - Graph ID and display name for each accessible graph
122
- - User's role (admin/member) indicating permission level
123
- - Selection status (one graph can be marked as \"selected\")
124
- - Creation timestamp for each graph
125
-
126
- **Graph Roles:**
127
- - `admin`: Full access - can manage graph settings, invite users, delete graph
128
- - `member`: Read/write access - can query and modify data, cannot manage settings
127
+ - Graph/Repository ID and display name
128
+ - User's role/access level (admin/member for graphs, read/write/admin for repositories)
129
+ - Selection status (only user graphs can be selected)
130
+ - Creation timestamp
131
+ - Repository type indicator (isRepository: true for shared repositories)
132
+
133
+ **User Graphs (isRepository: false):**
134
+ - Collaborative workspaces that can be shared with other users
135
+ - Roles: `admin` (full access, can invite users) or `member` (read/write access)
136
+ - Can be selected as active workspace
137
+ - Graphs you create or have been invited to
138
+
139
+ **Shared Repositories (isRepository: true):**
140
+ - Read-only data repositories like SEC filings, industry benchmarks
141
+ - Access levels: `read`, `write` (for data contributions), `admin`
142
+ - Cannot be selected (each has separate subscription)
143
+ - Require separate subscriptions (personal, cannot be shared)
129
144
 
130
145
  **Selected Graph Concept:**
131
- The \"selected\" graph is the user's currently active workspace. Many API operations
132
- default to the selected graph if no graph_id is provided. Users can change their
133
- selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
146
+ The \"selected\" graph is the user's currently active workspace (user graphs only).
147
+ Many API operations default to the selected graph if no graph_id is provided.
148
+ Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
134
149
 
135
150
  **Use Cases:**
136
- - Display graph selector in UI
137
- - Show user's accessible workspaces
138
- - Identify which graph is currently active
139
- - Filter graphs by role for permission-based features
151
+ - Display unified graph/repository selector in UI
152
+ - Show all accessible data sources (both owned graphs and subscribed repositories)
153
+ - Identify currently active workspace
154
+ - Filter by type (user graphs vs repositories)
140
155
 
141
156
  **Empty Response:**
142
- New users or users without graph access will receive an empty list with
143
- `selectedGraphId: null`. Users should create a new graph or request access
144
- to an existing graph.
157
+ New users receive an empty list with `selectedGraphId: null`. Users should create
158
+ a graph or subscribe to a repository.
145
159
 
146
160
  **Note:**
147
161
  Graph listing is included - no credit consumption required.
@@ -163,39 +177,46 @@ async def asyncio_detailed(
163
177
  *,
164
178
  client: AuthenticatedClient,
165
179
  ) -> Response[Union[Any, UserGraphsResponse]]:
166
- r"""Get User Graphs
180
+ r"""Get User Graphs and Repositories
167
181
 
168
- List all graph databases accessible to the current user with roles and selection status.
182
+ List all graph databases and shared repositories accessible to the current user.
169
183
 
170
- Returns a comprehensive list of all graphs the user can access, including their
171
- role in each graph (admin or member) and which graph is currently selected as
172
- the active workspace.
184
+ Returns a unified list of both user-created graphs and shared repositories (like SEC data)
185
+ that the user has access to, including their role/access level and selection status.
173
186
 
174
187
  **Returned Information:**
175
- - Graph ID and display name for each accessible graph
176
- - User's role (admin/member) indicating permission level
177
- - Selection status (one graph can be marked as \"selected\")
178
- - Creation timestamp for each graph
179
-
180
- **Graph Roles:**
181
- - `admin`: Full access - can manage graph settings, invite users, delete graph
182
- - `member`: Read/write access - can query and modify data, cannot manage settings
188
+ - Graph/Repository ID and display name
189
+ - User's role/access level (admin/member for graphs, read/write/admin for repositories)
190
+ - Selection status (only user graphs can be selected)
191
+ - Creation timestamp
192
+ - Repository type indicator (isRepository: true for shared repositories)
193
+
194
+ **User Graphs (isRepository: false):**
195
+ - Collaborative workspaces that can be shared with other users
196
+ - Roles: `admin` (full access, can invite users) or `member` (read/write access)
197
+ - Can be selected as active workspace
198
+ - Graphs you create or have been invited to
199
+
200
+ **Shared Repositories (isRepository: true):**
201
+ - Read-only data repositories like SEC filings, industry benchmarks
202
+ - Access levels: `read`, `write` (for data contributions), `admin`
203
+ - Cannot be selected (each has separate subscription)
204
+ - Require separate subscriptions (personal, cannot be shared)
183
205
 
184
206
  **Selected Graph Concept:**
185
- The \"selected\" graph is the user's currently active workspace. Many API operations
186
- default to the selected graph if no graph_id is provided. Users can change their
187
- selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
207
+ The \"selected\" graph is the user's currently active workspace (user graphs only).
208
+ Many API operations default to the selected graph if no graph_id is provided.
209
+ Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
188
210
 
189
211
  **Use Cases:**
190
- - Display graph selector in UI
191
- - Show user's accessible workspaces
192
- - Identify which graph is currently active
193
- - Filter graphs by role for permission-based features
212
+ - Display unified graph/repository selector in UI
213
+ - Show all accessible data sources (both owned graphs and subscribed repositories)
214
+ - Identify currently active workspace
215
+ - Filter by type (user graphs vs repositories)
194
216
 
195
217
  **Empty Response:**
196
- New users or users without graph access will receive an empty list with
197
- `selectedGraphId: null`. Users should create a new graph or request access
198
- to an existing graph.
218
+ New users receive an empty list with `selectedGraphId: null`. Users should create
219
+ a graph or subscribe to a repository.
199
220
 
200
221
  **Note:**
201
222
  Graph listing is included - no credit consumption required.
@@ -219,39 +240,46 @@ async def asyncio(
219
240
  *,
220
241
  client: AuthenticatedClient,
221
242
  ) -> Optional[Union[Any, UserGraphsResponse]]:
222
- r"""Get User Graphs
243
+ r"""Get User Graphs and Repositories
223
244
 
224
- List all graph databases accessible to the current user with roles and selection status.
245
+ List all graph databases and shared repositories accessible to the current user.
225
246
 
226
- Returns a comprehensive list of all graphs the user can access, including their
227
- role in each graph (admin or member) and which graph is currently selected as
228
- the active workspace.
247
+ Returns a unified list of both user-created graphs and shared repositories (like SEC data)
248
+ that the user has access to, including their role/access level and selection status.
229
249
 
230
250
  **Returned Information:**
231
- - Graph ID and display name for each accessible graph
232
- - User's role (admin/member) indicating permission level
233
- - Selection status (one graph can be marked as \"selected\")
234
- - Creation timestamp for each graph
235
-
236
- **Graph Roles:**
237
- - `admin`: Full access - can manage graph settings, invite users, delete graph
238
- - `member`: Read/write access - can query and modify data, cannot manage settings
251
+ - Graph/Repository ID and display name
252
+ - User's role/access level (admin/member for graphs, read/write/admin for repositories)
253
+ - Selection status (only user graphs can be selected)
254
+ - Creation timestamp
255
+ - Repository type indicator (isRepository: true for shared repositories)
256
+
257
+ **User Graphs (isRepository: false):**
258
+ - Collaborative workspaces that can be shared with other users
259
+ - Roles: `admin` (full access, can invite users) or `member` (read/write access)
260
+ - Can be selected as active workspace
261
+ - Graphs you create or have been invited to
262
+
263
+ **Shared Repositories (isRepository: true):**
264
+ - Read-only data repositories like SEC filings, industry benchmarks
265
+ - Access levels: `read`, `write` (for data contributions), `admin`
266
+ - Cannot be selected (each has separate subscription)
267
+ - Require separate subscriptions (personal, cannot be shared)
239
268
 
240
269
  **Selected Graph Concept:**
241
- The \"selected\" graph is the user's currently active workspace. Many API operations
242
- default to the selected graph if no graph_id is provided. Users can change their
243
- selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
270
+ The \"selected\" graph is the user's currently active workspace (user graphs only).
271
+ Many API operations default to the selected graph if no graph_id is provided.
272
+ Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
244
273
 
245
274
  **Use Cases:**
246
- - Display graph selector in UI
247
- - Show user's accessible workspaces
248
- - Identify which graph is currently active
249
- - Filter graphs by role for permission-based features
275
+ - Display unified graph/repository selector in UI
276
+ - Show all accessible data sources (both owned graphs and subscribed repositories)
277
+ - Identify currently active workspace
278
+ - Filter by type (user graphs vs repositories)
250
279
 
251
280
  **Empty Response:**
252
- New users or users without graph access will receive an empty list with
253
- `selectedGraphId: null`. Users should create a new graph or request access
254
- to an existing graph.
281
+ New users receive an empty list with `selectedGraphId: null`. Users should create
282
+ a graph or subscribe to a repository.
255
283
 
256
284
  **Note:**
257
285
  Graph listing is included - no credit consumption required.
@@ -11,11 +11,11 @@ from ...types import Response
11
11
 
12
12
 
13
13
  def _get_kwargs(
14
- subscription_id: str,
14
+ graph_id: str,
15
15
  ) -> dict[str, Any]:
16
16
  _kwargs: dict[str, Any] = {
17
17
  "method": "delete",
18
- "url": f"/v1/user/subscriptions/shared-repositories/{subscription_id}",
18
+ "url": f"/v1/graphs/{graph_id}/subscriptions",
19
19
  }
20
20
 
21
21
  return _kwargs
@@ -29,9 +29,9 @@ def _parse_response(
29
29
 
30
30
  return response_200
31
31
 
32
- if response.status_code == 401:
33
- response_401 = cast(Any, None)
34
- return response_401
32
+ if response.status_code == 400:
33
+ response_400 = cast(Any, None)
34
+ return response_400
35
35
 
36
36
  if response.status_code == 404:
37
37
  response_404 = cast(Any, None)
@@ -42,10 +42,6 @@ def _parse_response(
42
42
 
43
43
  return response_422
44
44
 
45
- if response.status_code == 500:
46
- response_500 = cast(Any, None)
47
- return response_500
48
-
49
45
  if client.raise_on_unexpected_status:
50
46
  raise errors.UnexpectedStatus(response.status_code, response.content)
51
47
  else:
@@ -64,16 +60,21 @@ def _build_response(
64
60
 
65
61
 
66
62
  def sync_detailed(
67
- subscription_id: str,
63
+ graph_id: str,
68
64
  *,
69
65
  client: AuthenticatedClient,
70
66
  ) -> Response[Union[Any, CancellationResponse, HTTPValidationError]]:
71
67
  """Cancel Subscription
72
68
 
73
- Cancel a shared repository subscription and disable associated credit pool
69
+ Cancel a subscription.
70
+
71
+ For shared repositories: Cancels the user's personal subscription
72
+ For user graphs: Not allowed - delete the graph instead
73
+
74
+ The subscription will be marked as canceled and will end at the current period end date.
74
75
 
75
76
  Args:
76
- subscription_id (str):
77
+ graph_id (str): Graph ID or repository name
77
78
 
78
79
  Raises:
79
80
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -84,7 +85,7 @@ def sync_detailed(
84
85
  """
85
86
 
86
87
  kwargs = _get_kwargs(
87
- subscription_id=subscription_id,
88
+ graph_id=graph_id,
88
89
  )
89
90
 
90
91
  response = client.get_httpx_client().request(
@@ -95,16 +96,21 @@ def sync_detailed(
95
96
 
96
97
 
97
98
  def sync(
98
- subscription_id: str,
99
+ graph_id: str,
99
100
  *,
100
101
  client: AuthenticatedClient,
101
102
  ) -> Optional[Union[Any, CancellationResponse, HTTPValidationError]]:
102
103
  """Cancel Subscription
103
104
 
104
- Cancel a shared repository subscription and disable associated credit pool
105
+ Cancel a subscription.
106
+
107
+ For shared repositories: Cancels the user's personal subscription
108
+ For user graphs: Not allowed - delete the graph instead
109
+
110
+ The subscription will be marked as canceled and will end at the current period end date.
105
111
 
106
112
  Args:
107
- subscription_id (str):
113
+ graph_id (str): Graph ID or repository name
108
114
 
109
115
  Raises:
110
116
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -115,22 +121,27 @@ def sync(
115
121
  """
116
122
 
117
123
  return sync_detailed(
118
- subscription_id=subscription_id,
124
+ graph_id=graph_id,
119
125
  client=client,
120
126
  ).parsed
121
127
 
122
128
 
123
129
  async def asyncio_detailed(
124
- subscription_id: str,
130
+ graph_id: str,
125
131
  *,
126
132
  client: AuthenticatedClient,
127
133
  ) -> Response[Union[Any, CancellationResponse, HTTPValidationError]]:
128
134
  """Cancel Subscription
129
135
 
130
- Cancel a shared repository subscription and disable associated credit pool
136
+ Cancel a subscription.
137
+
138
+ For shared repositories: Cancels the user's personal subscription
139
+ For user graphs: Not allowed - delete the graph instead
140
+
141
+ The subscription will be marked as canceled and will end at the current period end date.
131
142
 
132
143
  Args:
133
- subscription_id (str):
144
+ graph_id (str): Graph ID or repository name
134
145
 
135
146
  Raises:
136
147
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -141,7 +152,7 @@ async def asyncio_detailed(
141
152
  """
142
153
 
143
154
  kwargs = _get_kwargs(
144
- subscription_id=subscription_id,
155
+ graph_id=graph_id,
145
156
  )
146
157
 
147
158
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -150,16 +161,21 @@ async def asyncio_detailed(
150
161
 
151
162
 
152
163
  async def asyncio(
153
- subscription_id: str,
164
+ graph_id: str,
154
165
  *,
155
166
  client: AuthenticatedClient,
156
167
  ) -> Optional[Union[Any, CancellationResponse, HTTPValidationError]]:
157
168
  """Cancel Subscription
158
169
 
159
- Cancel a shared repository subscription and disable associated credit pool
170
+ Cancel a subscription.
171
+
172
+ For shared repositories: Cancels the user's personal subscription
173
+ For user graphs: Not allowed - delete the graph instead
174
+
175
+ The subscription will be marked as canceled and will end at the current period end date.
160
176
 
161
177
  Args:
162
- subscription_id (str):
178
+ graph_id (str): Graph ID or repository name
163
179
 
164
180
  Raises:
165
181
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -171,7 +187,7 @@ async def asyncio(
171
187
 
172
188
  return (
173
189
  await asyncio_detailed(
174
- subscription_id=subscription_id,
190
+ graph_id=graph_id,
175
191
  client=client,
176
192
  )
177
193
  ).parsed
@@ -0,0 +1,217 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.create_repository_subscription_request import (
9
+ CreateRepositorySubscriptionRequest,
10
+ )
11
+ from ...models.graph_subscription_response import GraphSubscriptionResponse
12
+ from ...models.http_validation_error import HTTPValidationError
13
+ from ...types import Response
14
+
15
+
16
+ def _get_kwargs(
17
+ graph_id: str,
18
+ *,
19
+ body: CreateRepositorySubscriptionRequest,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+
23
+ _kwargs: dict[str, Any] = {
24
+ "method": "post",
25
+ "url": f"/v1/graphs/{graph_id}/subscriptions",
26
+ }
27
+
28
+ _kwargs["json"] = body.to_dict()
29
+
30
+ headers["Content-Type"] = "application/json"
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, GraphSubscriptionResponse, HTTPValidationError]]:
39
+ if response.status_code == 201:
40
+ response_201 = GraphSubscriptionResponse.from_dict(response.json())
41
+
42
+ return response_201
43
+
44
+ if response.status_code == 400:
45
+ response_400 = cast(Any, None)
46
+ return response_400
47
+
48
+ if response.status_code == 409:
49
+ response_409 = cast(Any, None)
50
+ return response_409
51
+
52
+ if response.status_code == 422:
53
+ response_422 = HTTPValidationError.from_dict(response.json())
54
+
55
+ return response_422
56
+
57
+ if client.raise_on_unexpected_status:
58
+ raise errors.UnexpectedStatus(response.status_code, response.content)
59
+ else:
60
+ return None
61
+
62
+
63
+ def _build_response(
64
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
65
+ ) -> Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
66
+ return Response(
67
+ status_code=HTTPStatus(response.status_code),
68
+ content=response.content,
69
+ headers=response.headers,
70
+ parsed=_parse_response(client=client, response=response),
71
+ )
72
+
73
+
74
+ def sync_detailed(
75
+ graph_id: str,
76
+ *,
77
+ client: AuthenticatedClient,
78
+ body: CreateRepositorySubscriptionRequest,
79
+ ) -> Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
80
+ """Create Repository Subscription
81
+
82
+ Create a new subscription to a shared repository.
83
+
84
+ This endpoint is ONLY for shared repositories (sec, industry, economic).
85
+ User graph subscriptions are created automatically when the graph is provisioned.
86
+
87
+ The subscription will be created in ACTIVE status immediately and credits will be allocated.
88
+
89
+ Args:
90
+ graph_id (str): Repository name (e.g., 'sec', 'industry')
91
+ body (CreateRepositorySubscriptionRequest): Request to create a repository subscription.
92
+
93
+ Raises:
94
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
95
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
96
+
97
+ Returns:
98
+ Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]
99
+ """
100
+
101
+ kwargs = _get_kwargs(
102
+ graph_id=graph_id,
103
+ body=body,
104
+ )
105
+
106
+ response = client.get_httpx_client().request(
107
+ **kwargs,
108
+ )
109
+
110
+ return _build_response(client=client, response=response)
111
+
112
+
113
+ def sync(
114
+ graph_id: str,
115
+ *,
116
+ client: AuthenticatedClient,
117
+ body: CreateRepositorySubscriptionRequest,
118
+ ) -> Optional[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
119
+ """Create Repository Subscription
120
+
121
+ Create a new subscription to a shared repository.
122
+
123
+ This endpoint is ONLY for shared repositories (sec, industry, economic).
124
+ User graph subscriptions are created automatically when the graph is provisioned.
125
+
126
+ The subscription will be created in ACTIVE status immediately and credits will be allocated.
127
+
128
+ Args:
129
+ graph_id (str): Repository name (e.g., 'sec', 'industry')
130
+ body (CreateRepositorySubscriptionRequest): Request to create a repository subscription.
131
+
132
+ Raises:
133
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
134
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
135
+
136
+ Returns:
137
+ Union[Any, GraphSubscriptionResponse, HTTPValidationError]
138
+ """
139
+
140
+ return sync_detailed(
141
+ graph_id=graph_id,
142
+ client=client,
143
+ body=body,
144
+ ).parsed
145
+
146
+
147
+ async def asyncio_detailed(
148
+ graph_id: str,
149
+ *,
150
+ client: AuthenticatedClient,
151
+ body: CreateRepositorySubscriptionRequest,
152
+ ) -> Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
153
+ """Create Repository Subscription
154
+
155
+ Create a new subscription to a shared repository.
156
+
157
+ This endpoint is ONLY for shared repositories (sec, industry, economic).
158
+ User graph subscriptions are created automatically when the graph is provisioned.
159
+
160
+ The subscription will be created in ACTIVE status immediately and credits will be allocated.
161
+
162
+ Args:
163
+ graph_id (str): Repository name (e.g., 'sec', 'industry')
164
+ body (CreateRepositorySubscriptionRequest): Request to create a repository subscription.
165
+
166
+ Raises:
167
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
168
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
169
+
170
+ Returns:
171
+ Response[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]
172
+ """
173
+
174
+ kwargs = _get_kwargs(
175
+ graph_id=graph_id,
176
+ body=body,
177
+ )
178
+
179
+ response = await client.get_async_httpx_client().request(**kwargs)
180
+
181
+ return _build_response(client=client, response=response)
182
+
183
+
184
+ async def asyncio(
185
+ graph_id: str,
186
+ *,
187
+ client: AuthenticatedClient,
188
+ body: CreateRepositorySubscriptionRequest,
189
+ ) -> Optional[Union[Any, GraphSubscriptionResponse, HTTPValidationError]]:
190
+ """Create Repository Subscription
191
+
192
+ Create a new subscription to a shared repository.
193
+
194
+ This endpoint is ONLY for shared repositories (sec, industry, economic).
195
+ User graph subscriptions are created automatically when the graph is provisioned.
196
+
197
+ The subscription will be created in ACTIVE status immediately and credits will be allocated.
198
+
199
+ Args:
200
+ graph_id (str): Repository name (e.g., 'sec', 'industry')
201
+ body (CreateRepositorySubscriptionRequest): Request to create a repository subscription.
202
+
203
+ Raises:
204
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
205
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
206
+
207
+ Returns:
208
+ Union[Any, GraphSubscriptionResponse, HTTPValidationError]
209
+ """
210
+
211
+ return (
212
+ await asyncio_detailed(
213
+ graph_id=graph_id,
214
+ client=client,
215
+ body=body,
216
+ )
217
+ ).parsed