arthur-client 0.12.0__tar.gz → 1.0.0__tar.gz
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.
- {arthur-client-0.12.0 → arthur-client-1.0.0}/PKG-INFO +1 -1
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/auth/helpers.py +6 -3
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/__init__.py +2 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/admin/client.py +0 -142
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/admin/models.py +23 -285
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/alerts/models.py +47 -47
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/bench/models.py +5 -1
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/client.py +3 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/common/models.py +24 -24
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/enrichments/models.py +46 -46
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/inferences/models.py +20 -20
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/insights/models.py +8 -8
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/metrics/models.py +38 -38
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/model_groups/models.py +1 -1
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/models/client.py +72 -10
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/models/models.py +84 -66
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/query/models.py +13 -13
- arthur-client-1.0.0/arthur/client/rest/users/__init__.py +2 -0
- arthur-client-1.0.0/arthur/client/rest/users/client.py +171 -0
- arthur-client-1.0.0/arthur/client/rest/users/models.py +317 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/version.py +1 -1
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur_client.egg-info/PKG-INFO +1 -1
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur_client.egg-info/SOURCES.txt +3 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/LICENSE +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/README.md +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/auth/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/auth/refresh.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/helpers.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/http/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/http/helper.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/http/requests.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/http/validation.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/admin/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/alerts/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/alerts/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/bench/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/bench/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/common/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/common/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/enrichments/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/enrichments/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/inferences/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/inferences/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/insights/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/insights/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/metrics/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/metrics/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/model_groups/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/model_groups/client.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/models/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/query/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/rest/query/client.py +1 -1
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/client/types.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/common/__init__.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/common/constants.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/common/exceptions.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur/common/log.py +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur_client.egg-info/dependency_links.txt +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur_client.egg-info/requires.txt +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/arthur_client.egg-info/top_level.txt +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/client-readme-public.md +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/pyproject.toml +0 -0
- {arthur-client-0.12.0 → arthur-client-1.0.0}/setup.cfg +0 -0
@@ -4,7 +4,9 @@ import requests
|
|
4
4
|
|
5
5
|
from arthur.client.http.requests import HTTPClient
|
6
6
|
from arthur.client.rest.admin.client import ArthurAdminClient
|
7
|
-
from arthur.client.rest.admin.models import LoginRequest
|
7
|
+
from arthur.client.rest.admin.models import LoginRequest
|
8
|
+
from arthur.client.rest.users.client import ArthurUsersClient
|
9
|
+
from arthur.client.rest.users.models import AuthenticationInfo
|
8
10
|
from arthur.common.exceptions import (
|
9
11
|
UserValueError,
|
10
12
|
ForbiddenError,
|
@@ -55,15 +57,16 @@ def get_auth_info(
|
|
55
57
|
:return: the AuthInfo associated with the provided access key
|
56
58
|
:permissions: N/A
|
57
59
|
"""
|
58
|
-
|
60
|
+
users_client = ArthurUsersClient(
|
59
61
|
HTTPClient(
|
60
62
|
base_url=api_http_host,
|
61
63
|
verify_ssl=verify_ssl,
|
62
64
|
default_headers={"Authorization": auth_token},
|
63
65
|
)
|
64
66
|
)
|
67
|
+
|
65
68
|
try:
|
66
|
-
auth_info =
|
69
|
+
auth_info = users_client.authenticate()
|
67
70
|
except requests.exceptions.SSLError as e:
|
68
71
|
raise UserValueError(
|
69
72
|
f"""SSL Error connecting to {api_http_host}, please connect to a secure server or use
|
@@ -7,30 +7,22 @@ from requests import Response
|
|
7
7
|
from arthur.client.http.requests import HTTPClient
|
8
8
|
|
9
9
|
from arthur.client.rest.admin.models import (
|
10
|
-
AuthenticationInfo,
|
11
10
|
CustomRBACRequest,
|
12
|
-
InviteRequest,
|
13
|
-
InviteResponse,
|
14
11
|
LoginRequest,
|
15
12
|
NewOrganizationRequest,
|
16
|
-
NewUserRequest,
|
17
13
|
OrgExpand,
|
18
14
|
Organization,
|
19
15
|
OrganizationLimits,
|
20
16
|
OrganizationUsage,
|
21
17
|
PaginatedOrganizations,
|
22
18
|
PaginatedUsageResponse,
|
23
|
-
PaginatedUsers,
|
24
19
|
PermissionRequest,
|
25
20
|
RolesRequest,
|
26
21
|
SetCurrentOrganizationRequest,
|
27
|
-
UpdateCurrentUserRequest,
|
28
22
|
UpdateOrganizationRequest,
|
29
|
-
UpdateUserRequest,
|
30
23
|
UsageCategory,
|
31
24
|
UsageRollups,
|
32
25
|
User,
|
33
|
-
UserResponse,
|
34
26
|
)
|
35
27
|
|
36
28
|
|
@@ -66,17 +58,6 @@ class ArthurAdminClient:
|
|
66
58
|
)
|
67
59
|
return User(**raw_resp.json()), raw_resp.cookies
|
68
60
|
|
69
|
-
def authenticate(self) -> AuthenticationInfo:
|
70
|
-
"""
|
71
|
-
Returns authentication info for the calling, token-bearing user
|
72
|
-
|
73
|
-
"""
|
74
|
-
|
75
|
-
parsed_resp: Dict[str, Any] = self.http_client.get( # type: ignore
|
76
|
-
f"/v3/users/me/auth_info", validation_response_code=200
|
77
|
-
)
|
78
|
-
return AuthenticationInfo(**parsed_resp)
|
79
|
-
|
80
61
|
def get_paginated_organizations(
|
81
62
|
self,
|
82
63
|
name: Optional[str] = None,
|
@@ -237,129 +218,6 @@ class ArthurAdminClient:
|
|
237
218
|
)
|
238
219
|
return List[Organization](**parsed_resp)
|
239
220
|
|
240
|
-
def get_paginated_users(
|
241
|
-
self,
|
242
|
-
page: Optional[int] = None,
|
243
|
-
page_size: Optional[int] = None,
|
244
|
-
sort: Optional[str] = None,
|
245
|
-
) -> PaginatedUsers:
|
246
|
-
"""
|
247
|
-
Returns a paginated list of users
|
248
|
-
|
249
|
-
:param page:
|
250
|
-
:param page_size:
|
251
|
-
:param sort: Must be supplied in the format [column_name] to denote asc sort by this column OR -[column_name] to denote desc sort by this column
|
252
|
-
"""
|
253
|
-
|
254
|
-
params: Dict[str, Any] = {}
|
255
|
-
if page is not None:
|
256
|
-
params["page"] = page
|
257
|
-
if page_size is not None:
|
258
|
-
params["page_size"] = page_size
|
259
|
-
if sort is not None:
|
260
|
-
params["sort"] = sort
|
261
|
-
|
262
|
-
parsed_resp: Dict[str, Any] = self.http_client.get( # type: ignore
|
263
|
-
f"/v3/users", params=params, validation_response_code=200
|
264
|
-
)
|
265
|
-
return PaginatedUsers(**parsed_resp)
|
266
|
-
|
267
|
-
def create_user(self, json_body: NewUserRequest) -> User:
|
268
|
-
"""
|
269
|
-
Creates a new user
|
270
|
-
|
271
|
-
:param json_body:
|
272
|
-
"""
|
273
|
-
|
274
|
-
parsed_resp: Dict[str, Any] = self.http_client.post( # type: ignore
|
275
|
-
f"/v3/users",
|
276
|
-
json=json_body.dict(by_alias=True, exclude_none=True),
|
277
|
-
validation_response_code=201,
|
278
|
-
)
|
279
|
-
return User(**parsed_resp)
|
280
|
-
|
281
|
-
def get_current_user(self) -> UserResponse:
|
282
|
-
"""
|
283
|
-
Returns the currently authenticated user
|
284
|
-
|
285
|
-
"""
|
286
|
-
|
287
|
-
parsed_resp: Dict[str, Any] = self.http_client.get( # type: ignore
|
288
|
-
f"/v3/users/me", validation_response_code=200
|
289
|
-
)
|
290
|
-
return UserResponse(**parsed_resp)
|
291
|
-
|
292
|
-
def update_current_user(self, json_body: UpdateCurrentUserRequest) -> UserResponse:
|
293
|
-
"""
|
294
|
-
Updates the currently authenticated user
|
295
|
-
|
296
|
-
:param json_body:
|
297
|
-
"""
|
298
|
-
|
299
|
-
parsed_resp: Dict[str, Any] = self.http_client.patch( # type: ignore
|
300
|
-
f"/v3/users/me",
|
301
|
-
json=json_body.dict(by_alias=True, exclude_none=True),
|
302
|
-
validation_response_code=200,
|
303
|
-
)
|
304
|
-
return UserResponse(**parsed_resp)
|
305
|
-
|
306
|
-
def get_user_by_id(self, user_id: str) -> User:
|
307
|
-
"""
|
308
|
-
Returns a single user
|
309
|
-
|
310
|
-
:param user_id:
|
311
|
-
"""
|
312
|
-
|
313
|
-
parsed_resp: Dict[str, Any] = self.http_client.get( # type: ignore
|
314
|
-
f"/v3/users/{user_id}", validation_response_code=200
|
315
|
-
)
|
316
|
-
return User(**parsed_resp)
|
317
|
-
|
318
|
-
def delete_user(self, user_id: str) -> Response:
|
319
|
-
"""
|
320
|
-
Deletes a user (by marking them as inactive) and invalidates any existing api keys
|
321
|
-
|
322
|
-
:param user_id:
|
323
|
-
"""
|
324
|
-
|
325
|
-
raw_resp: Response = self.http_client.delete( # type: ignore
|
326
|
-
f"/v3/users/{user_id}",
|
327
|
-
validation_response_code=204,
|
328
|
-
return_raw_response=True,
|
329
|
-
)
|
330
|
-
return raw_resp
|
331
|
-
|
332
|
-
def update_user(self, user_id: str, json_body: UpdateUserRequest) -> User:
|
333
|
-
"""
|
334
|
-
Updates a user
|
335
|
-
|
336
|
-
Request to update the password must include the old password unless a super admin is making the request.
|
337
|
-
|
338
|
-
:param user_id:
|
339
|
-
:param json_body:
|
340
|
-
"""
|
341
|
-
|
342
|
-
parsed_resp: Dict[str, Any] = self.http_client.patch( # type: ignore
|
343
|
-
f"/v3/users/{user_id}",
|
344
|
-
json=json_body.dict(by_alias=True, exclude_none=True),
|
345
|
-
validation_response_code=200,
|
346
|
-
)
|
347
|
-
return User(**parsed_resp)
|
348
|
-
|
349
|
-
def send_user_invites(self, json_body: InviteRequest) -> InviteResponse:
|
350
|
-
"""
|
351
|
-
Send email invitations to have users join the requesters organization
|
352
|
-
|
353
|
-
:param json_body:
|
354
|
-
"""
|
355
|
-
|
356
|
-
parsed_resp: Dict[str, Any] = self.http_client.post( # type: ignore
|
357
|
-
f"/v3/users/invite_users",
|
358
|
-
json=json_body.dict(by_alias=True, exclude_none=True),
|
359
|
-
validation_response_code=200,
|
360
|
-
)
|
361
|
-
return InviteResponse(**parsed_resp)
|
362
|
-
|
363
221
|
def authorize_user_caller(self, json_body: PermissionRequest) -> Response:
|
364
222
|
"""
|
365
223
|
Endpoint for validating a requesting caller has the permissions on the supplied action and resource
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# generated by datamodel-codegen:
|
2
2
|
# filename: admin.yaml
|
3
|
-
# timestamp:
|
3
|
+
# timestamp: 2024-01-09T15:45:36+00:00
|
4
4
|
|
5
5
|
from __future__ import annotations
|
6
6
|
|
7
7
|
from datetime import datetime
|
8
8
|
from enum import Enum
|
9
|
-
from typing import Any,
|
9
|
+
from typing import Any, List, Optional
|
10
10
|
from uuid import UUID
|
11
11
|
|
12
12
|
from arthur.client.rest.common.models import Page, PageSize, TotalCount, TotalPages
|
@@ -25,43 +25,8 @@ class PermissionRequest(BaseModel):
|
|
25
25
|
|
26
26
|
|
27
27
|
class UsageRollups(str, Enum):
|
28
|
-
Organization =
|
29
|
-
Model =
|
30
|
-
|
31
|
-
|
32
|
-
class UpdateCurrentUserRequest(BaseModel):
|
33
|
-
old_password: Optional[str] = None
|
34
|
-
"""
|
35
|
-
The user's old password.
|
36
|
-
"""
|
37
|
-
new_password: Optional[str] = None
|
38
|
-
"""
|
39
|
-
The user's new password
|
40
|
-
"""
|
41
|
-
first_name: Optional[str] = None
|
42
|
-
"""
|
43
|
-
The user's first name
|
44
|
-
"""
|
45
|
-
last_name: Optional[str] = None
|
46
|
-
"""
|
47
|
-
The user's last name
|
48
|
-
"""
|
49
|
-
email: Optional[str] = None
|
50
|
-
"""
|
51
|
-
The user's email
|
52
|
-
"""
|
53
|
-
username: Optional[str] = None
|
54
|
-
"""
|
55
|
-
The username the user will use to login
|
56
|
-
"""
|
57
|
-
show_intro_sequence: Optional[bool] = None
|
58
|
-
"""
|
59
|
-
Used by the Arthur dashboard to determine whether the user should be shown the intro sequence upon login
|
60
|
-
"""
|
61
|
-
help_mode_enabled: Optional[bool] = None
|
62
|
-
"""
|
63
|
-
Used by the Arthur dashboard to determine whether or not to show dashboard tooltips
|
64
|
-
"""
|
28
|
+
Organization = "organization"
|
29
|
+
Model = "model"
|
65
30
|
|
66
31
|
|
67
32
|
class RolesRequest(BaseModel):
|
@@ -75,59 +40,12 @@ class RolesRequest(BaseModel):
|
|
75
40
|
"""
|
76
41
|
|
77
42
|
|
78
|
-
class UpdateUserRequest(BaseModel):
|
79
|
-
old_password: Optional[str] = None
|
80
|
-
"""
|
81
|
-
The user's old password. Not required to update the password if the caller is a super admin.
|
82
|
-
"""
|
83
|
-
new_password: Optional[str] = None
|
84
|
-
"""
|
85
|
-
The user's new password
|
86
|
-
"""
|
87
|
-
first_name: Optional[str] = None
|
88
|
-
"""
|
89
|
-
The user's first name
|
90
|
-
"""
|
91
|
-
last_name: Optional[str] = None
|
92
|
-
"""
|
93
|
-
The user's last name
|
94
|
-
"""
|
95
|
-
email: Optional[str] = None
|
96
|
-
"""
|
97
|
-
The user's email
|
98
|
-
"""
|
99
|
-
username: Optional[str] = None
|
100
|
-
"""
|
101
|
-
The username the user will use to login
|
102
|
-
"""
|
103
|
-
roles: Optional[List[str]] = None
|
104
|
-
show_intro_sequence: Optional[bool] = None
|
105
|
-
"""
|
106
|
-
Used by the Arthur dashboard to determine whether the user should be shown the intro sequence upon login
|
107
|
-
"""
|
108
|
-
help_mode_enabled: Optional[bool] = None
|
109
|
-
"""
|
110
|
-
Used by the Arthur dashboard to determine whether or not to show dashboard tooltips
|
111
|
-
"""
|
112
|
-
|
113
|
-
|
114
|
-
class UserContext(BaseModel):
|
115
|
-
name: Optional[str] = None
|
116
|
-
"""
|
117
|
-
Name of the context.
|
118
|
-
"""
|
119
|
-
id: Optional[str] = None
|
120
|
-
"""
|
121
|
-
UUID of the context.
|
122
|
-
"""
|
123
|
-
|
124
|
-
|
125
43
|
class UsageCategory(Enum):
|
126
|
-
Inferences =
|
127
|
-
Explanations =
|
128
|
-
Organization =
|
129
|
-
GroundTruth =
|
130
|
-
ReferenceData =
|
44
|
+
Inferences = "inferences"
|
45
|
+
Explanations = "explanations"
|
46
|
+
Organization = "organization"
|
47
|
+
GroundTruth = "ground_truth"
|
48
|
+
ReferenceData = "reference_data"
|
131
49
|
|
132
50
|
|
133
51
|
class User(BaseModel):
|
@@ -174,7 +92,7 @@ class User(BaseModel):
|
|
174
92
|
|
175
93
|
|
176
94
|
class UsageMetric(BaseModel):
|
177
|
-
name: str = Field(..., example=
|
95
|
+
name: str = Field(..., example="record_counts")
|
178
96
|
"""
|
179
97
|
Name of the metric. For inferences, explanations, and ground_truth this will be either bytes or record_count. For organizational metrics this will be user_count and/or model_count.
|
180
98
|
"""
|
@@ -190,7 +108,7 @@ class LoginRequest(BaseModel):
|
|
190
108
|
|
191
109
|
|
192
110
|
class LoginFailureResponse(BaseModel):
|
193
|
-
error: Optional[str] = Field(None, example=
|
111
|
+
error: Optional[str] = Field(None, example="unauthorized")
|
194
112
|
"""
|
195
113
|
Error message
|
196
114
|
"""
|
@@ -198,7 +116,7 @@ class LoginFailureResponse(BaseModel):
|
|
198
116
|
|
199
117
|
class LoginLockoutResponse(BaseModel):
|
200
118
|
error: Optional[str] = Field(
|
201
|
-
None, example=
|
119
|
+
None, example="User locked out, please try again after 10 minutes"
|
202
120
|
)
|
203
121
|
"""
|
204
122
|
Error message
|
@@ -207,7 +125,7 @@ class LoginLockoutResponse(BaseModel):
|
|
207
125
|
|
208
126
|
class OrganizationUsage(BaseModel):
|
209
127
|
organization_id: Optional[UUID] = Field(
|
210
|
-
None, example=
|
128
|
+
None, example="12345678-90ab-cdef-1234-567890abcdef"
|
211
129
|
)
|
212
130
|
"""
|
213
131
|
Unique UUID for the organization
|
@@ -264,17 +182,6 @@ class OrganizationUsage(BaseModel):
|
|
264
182
|
"""
|
265
183
|
|
266
184
|
|
267
|
-
class InviteResponse(BaseModel):
|
268
|
-
"""
|
269
|
-
returned if and only if return_direct_links is set to true; returns a map of emails to invite links
|
270
|
-
"""
|
271
|
-
|
272
|
-
user_invite_links: Optional[Dict[str, Any]] = None
|
273
|
-
"""
|
274
|
-
a mapping where each email signup is a key and its corresponding signup invite link is the value
|
275
|
-
"""
|
276
|
-
|
277
|
-
|
278
185
|
class RoleDefinitionRequest(BaseModel):
|
279
186
|
role_name: str
|
280
187
|
"""
|
@@ -295,12 +202,12 @@ class UsageData(BaseModel):
|
|
295
202
|
explanations: Optional[List[UsageMetric]] = None
|
296
203
|
organization: Optional[List[UsageMetric]] = None
|
297
204
|
ground_truth: Optional[List[UsageMetric]] = None
|
298
|
-
id: UUID = Field(..., example=
|
205
|
+
id: UUID = Field(..., example="19e2716a-02a0-4b52-9ff2-540c1e685be6")
|
299
206
|
"""
|
300
207
|
When rollup = "model", this will be the model id. When rollup = "organization", this will be the organization id.
|
301
208
|
"""
|
302
|
-
name: str = Field(..., example=
|
303
|
-
organization_id: UUID = Field(..., example=
|
209
|
+
name: str = Field(..., example="Model A")
|
210
|
+
organization_id: UUID = Field(..., example="dc355b20-9163-4619-a0b8-4bf2cd8d62d7")
|
304
211
|
"""
|
305
212
|
In the case where rollup = "model", this will be the organization id for the model referenced by "id". In the case where rollup = "organization", this will be the same value as the "id" field.
|
306
213
|
"""
|
@@ -308,12 +215,12 @@ class UsageData(BaseModel):
|
|
308
215
|
|
309
216
|
class OrganizationLimits(BaseModel):
|
310
217
|
organization_id: Optional[UUID] = Field(
|
311
|
-
None, example=
|
218
|
+
None, example="12345678-90ab-cdef-1234-567890abcdef"
|
312
219
|
)
|
313
220
|
"""
|
314
221
|
Unique UUID for the organization
|
315
222
|
"""
|
316
|
-
plan: Optional[str] = Field(None, example=
|
223
|
+
plan: Optional[str] = Field(None, example="enterprise")
|
317
224
|
"""
|
318
225
|
The organization's license plan for platform usage
|
319
226
|
"""
|
@@ -475,158 +382,10 @@ class OrganizationLimits(BaseModel):
|
|
475
382
|
"""
|
476
383
|
|
477
384
|
|
478
|
-
class AuthenticationInfo(BaseModel):
|
479
|
-
organization_ids: List[str]
|
480
|
-
"""
|
481
|
-
A list of organization IDs.
|
482
|
-
"""
|
483
|
-
issuer: str
|
484
|
-
"""
|
485
|
-
The identifier of the IDP managing this user.
|
486
|
-
"""
|
487
|
-
external_user_id: Optional[str] = None
|
488
|
-
"""
|
489
|
-
An identifier for an external-IdP token bearer. Populated if this user's token came from an IDP and the IDP configuration specified an oidc.CustomClaimNames that mapped UserID to a claim.
|
490
|
-
"""
|
491
|
-
internal_user_id: Optional[str] = None
|
492
|
-
"""
|
493
|
-
An identifier for an Arthur-internal user. Populated for Arthur-authenticated users with user tokens.
|
494
|
-
"""
|
495
|
-
service_account_id: Optional[str] = None
|
496
|
-
"""
|
497
|
-
An identifier for an Arthur service account. Populated for Arthur-authenticated service account tokens.
|
498
|
-
"""
|
499
|
-
username: str
|
500
|
-
"""
|
501
|
-
Either the Arthur username or the username specified by an external IDP. This will be set to arthur.ServiceAccountName for service account tokens.
|
502
|
-
"""
|
503
|
-
first_name: str
|
504
|
-
"""
|
505
|
-
The first name of the Arthur authenticated user, or the first name claim if the external IDP is configured with one.
|
506
|
-
"""
|
507
|
-
last_name: str
|
508
|
-
"""
|
509
|
-
The last name of the Arthur authenticated user, or the last name claim if the external IDP is configured with one.
|
510
|
-
"""
|
511
|
-
email: str
|
512
|
-
"""
|
513
|
-
The email of the Arthur authenticated user or the email of the external IDP user if the IDP is configured with that claim. For Arthur service accounts, this will be empty.
|
514
|
-
"""
|
515
|
-
roles: List[str]
|
516
|
-
"""
|
517
|
-
The list of roles that this user has. For Arthur tokens, there will always be one role in this array; however, there can be more than one for external providers.
|
518
|
-
"""
|
519
|
-
|
520
|
-
|
521
|
-
class NewUserRequest(BaseModel):
|
522
|
-
first_name: Optional[str] = None
|
523
|
-
"""
|
524
|
-
The user's first name
|
525
|
-
"""
|
526
|
-
last_name: Optional[str] = None
|
527
|
-
"""
|
528
|
-
The user's last name
|
529
|
-
"""
|
530
|
-
email: str
|
531
|
-
"""
|
532
|
-
The user's email
|
533
|
-
"""
|
534
|
-
username: str
|
535
|
-
"""
|
536
|
-
The username the user will use to login
|
537
|
-
"""
|
538
|
-
password: str
|
539
|
-
"""
|
540
|
-
The user's password
|
541
|
-
"""
|
542
|
-
roles: List[str]
|
543
|
-
"""
|
544
|
-
Available Standard Roles are [Administrator, Model Owner, User].
|
545
|
-
"""
|
546
|
-
alert_notifications_enabled: Optional[bool] = None
|
547
|
-
"""
|
548
|
-
Whether or not the user will receive email notifications when alerts are triggered, defaults to 'false'
|
549
|
-
"""
|
550
|
-
|
551
|
-
|
552
385
|
class SetCurrentOrganizationRequest(BaseModel):
|
553
386
|
organization_id: str
|
554
387
|
|
555
388
|
|
556
|
-
class UserResponse(BaseModel):
|
557
|
-
"""
|
558
|
-
Represents an application user, if the client is using a service token then only organization_id and roles will be populated in the object
|
559
|
-
"""
|
560
|
-
|
561
|
-
id: Optional[str] = None
|
562
|
-
"""
|
563
|
-
the unique id of the user
|
564
|
-
"""
|
565
|
-
organization_id: str
|
566
|
-
"""
|
567
|
-
The ID of the users current context
|
568
|
-
"""
|
569
|
-
organization_name: Optional[str] = None
|
570
|
-
"""
|
571
|
-
The name of the users current context
|
572
|
-
"""
|
573
|
-
first_name: Optional[str] = None
|
574
|
-
"""
|
575
|
-
The user's first name
|
576
|
-
"""
|
577
|
-
last_name: Optional[str] = None
|
578
|
-
"""
|
579
|
-
The user's last name
|
580
|
-
"""
|
581
|
-
email: Optional[str] = None
|
582
|
-
"""
|
583
|
-
The user's email
|
584
|
-
"""
|
585
|
-
username: Optional[str] = None
|
586
|
-
"""
|
587
|
-
The username the user can use to login
|
588
|
-
"""
|
589
|
-
roles: List[str]
|
590
|
-
"""
|
591
|
-
The user's roles
|
592
|
-
"""
|
593
|
-
alert_notifications_enabled: Optional[bool] = None
|
594
|
-
"""
|
595
|
-
Whether or not the user will receive email notifications when alerts are triggered, defaults to 'false'
|
596
|
-
"""
|
597
|
-
show_intro_sequence: Optional[bool] = None
|
598
|
-
"""
|
599
|
-
used by the Arthur dashboard to determine whether the user should be shown the intro sequence upon login
|
600
|
-
"""
|
601
|
-
help_mode_enabled: Optional[bool] = None
|
602
|
-
"""
|
603
|
-
Used by the Arthur dashboard to determine whether or not to show dashboard tooltips
|
604
|
-
"""
|
605
|
-
plan: Optional[str] = None
|
606
|
-
"""
|
607
|
-
string representation of what plan the org of the returned user is associated with (ie. self-service or paidSaas)
|
608
|
-
"""
|
609
|
-
created_at: Optional[datetime] = None
|
610
|
-
"""
|
611
|
-
UTC timestamp of when the user was created
|
612
|
-
"""
|
613
|
-
contexts: Optional[List[UserContext]] = None
|
614
|
-
"""
|
615
|
-
Contexts that the user has permissions in.
|
616
|
-
"""
|
617
|
-
|
618
|
-
|
619
|
-
class PaginatedUsers(BaseModel):
|
620
|
-
data: List[User]
|
621
|
-
"""
|
622
|
-
List of users.
|
623
|
-
"""
|
624
|
-
page: Page
|
625
|
-
page_size: PageSize
|
626
|
-
total_pages: Optional[TotalPages] = None
|
627
|
-
total_count: Optional[TotalCount] = None
|
628
|
-
|
629
|
-
|
630
389
|
class NewOrganizationRequest(BaseModel):
|
631
390
|
name: str
|
632
391
|
roles: Optional[List[RoleDefinitionRequest]] = None
|
@@ -640,41 +399,20 @@ class UpdateOrganizationRequest(BaseModel):
|
|
640
399
|
plan: Optional[str] = None
|
641
400
|
|
642
401
|
|
643
|
-
class InviteRequest(BaseModel):
|
644
|
-
invite_emails: List[str]
|
645
|
-
"""
|
646
|
-
A list of emails to invite to the organization of the inviting user
|
647
|
-
"""
|
648
|
-
return_direct_links: Optional[bool] = Field(False, example=True)
|
649
|
-
"""
|
650
|
-
If set to true, invite emails will not be sent; instead, the signup links will be returned directly in the api response. If set to false email invites will be sent and the response body will be null.
|
651
|
-
"""
|
652
|
-
custom_dashboard_url: Optional[str] = Field(None, example='beta.kots.dev.arthur.ai')
|
653
|
-
"""
|
654
|
-
Set this if you want the invite links to be prefixed with a URL different from the default
|
655
|
-
"""
|
656
|
-
organization_id: Optional[UUID] = Field(
|
657
|
-
None, example='b4e2c14d-85f6-405a-b184-ca9fbca2604f'
|
658
|
-
)
|
659
|
-
"""
|
660
|
-
Set this if and only if calling as superadmin, otherwise it will return an error; this specifies the org to invite the users to
|
661
|
-
"""
|
662
|
-
|
663
|
-
|
664
402
|
class OrgExpand(str, Enum):
|
665
|
-
LicensePlan =
|
666
|
-
Roles =
|
403
|
+
LicensePlan = "license_plan"
|
404
|
+
Roles = "roles"
|
667
405
|
|
668
406
|
|
669
407
|
class Organization(BaseModel):
|
670
|
-
id: UUID = Field(..., example=
|
408
|
+
id: UUID = Field(..., example="12345678-90ab-cdef-1234-567890abcdef")
|
671
409
|
"""
|
672
410
|
Unique UUID for the organization
|
673
411
|
"""
|
674
412
|
name: str
|
675
413
|
bucket_name: Optional[str] = None
|
676
414
|
bucket_url: Optional[str] = None
|
677
|
-
plan: Optional[str] = Field(None, example=
|
415
|
+
plan: Optional[str] = Field(None, example="enterprise")
|
678
416
|
"""
|
679
417
|
The organization's license plan for platform usage
|
680
418
|
"""
|
@@ -703,7 +441,7 @@ class CustomRBACRequest(BaseModel):
|
|
703
441
|
class PaginatedUsageResponse(BaseModel):
|
704
442
|
data: List[UsageData]
|
705
443
|
total_count: int
|
706
|
-
rollup: str = Field(..., example=
|
444
|
+
rollup: str = Field(..., example="model")
|
707
445
|
interval_start: datetime
|
708
446
|
interval_end: datetime
|
709
447
|
|