cmdop 0.1.24__py3-none-any.whl → 0.1.26__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.
- cmdop/__init__.py +9 -4
- cmdop/_generated/rpc_messages/browser_pb2.py +138 -138
- cmdop/_generated/rpc_messages/browser_pb2.pyi +6 -2
- cmdop/api/generated/machines/__init__.py +1 -1
- cmdop/api/generated/machines/enums.py +0 -112
- cmdop/api/generated/machines/machines__api__machine_sharing/client.py +21 -6
- cmdop/api/generated/machines/machines__api__machine_sharing/models.py +46 -19
- cmdop/api/generated/machines/machines__api__machine_sharing/sync_client.py +20 -5
- cmdop/api/generated/machines/machines__api__machines/client.py +90 -25
- cmdop/api/generated/machines/machines__api__machines/models.py +143 -125
- cmdop/api/generated/machines/machines__api__machines/sync_client.py +84 -19
- cmdop/api/generated/machines/schema.json +72 -0
- cmdop/api/generated/system/__init__.py +1 -1
- cmdop/api/generated/system/enums.py +0 -52
- cmdop/api/generated/system/schema.json +54 -0
- cmdop/api/generated/system/system__api__oauth/client.py +42 -12
- cmdop/api/generated/system/system__api__oauth/models.py +111 -85
- cmdop/api/generated/system/system__api__oauth/sync_client.py +38 -8
- cmdop/api/generated/system/system__api__system/client.py +98 -23
- cmdop/api/generated/system/system__api__system/models.py +83 -83
- cmdop/api/generated/system/system__api__system/sync_client.py +94 -19
- cmdop/api/generated/workspaces/__init__.py +1 -1
- cmdop/api/generated/workspaces/enums.py +0 -137
- cmdop/api/generated/workspaces/schema.json +47 -0
- cmdop/api/generated/workspaces/workspaces__api__workspaces/client.py +156 -41
- cmdop/api/generated/workspaces/workspaces__api__workspaces/models.py +126 -85
- cmdop/api/generated/workspaces/workspaces__api__workspaces/sync_client.py +145 -29
- cmdop/helpers/__init__.py +0 -4
- cmdop/helpers/network_analyzer.py +28 -9
- cmdop/services/browser/capabilities/visual.py +1 -1
- cmdop/services/browser/service/sync.py +4 -0
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/METADATA +24 -14
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/RECORD +35 -37
- cmdop/helpers/cleaner.py +0 -53
- cmdop/helpers/formatting.py +0 -15
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/WHEEL +0 -0
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,33 @@ from typing import Any
|
|
|
6
6
|
|
|
7
7
|
from pydantic import BaseModel, ConfigDict, Field
|
|
8
8
|
|
|
9
|
-
from ..enums import
|
|
9
|
+
from ..enums import AlertType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Alert(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Serializer for Alert model.
|
|
15
|
+
|
|
16
|
+
Response model (includes read-only fields).
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
model_config = ConfigDict(
|
|
20
|
+
validate_assignment=True,
|
|
21
|
+
extra="allow",
|
|
22
|
+
frozen=False,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
id: Any = ...
|
|
26
|
+
workspace: str = ...
|
|
27
|
+
type: AlertType = Field(description='* `machine_offline` - Machine Offline\n* `task_failed` - Task Failed\n* `schedule_error` - Schedule Error')
|
|
28
|
+
title: str = Field(max_length=200)
|
|
29
|
+
message: str = ...
|
|
30
|
+
machine: str | None = None
|
|
31
|
+
machine_name: Any | None = Field(None, description='Get machine name.')
|
|
32
|
+
read: bool | None = None
|
|
33
|
+
is_unread: bool = ...
|
|
34
|
+
created_at: Any = ...
|
|
35
|
+
|
|
10
36
|
|
|
11
37
|
|
|
12
38
|
class PaginatedAlertList(BaseModel):
|
|
@@ -29,15 +55,15 @@ class PaginatedAlertList(BaseModel):
|
|
|
29
55
|
has_previous: bool = Field(description='Whether there is a previous page')
|
|
30
56
|
next_page: int | None = Field(None, description='Next page number (null if no next page)')
|
|
31
57
|
previous_page: int | None = Field(None, description='Previous page number (null if no previous page)')
|
|
32
|
-
results: list[
|
|
58
|
+
results: list[Alert] = Field(description='Array of items for current page')
|
|
33
59
|
|
|
34
60
|
|
|
35
61
|
|
|
36
|
-
class
|
|
62
|
+
class AlertCreateRequest(BaseModel):
|
|
37
63
|
"""
|
|
38
64
|
Serializer for creating alerts.
|
|
39
65
|
|
|
40
|
-
|
|
66
|
+
Request model (no read-only fields).
|
|
41
67
|
"""
|
|
42
68
|
|
|
43
69
|
model_config = ConfigDict(
|
|
@@ -47,16 +73,16 @@ class AlertCreate(BaseModel):
|
|
|
47
73
|
)
|
|
48
74
|
|
|
49
75
|
workspace: str = ...
|
|
50
|
-
type:
|
|
51
|
-
title: str = Field(max_length=200)
|
|
52
|
-
message: str =
|
|
76
|
+
type: AlertType = Field(description='* `machine_offline` - Machine Offline\n* `task_failed` - Task Failed\n* `schedule_error` - Schedule Error')
|
|
77
|
+
title: str = Field(min_length=1, max_length=200)
|
|
78
|
+
message: str = Field(min_length=1)
|
|
53
79
|
machine: str | None = None
|
|
54
80
|
|
|
55
81
|
|
|
56
82
|
|
|
57
|
-
class
|
|
83
|
+
class AlertCreate(BaseModel):
|
|
58
84
|
"""
|
|
59
|
-
Serializer for
|
|
85
|
+
Serializer for creating alerts.
|
|
60
86
|
|
|
61
87
|
Response model (includes read-only fields).
|
|
62
88
|
"""
|
|
@@ -67,23 +93,19 @@ class Alert(BaseModel):
|
|
|
67
93
|
frozen=False,
|
|
68
94
|
)
|
|
69
95
|
|
|
70
|
-
id: Any = ...
|
|
71
96
|
workspace: str = ...
|
|
72
97
|
type: AlertType = Field(description='* `machine_offline` - Machine Offline\n* `task_failed` - Task Failed\n* `schedule_error` - Schedule Error')
|
|
73
98
|
title: str = Field(max_length=200)
|
|
74
99
|
message: str = ...
|
|
75
100
|
machine: str | None = None
|
|
76
|
-
machine_name: Any | None = Field(description='Get machine name.')
|
|
77
|
-
read: bool = None
|
|
78
|
-
is_unread: bool = ...
|
|
79
|
-
created_at: Any = ...
|
|
80
101
|
|
|
81
102
|
|
|
82
103
|
|
|
83
|
-
class
|
|
104
|
+
class AlertRequest(BaseModel):
|
|
84
105
|
"""
|
|
85
|
-
|
|
86
|
-
|
|
106
|
+
Serializer for Alert model.
|
|
107
|
+
|
|
108
|
+
Request model (no read-only fields).
|
|
87
109
|
"""
|
|
88
110
|
|
|
89
111
|
model_config = ConfigDict(
|
|
@@ -92,23 +114,20 @@ class PaginatedApiKeyList(BaseModel):
|
|
|
92
114
|
frozen=False,
|
|
93
115
|
)
|
|
94
116
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
next_page: int | None = Field(None, description='Next page number (null if no next page)')
|
|
102
|
-
previous_page: int | None = Field(None, description='Previous page number (null if no previous page)')
|
|
103
|
-
results: list[dict[str, Any]] = Field(description='Array of items for current page')
|
|
117
|
+
workspace: str = ...
|
|
118
|
+
type: AlertType = Field(description='* `machine_offline` - Machine Offline\n* `task_failed` - Task Failed\n* `schedule_error` - Schedule Error')
|
|
119
|
+
title: str = Field(min_length=1, max_length=200)
|
|
120
|
+
message: str = Field(min_length=1)
|
|
121
|
+
machine: str | None = None
|
|
122
|
+
read: bool | None = None
|
|
104
123
|
|
|
105
124
|
|
|
106
125
|
|
|
107
|
-
class
|
|
126
|
+
class PatchedAlertRequest(BaseModel):
|
|
108
127
|
"""
|
|
109
|
-
|
|
128
|
+
Serializer for Alert model.
|
|
110
129
|
|
|
111
|
-
|
|
130
|
+
Request model (no read-only fields).
|
|
112
131
|
"""
|
|
113
132
|
|
|
114
133
|
model_config = ConfigDict(
|
|
@@ -117,14 +136,12 @@ class ApiKeyResponse(BaseModel):
|
|
|
117
136
|
frozen=False,
|
|
118
137
|
)
|
|
119
138
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
created_by_email: Any = ...
|
|
127
|
-
created_at: Any = ...
|
|
139
|
+
workspace: str | None = None
|
|
140
|
+
type: AlertType | None = Field(None, description='* `machine_offline` - Machine Offline\n* `task_failed` - Task Failed\n* `schedule_error` - Schedule Error')
|
|
141
|
+
title: str | None = Field(None, min_length=1, max_length=200)
|
|
142
|
+
message: str | None = Field(None, min_length=1)
|
|
143
|
+
machine: str | None = None
|
|
144
|
+
read: bool | None = None
|
|
128
145
|
|
|
129
146
|
|
|
130
147
|
|
|
@@ -145,39 +162,17 @@ class ApiKey(BaseModel):
|
|
|
145
162
|
workspace: Any = ...
|
|
146
163
|
name: Any = Field(description='Descriptive name for this API key')
|
|
147
164
|
key_prefix: Any = Field(description='First 12 characters for display')
|
|
148
|
-
last_used: Any | None =
|
|
149
|
-
created_by: int | None =
|
|
165
|
+
last_used: Any | None = None
|
|
166
|
+
created_by: int | None = None
|
|
150
167
|
created_by_email: Any = ...
|
|
151
168
|
created_at: Any = ...
|
|
152
169
|
|
|
153
170
|
|
|
154
171
|
|
|
155
|
-
class
|
|
156
|
-
"""
|
|
157
|
-
Serializer for creating alerts.
|
|
158
|
-
|
|
159
|
-
Request model (no read-only fields).
|
|
160
|
-
"""
|
|
161
|
-
|
|
162
|
-
model_config = ConfigDict(
|
|
163
|
-
validate_assignment=True,
|
|
164
|
-
extra="allow",
|
|
165
|
-
frozen=False,
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
workspace: str = ...
|
|
169
|
-
type: AlertCreateRequestType = Field(description='* `machine_offline` - Machine Offline\n* `task_failed` - Task Failed\n* `schedule_error` - Schedule Error')
|
|
170
|
-
title: str = Field(min_length=1, max_length=200)
|
|
171
|
-
message: str = Field(min_length=1)
|
|
172
|
-
machine: str | None = None
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
class AlertRequest(BaseModel):
|
|
172
|
+
class PaginatedApiKeyList(BaseModel):
|
|
177
173
|
"""
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
Request model (no read-only fields).
|
|
174
|
+
|
|
175
|
+
Response model (includes read-only fields).
|
|
181
176
|
"""
|
|
182
177
|
|
|
183
178
|
model_config = ConfigDict(
|
|
@@ -186,18 +181,21 @@ class AlertRequest(BaseModel):
|
|
|
186
181
|
frozen=False,
|
|
187
182
|
)
|
|
188
183
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
184
|
+
count: int = Field(description='Total number of items across all pages')
|
|
185
|
+
page: int = Field(description='Current page number (1-based)')
|
|
186
|
+
pages: int = Field(description='Total number of pages')
|
|
187
|
+
page_size: int = Field(description='Number of items per page')
|
|
188
|
+
has_next: bool = Field(description='Whether there is a next page')
|
|
189
|
+
has_previous: bool = Field(description='Whether there is a previous page')
|
|
190
|
+
next_page: int | None = Field(None, description='Next page number (null if no next page)')
|
|
191
|
+
previous_page: int | None = Field(None, description='Previous page number (null if no previous page)')
|
|
192
|
+
results: list[ApiKey] = Field(description='Array of items for current page')
|
|
195
193
|
|
|
196
194
|
|
|
197
195
|
|
|
198
|
-
class
|
|
196
|
+
class ApiKeyCreateRequest(BaseModel):
|
|
199
197
|
"""
|
|
200
|
-
Serializer for
|
|
198
|
+
Serializer for creating new API key.
|
|
201
199
|
|
|
202
200
|
Request model (no read-only fields).
|
|
203
201
|
"""
|
|
@@ -208,20 +206,16 @@ class PatchedAlertRequest(BaseModel):
|
|
|
208
206
|
frozen=False,
|
|
209
207
|
)
|
|
210
208
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
title: str = Field(None, min_length=1, max_length=200)
|
|
214
|
-
message: str = Field(None, min_length=1)
|
|
215
|
-
machine: str | None = None
|
|
216
|
-
read: bool = None
|
|
209
|
+
name: str = Field(description='Descriptive name for this API key', min_length=1, max_length=100)
|
|
210
|
+
workspace: str = Field(description='Workspace ID')
|
|
217
211
|
|
|
218
212
|
|
|
219
213
|
|
|
220
|
-
class
|
|
214
|
+
class ApiKeyResponse(BaseModel):
|
|
221
215
|
"""
|
|
222
|
-
|
|
216
|
+
Response serializer that includes raw key (shown only once).
|
|
223
217
|
|
|
224
|
-
|
|
218
|
+
Response model (includes read-only fields).
|
|
225
219
|
"""
|
|
226
220
|
|
|
227
221
|
model_config = ConfigDict(
|
|
@@ -230,8 +224,14 @@ class ApiKeyCreateRequest(BaseModel):
|
|
|
230
224
|
frozen=False,
|
|
231
225
|
)
|
|
232
226
|
|
|
233
|
-
|
|
234
|
-
workspace:
|
|
227
|
+
id: Any = ...
|
|
228
|
+
workspace: Any = ...
|
|
229
|
+
name: Any = Field(description='Descriptive name for this API key')
|
|
230
|
+
key_prefix: Any = Field(description='First 12 characters for display')
|
|
231
|
+
raw_key: Any = ...
|
|
232
|
+
created_by: int | None = None
|
|
233
|
+
created_by_email: Any = ...
|
|
234
|
+
created_at: Any = ...
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
|
|
@@ -12,13 +12,18 @@ class SyncSystemSystemAPI:
|
|
|
12
12
|
"""Initialize sync sub-client with shared httpx client."""
|
|
13
13
|
self._client = client
|
|
14
14
|
|
|
15
|
-
def alerts_list(self, page: int | None = None, page_size: int | None = None, read: bool | None = None, type: str | None = None, workspace: str | None = None) -> list[PaginatedAlertList]:
|
|
15
|
+
def alerts_list(self, ordering: str | None = None, page: int | None = None, page_size: int | None = None, read: bool | None = None, search: str | None = None, type: str | None = None, workspace: str | None = None) -> list[PaginatedAlertList]:
|
|
16
16
|
"""
|
|
17
17
|
List alerts with filters.
|
|
18
18
|
"""
|
|
19
19
|
url = "/api/system/alerts/"
|
|
20
|
-
response = self._client.get(url, params={"page": page if page is not None else None, "page_size": page_size if page_size is not None else None, "read": read if read is not None else None, "type": type if type is not None else None, "workspace": workspace if workspace is not None else None})
|
|
21
|
-
response.
|
|
20
|
+
response = self._client.get(url, params={"ordering": ordering if ordering is not None else None, "page": page if page is not None else None, "page_size": page_size if page_size is not None else None, "read": read if read is not None else None, "search": search if search is not None else None, "type": type if type is not None else None, "workspace": workspace if workspace is not None else None})
|
|
21
|
+
if not response.is_success:
|
|
22
|
+
try:
|
|
23
|
+
error_body = response.json()
|
|
24
|
+
except Exception:
|
|
25
|
+
error_body = response.text
|
|
26
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
22
27
|
return PaginatedAlertList.model_validate(response.json())
|
|
23
28
|
|
|
24
29
|
|
|
@@ -28,7 +33,12 @@ class SyncSystemSystemAPI:
|
|
|
28
33
|
"""
|
|
29
34
|
url = "/api/system/alerts/"
|
|
30
35
|
response = self._client.post(url, json=data.model_dump(exclude_unset=True))
|
|
31
|
-
response.
|
|
36
|
+
if not response.is_success:
|
|
37
|
+
try:
|
|
38
|
+
error_body = response.json()
|
|
39
|
+
except Exception:
|
|
40
|
+
error_body = response.text
|
|
41
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
32
42
|
return AlertCreate.model_validate(response.json())
|
|
33
43
|
|
|
34
44
|
|
|
@@ -38,7 +48,12 @@ class SyncSystemSystemAPI:
|
|
|
38
48
|
"""
|
|
39
49
|
url = f"/api/system/alerts/{id}/"
|
|
40
50
|
response = self._client.get(url)
|
|
41
|
-
response.
|
|
51
|
+
if not response.is_success:
|
|
52
|
+
try:
|
|
53
|
+
error_body = response.json()
|
|
54
|
+
except Exception:
|
|
55
|
+
error_body = response.text
|
|
56
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
42
57
|
return Alert.model_validate(response.json())
|
|
43
58
|
|
|
44
59
|
|
|
@@ -48,7 +63,12 @@ class SyncSystemSystemAPI:
|
|
|
48
63
|
"""
|
|
49
64
|
url = f"/api/system/alerts/{id}/"
|
|
50
65
|
response = self._client.put(url, json=data.model_dump(exclude_unset=True))
|
|
51
|
-
response.
|
|
66
|
+
if not response.is_success:
|
|
67
|
+
try:
|
|
68
|
+
error_body = response.json()
|
|
69
|
+
except Exception:
|
|
70
|
+
error_body = response.text
|
|
71
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
52
72
|
return Alert.model_validate(response.json())
|
|
53
73
|
|
|
54
74
|
|
|
@@ -58,7 +78,12 @@ class SyncSystemSystemAPI:
|
|
|
58
78
|
"""
|
|
59
79
|
url = f"/api/system/alerts/{id}/"
|
|
60
80
|
response = self._client.patch(url, json=data.model_dump(exclude_unset=True) if data is not None else None)
|
|
61
|
-
response.
|
|
81
|
+
if not response.is_success:
|
|
82
|
+
try:
|
|
83
|
+
error_body = response.json()
|
|
84
|
+
except Exception:
|
|
85
|
+
error_body = response.text
|
|
86
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
62
87
|
return Alert.model_validate(response.json())
|
|
63
88
|
|
|
64
89
|
|
|
@@ -68,7 +93,12 @@ class SyncSystemSystemAPI:
|
|
|
68
93
|
"""
|
|
69
94
|
url = f"/api/system/alerts/{id}/"
|
|
70
95
|
response = self._client.delete(url)
|
|
71
|
-
response.
|
|
96
|
+
if not response.is_success:
|
|
97
|
+
try:
|
|
98
|
+
error_body = response.json()
|
|
99
|
+
except Exception:
|
|
100
|
+
error_body = response.text
|
|
101
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
72
102
|
|
|
73
103
|
|
|
74
104
|
def alerts_mark_as_read_create(self, id: str) -> Alert:
|
|
@@ -77,7 +107,12 @@ class SyncSystemSystemAPI:
|
|
|
77
107
|
"""
|
|
78
108
|
url = f"/api/system/alerts/{id}/mark-as-read/"
|
|
79
109
|
response = self._client.post(url)
|
|
80
|
-
response.
|
|
110
|
+
if not response.is_success:
|
|
111
|
+
try:
|
|
112
|
+
error_body = response.json()
|
|
113
|
+
except Exception:
|
|
114
|
+
error_body = response.text
|
|
115
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
81
116
|
return Alert.model_validate(response.json())
|
|
82
117
|
|
|
83
118
|
|
|
@@ -87,16 +122,26 @@ class SyncSystemSystemAPI:
|
|
|
87
122
|
"""
|
|
88
123
|
url = "/api/system/alerts/mark-all-as-read/"
|
|
89
124
|
response = self._client.post(url)
|
|
90
|
-
response.
|
|
125
|
+
if not response.is_success:
|
|
126
|
+
try:
|
|
127
|
+
error_body = response.json()
|
|
128
|
+
except Exception:
|
|
129
|
+
error_body = response.text
|
|
130
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
91
131
|
|
|
92
132
|
|
|
93
|
-
def api_keys_list(self, page: int | None = None, page_size: int | None = None, workspace: str | None = None) -> list[PaginatedApiKeyList]:
|
|
133
|
+
def api_keys_list(self, ordering: str | None = None, page: int | None = None, page_size: int | None = None, search: str | None = None, workspace: str | None = None) -> list[PaginatedApiKeyList]:
|
|
94
134
|
"""
|
|
95
135
|
List API keys with filters.
|
|
96
136
|
"""
|
|
97
137
|
url = "/api/system/api-keys/"
|
|
98
|
-
response = self._client.get(url, params={"page": page if page is not None else None, "page_size": page_size if page_size is not None else None, "workspace": workspace if workspace is not None else None})
|
|
99
|
-
response.
|
|
138
|
+
response = self._client.get(url, params={"ordering": ordering if ordering is not None else None, "page": page if page is not None else None, "page_size": page_size if page_size is not None else None, "search": search if search is not None else None, "workspace": workspace if workspace is not None else None})
|
|
139
|
+
if not response.is_success:
|
|
140
|
+
try:
|
|
141
|
+
error_body = response.json()
|
|
142
|
+
except Exception:
|
|
143
|
+
error_body = response.text
|
|
144
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
100
145
|
return PaginatedApiKeyList.model_validate(response.json())
|
|
101
146
|
|
|
102
147
|
|
|
@@ -106,7 +151,12 @@ class SyncSystemSystemAPI:
|
|
|
106
151
|
"""
|
|
107
152
|
url = "/api/system/api-keys/"
|
|
108
153
|
response = self._client.post(url, json=data.model_dump(exclude_unset=True))
|
|
109
|
-
response.
|
|
154
|
+
if not response.is_success:
|
|
155
|
+
try:
|
|
156
|
+
error_body = response.json()
|
|
157
|
+
except Exception:
|
|
158
|
+
error_body = response.text
|
|
159
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
110
160
|
return ApiKeyResponse.model_validate(response.json())
|
|
111
161
|
|
|
112
162
|
|
|
@@ -117,7 +167,12 @@ class SyncSystemSystemAPI:
|
|
|
117
167
|
"""
|
|
118
168
|
url = f"/api/system/api-keys/{id}/"
|
|
119
169
|
response = self._client.get(url)
|
|
120
|
-
response.
|
|
170
|
+
if not response.is_success:
|
|
171
|
+
try:
|
|
172
|
+
error_body = response.json()
|
|
173
|
+
except Exception:
|
|
174
|
+
error_body = response.text
|
|
175
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
121
176
|
return ApiKey.model_validate(response.json())
|
|
122
177
|
|
|
123
178
|
|
|
@@ -128,7 +183,12 @@ class SyncSystemSystemAPI:
|
|
|
128
183
|
"""
|
|
129
184
|
url = f"/api/system/api-keys/{id}/"
|
|
130
185
|
response = self._client.put(url)
|
|
131
|
-
response.
|
|
186
|
+
if not response.is_success:
|
|
187
|
+
try:
|
|
188
|
+
error_body = response.json()
|
|
189
|
+
except Exception:
|
|
190
|
+
error_body = response.text
|
|
191
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
132
192
|
return ApiKey.model_validate(response.json())
|
|
133
193
|
|
|
134
194
|
|
|
@@ -139,7 +199,12 @@ class SyncSystemSystemAPI:
|
|
|
139
199
|
"""
|
|
140
200
|
url = f"/api/system/api-keys/{id}/"
|
|
141
201
|
response = self._client.patch(url)
|
|
142
|
-
response.
|
|
202
|
+
if not response.is_success:
|
|
203
|
+
try:
|
|
204
|
+
error_body = response.json()
|
|
205
|
+
except Exception:
|
|
206
|
+
error_body = response.text
|
|
207
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
143
208
|
return ApiKey.model_validate(response.json())
|
|
144
209
|
|
|
145
210
|
|
|
@@ -150,7 +215,12 @@ class SyncSystemSystemAPI:
|
|
|
150
215
|
"""
|
|
151
216
|
url = f"/api/system/api-keys/{id}/"
|
|
152
217
|
response = self._client.delete(url)
|
|
153
|
-
response.
|
|
218
|
+
if not response.is_success:
|
|
219
|
+
try:
|
|
220
|
+
error_body = response.json()
|
|
221
|
+
except Exception:
|
|
222
|
+
error_body = response.text
|
|
223
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
154
224
|
|
|
155
225
|
|
|
156
226
|
def api_keys_regenerate_create(self, id: str) -> ApiKeyResponse:
|
|
@@ -159,7 +229,12 @@ class SyncSystemSystemAPI:
|
|
|
159
229
|
"""
|
|
160
230
|
url = f"/api/system/api-keys/{id}/regenerate/"
|
|
161
231
|
response = self._client.post(url)
|
|
162
|
-
response.
|
|
232
|
+
if not response.is_success:
|
|
233
|
+
try:
|
|
234
|
+
error_body = response.json()
|
|
235
|
+
except Exception:
|
|
236
|
+
error_body = response.text
|
|
237
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
163
238
|
return ApiKeyResponse.model_validate(response.json())
|
|
164
239
|
|
|
165
240
|
|
|
@@ -36,7 +36,7 @@ from .retry import RetryConfig
|
|
|
36
36
|
from .workspaces__api__workspaces import WorkspacesWorkspacesAPI
|
|
37
37
|
from . import enums
|
|
38
38
|
# NOTE: Individual enum imports commented out due to invalid Python syntax with dotted names
|
|
39
|
-
# from .enums import PatchedWorkspaceMemberRequest.role, PatchedWorkspaceRequest.plan, PatchedWorkspaceRequest.type,
|
|
39
|
+
# from .enums import PatchedWorkspaceMemberRequest.role, PatchedWorkspaceRequest.plan, PatchedWorkspaceRequest.type, WorkspaceInvitation.role, WorkspaceInvitation.status, WorkspaceInvitationCreateRequest.role
|
|
40
40
|
|
|
41
41
|
TOKEN_KEY = "auth_token"
|
|
42
42
|
REFRESH_TOKEN_KEY = "refresh_token"
|
|
@@ -45,54 +45,6 @@ class PatchedWorkspaceRequestPlan(StrEnum):
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
class WorkspaceType(StrEnum):
|
|
49
|
-
"""
|
|
50
|
-
* `personal` - Personal
|
|
51
|
-
* `team` - Team
|
|
52
|
-
"""
|
|
53
|
-
|
|
54
|
-
PERSONAL = "personal"
|
|
55
|
-
TEAM = "team"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class WorkspacePlan(StrEnum):
|
|
60
|
-
"""
|
|
61
|
-
* `free` - Free
|
|
62
|
-
* `pro` - Pro
|
|
63
|
-
* `enterprise` - Enterprise
|
|
64
|
-
"""
|
|
65
|
-
|
|
66
|
-
FREE = "free"
|
|
67
|
-
PRO = "pro"
|
|
68
|
-
ENTERPRISE = "enterprise"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
class WorkspaceCreateRequestType(StrEnum):
|
|
73
|
-
"""
|
|
74
|
-
* `personal` - Personal
|
|
75
|
-
* `team` - Team
|
|
76
|
-
"""
|
|
77
|
-
|
|
78
|
-
PERSONAL = "personal"
|
|
79
|
-
TEAM = "team"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
class WorkspaceCreateRequestPlan(StrEnum):
|
|
84
|
-
"""
|
|
85
|
-
* `free` - Free
|
|
86
|
-
* `pro` - Pro
|
|
87
|
-
* `enterprise` - Enterprise
|
|
88
|
-
"""
|
|
89
|
-
|
|
90
|
-
FREE = "free"
|
|
91
|
-
PRO = "pro"
|
|
92
|
-
ENTERPRISE = "enterprise"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
48
|
class WorkspaceInvitationRole(StrEnum):
|
|
97
49
|
"""
|
|
98
50
|
* `admin` - Admin
|
|
@@ -132,92 +84,3 @@ class WorkspaceInvitationCreateRequestRole(StrEnum):
|
|
|
132
84
|
|
|
133
85
|
|
|
134
86
|
|
|
135
|
-
class WorkspaceInvitationPublicRole(StrEnum):
|
|
136
|
-
"""
|
|
137
|
-
* `admin` - Admin
|
|
138
|
-
* `member` - Member
|
|
139
|
-
"""
|
|
140
|
-
|
|
141
|
-
ADMIN = "admin"
|
|
142
|
-
MEMBER = "member"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
class WorkspaceInvitationPublicStatus(StrEnum):
|
|
147
|
-
"""
|
|
148
|
-
* `pending` - Pending
|
|
149
|
-
* `accepted` - Accepted
|
|
150
|
-
* `declined` - Declined
|
|
151
|
-
* `expired` - Expired
|
|
152
|
-
* `cancelled` - Cancelled
|
|
153
|
-
"""
|
|
154
|
-
|
|
155
|
-
PENDING = "pending"
|
|
156
|
-
ACCEPTED = "accepted"
|
|
157
|
-
DECLINED = "declined"
|
|
158
|
-
EXPIRED = "expired"
|
|
159
|
-
CANCELLED = "cancelled"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
class WorkspaceInvitationRequestRole(StrEnum):
|
|
164
|
-
"""
|
|
165
|
-
* `admin` - Admin
|
|
166
|
-
* `member` - Member
|
|
167
|
-
"""
|
|
168
|
-
|
|
169
|
-
ADMIN = "admin"
|
|
170
|
-
MEMBER = "member"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
class WorkspaceMemberRole(StrEnum):
|
|
175
|
-
"""
|
|
176
|
-
* `owner` - Owner
|
|
177
|
-
* `admin` - Admin
|
|
178
|
-
* `member` - Member
|
|
179
|
-
"""
|
|
180
|
-
|
|
181
|
-
OWNER = "owner"
|
|
182
|
-
ADMIN = "admin"
|
|
183
|
-
MEMBER = "member"
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
class WorkspaceMemberRequestRole(StrEnum):
|
|
188
|
-
"""
|
|
189
|
-
* `owner` - Owner
|
|
190
|
-
* `admin` - Admin
|
|
191
|
-
* `member` - Member
|
|
192
|
-
"""
|
|
193
|
-
|
|
194
|
-
OWNER = "owner"
|
|
195
|
-
ADMIN = "admin"
|
|
196
|
-
MEMBER = "member"
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
class WorkspaceRequestType(StrEnum):
|
|
201
|
-
"""
|
|
202
|
-
* `personal` - Personal
|
|
203
|
-
* `team` - Team
|
|
204
|
-
"""
|
|
205
|
-
|
|
206
|
-
PERSONAL = "personal"
|
|
207
|
-
TEAM = "team"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
class WorkspaceRequestPlan(StrEnum):
|
|
212
|
-
"""
|
|
213
|
-
* `free` - Free
|
|
214
|
-
* `pro` - Pro
|
|
215
|
-
* `enterprise` - Enterprise
|
|
216
|
-
"""
|
|
217
|
-
|
|
218
|
-
FREE = "free"
|
|
219
|
-
PRO = "pro"
|
|
220
|
-
ENTERPRISE = "enterprise"
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|