windmill-api 1.525.0__py3-none-any.whl → 1.526.1__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 windmill-api might be problematic. Click here for more details.

Files changed (32) hide show
  1. windmill_api/api/group/list_instance_groups_with_workspaces.py +133 -0
  2. windmill_api/api/workspace/edit_instance_groups.py +105 -0
  3. windmill_api/models/edit_instance_groups_json_body.py +82 -0
  4. windmill_api/models/edit_instance_groups_json_body_roles.py +44 -0
  5. windmill_api/models/get_settings_response_200.py +36 -1
  6. windmill_api/models/get_settings_response_200_auto_add_instance_groups_roles.py +44 -0
  7. windmill_api/models/get_user_response_200.py +25 -1
  8. windmill_api/models/get_user_response_200_added_via.py +78 -0
  9. windmill_api/models/get_user_response_200_added_via_source.py +10 -0
  10. windmill_api/models/instance_group_with_workspaces.py +104 -0
  11. windmill_api/models/instance_group_with_workspaces_workspaces_item.py +74 -0
  12. windmill_api/models/list_instance_groups_with_workspaces_response_200_item.py +110 -0
  13. windmill_api/models/list_instance_groups_with_workspaces_response_200_item_workspaces_item.py +74 -0
  14. windmill_api/models/list_users_response_200_item.py +25 -1
  15. windmill_api/models/list_users_response_200_item_added_via.py +78 -0
  16. windmill_api/models/list_users_response_200_item_added_via_source.py +10 -0
  17. windmill_api/models/user.py +25 -1
  18. windmill_api/models/user_added_via.py +78 -0
  19. windmill_api/models/user_added_via_source.py +10 -0
  20. windmill_api/models/user_source.py +78 -0
  21. windmill_api/models/user_source_source.py +10 -0
  22. windmill_api/models/whoami_response_200.py +25 -1
  23. windmill_api/models/whoami_response_200_added_via.py +78 -0
  24. windmill_api/models/whoami_response_200_added_via_source.py +10 -0
  25. windmill_api/models/whois_response_200.py +25 -1
  26. windmill_api/models/whois_response_200_added_via.py +78 -0
  27. windmill_api/models/whois_response_200_added_via_source.py +10 -0
  28. windmill_api/models/workspace_info.py +74 -0
  29. {windmill_api-1.525.0.dist-info → windmill_api-1.526.1.dist-info}/METADATA +1 -1
  30. {windmill_api-1.525.0.dist-info → windmill_api-1.526.1.dist-info}/RECORD +32 -10
  31. {windmill_api-1.525.0.dist-info → windmill_api-1.526.1.dist-info}/LICENSE +0 -0
  32. {windmill_api-1.525.0.dist-info → windmill_api-1.526.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,133 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.list_instance_groups_with_workspaces_response_200_item import (
9
+ ListInstanceGroupsWithWorkspacesResponse200Item,
10
+ )
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs() -> Dict[str, Any]:
15
+ pass
16
+
17
+ return {
18
+ "method": "get",
19
+ "url": "/groups/list_with_workspaces",
20
+ }
21
+
22
+
23
+ def _parse_response(
24
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
+ ) -> Optional[List["ListInstanceGroupsWithWorkspacesResponse200Item"]]:
26
+ if response.status_code == HTTPStatus.OK:
27
+ response_200 = []
28
+ _response_200 = response.json()
29
+ for response_200_item_data in _response_200:
30
+ response_200_item = ListInstanceGroupsWithWorkspacesResponse200Item.from_dict(response_200_item_data)
31
+
32
+ response_200.append(response_200_item)
33
+
34
+ return response_200
35
+ if client.raise_on_unexpected_status:
36
+ raise errors.UnexpectedStatus(response.status_code, response.content)
37
+ else:
38
+ return None
39
+
40
+
41
+ def _build_response(
42
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
43
+ ) -> Response[List["ListInstanceGroupsWithWorkspacesResponse200Item"]]:
44
+ return Response(
45
+ status_code=HTTPStatus(response.status_code),
46
+ content=response.content,
47
+ headers=response.headers,
48
+ parsed=_parse_response(client=client, response=response),
49
+ )
50
+
51
+
52
+ def sync_detailed(
53
+ *,
54
+ client: Union[AuthenticatedClient, Client],
55
+ ) -> Response[List["ListInstanceGroupsWithWorkspacesResponse200Item"]]:
56
+ """list instance groups with workspace information
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[List['ListInstanceGroupsWithWorkspacesResponse200Item']]
64
+ """
65
+
66
+ kwargs = _get_kwargs()
67
+
68
+ response = client.get_httpx_client().request(
69
+ **kwargs,
70
+ )
71
+
72
+ return _build_response(client=client, response=response)
73
+
74
+
75
+ def sync(
76
+ *,
77
+ client: Union[AuthenticatedClient, Client],
78
+ ) -> Optional[List["ListInstanceGroupsWithWorkspacesResponse200Item"]]:
79
+ """list instance groups with workspace information
80
+
81
+ Raises:
82
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
83
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
84
+
85
+ Returns:
86
+ List['ListInstanceGroupsWithWorkspacesResponse200Item']
87
+ """
88
+
89
+ return sync_detailed(
90
+ client=client,
91
+ ).parsed
92
+
93
+
94
+ async def asyncio_detailed(
95
+ *,
96
+ client: Union[AuthenticatedClient, Client],
97
+ ) -> Response[List["ListInstanceGroupsWithWorkspacesResponse200Item"]]:
98
+ """list instance groups with workspace information
99
+
100
+ Raises:
101
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
103
+
104
+ Returns:
105
+ Response[List['ListInstanceGroupsWithWorkspacesResponse200Item']]
106
+ """
107
+
108
+ kwargs = _get_kwargs()
109
+
110
+ response = await client.get_async_httpx_client().request(**kwargs)
111
+
112
+ return _build_response(client=client, response=response)
113
+
114
+
115
+ async def asyncio(
116
+ *,
117
+ client: Union[AuthenticatedClient, Client],
118
+ ) -> Optional[List["ListInstanceGroupsWithWorkspacesResponse200Item"]]:
119
+ """list instance groups with workspace information
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ List['ListInstanceGroupsWithWorkspacesResponse200Item']
127
+ """
128
+
129
+ return (
130
+ await asyncio_detailed(
131
+ client=client,
132
+ )
133
+ ).parsed
@@ -0,0 +1,105 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.edit_instance_groups_json_body import EditInstanceGroupsJsonBody
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ *,
15
+ json_body: EditInstanceGroupsJsonBody,
16
+ ) -> Dict[str, Any]:
17
+ pass
18
+
19
+ json_json_body = json_body.to_dict()
20
+
21
+ return {
22
+ "method": "post",
23
+ "url": "/w/{workspace}/workspaces/edit_instance_groups".format(
24
+ workspace=workspace,
25
+ ),
26
+ "json": json_json_body,
27
+ }
28
+
29
+
30
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
31
+ if client.raise_on_unexpected_status:
32
+ raise errors.UnexpectedStatus(response.status_code, response.content)
33
+ else:
34
+ return None
35
+
36
+
37
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
38
+ return Response(
39
+ status_code=HTTPStatus(response.status_code),
40
+ content=response.content,
41
+ headers=response.headers,
42
+ parsed=_parse_response(client=client, response=response),
43
+ )
44
+
45
+
46
+ def sync_detailed(
47
+ workspace: str,
48
+ *,
49
+ client: Union[AuthenticatedClient, Client],
50
+ json_body: EditInstanceGroupsJsonBody,
51
+ ) -> Response[Any]:
52
+ """edit instance groups
53
+
54
+ Args:
55
+ workspace (str):
56
+ json_body (EditInstanceGroupsJsonBody):
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[Any]
64
+ """
65
+
66
+ kwargs = _get_kwargs(
67
+ workspace=workspace,
68
+ json_body=json_body,
69
+ )
70
+
71
+ response = client.get_httpx_client().request(
72
+ **kwargs,
73
+ )
74
+
75
+ return _build_response(client=client, response=response)
76
+
77
+
78
+ async def asyncio_detailed(
79
+ workspace: str,
80
+ *,
81
+ client: Union[AuthenticatedClient, Client],
82
+ json_body: EditInstanceGroupsJsonBody,
83
+ ) -> Response[Any]:
84
+ """edit instance groups
85
+
86
+ Args:
87
+ workspace (str):
88
+ json_body (EditInstanceGroupsJsonBody):
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ Response[Any]
96
+ """
97
+
98
+ kwargs = _get_kwargs(
99
+ workspace=workspace,
100
+ json_body=json_body,
101
+ )
102
+
103
+ response = await client.get_async_httpx_client().request(**kwargs)
104
+
105
+ return _build_response(client=client, response=response)
@@ -0,0 +1,82 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.edit_instance_groups_json_body_roles import EditInstanceGroupsJsonBodyRoles
10
+
11
+
12
+ T = TypeVar("T", bound="EditInstanceGroupsJsonBody")
13
+
14
+
15
+ @_attrs_define
16
+ class EditInstanceGroupsJsonBody:
17
+ """
18
+ Attributes:
19
+ groups (Union[Unset, List[str]]):
20
+ roles (Union[Unset, EditInstanceGroupsJsonBodyRoles]):
21
+ """
22
+
23
+ groups: Union[Unset, List[str]] = UNSET
24
+ roles: Union[Unset, "EditInstanceGroupsJsonBodyRoles"] = UNSET
25
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> Dict[str, Any]:
28
+ groups: Union[Unset, List[str]] = UNSET
29
+ if not isinstance(self.groups, Unset):
30
+ groups = self.groups
31
+
32
+ roles: Union[Unset, Dict[str, Any]] = UNSET
33
+ if not isinstance(self.roles, Unset):
34
+ roles = self.roles.to_dict()
35
+
36
+ field_dict: Dict[str, Any] = {}
37
+ field_dict.update(self.additional_properties)
38
+ field_dict.update({})
39
+ if groups is not UNSET:
40
+ field_dict["groups"] = groups
41
+ if roles is not UNSET:
42
+ field_dict["roles"] = roles
43
+
44
+ return field_dict
45
+
46
+ @classmethod
47
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
48
+ from ..models.edit_instance_groups_json_body_roles import EditInstanceGroupsJsonBodyRoles
49
+
50
+ d = src_dict.copy()
51
+ groups = cast(List[str], d.pop("groups", UNSET))
52
+
53
+ _roles = d.pop("roles", UNSET)
54
+ roles: Union[Unset, EditInstanceGroupsJsonBodyRoles]
55
+ if isinstance(_roles, Unset):
56
+ roles = UNSET
57
+ else:
58
+ roles = EditInstanceGroupsJsonBodyRoles.from_dict(_roles)
59
+
60
+ edit_instance_groups_json_body = cls(
61
+ groups=groups,
62
+ roles=roles,
63
+ )
64
+
65
+ edit_instance_groups_json_body.additional_properties = d
66
+ return edit_instance_groups_json_body
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
@@ -0,0 +1,44 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="EditInstanceGroupsJsonBodyRoles")
7
+
8
+
9
+ @_attrs_define
10
+ class EditInstanceGroupsJsonBodyRoles:
11
+ """ """
12
+
13
+ additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> Dict[str, Any]:
16
+ field_dict: Dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+ field_dict.update({})
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
24
+ d = src_dict.copy()
25
+ edit_instance_groups_json_body_roles = cls()
26
+
27
+ edit_instance_groups_json_body_roles.additional_properties = d
28
+ return edit_instance_groups_json_body_roles
29
+
30
+ @property
31
+ def additional_keys(self) -> List[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> str:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: str) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -7,6 +7,9 @@ from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
9
  from ..models.get_settings_response_200_ai_config import GetSettingsResponse200AiConfig
10
+ from ..models.get_settings_response_200_auto_add_instance_groups_roles import (
11
+ GetSettingsResponse200AutoAddInstanceGroupsRoles,
12
+ )
10
13
  from ..models.get_settings_response_200_default_scripts import GetSettingsResponse200DefaultScripts
11
14
  from ..models.get_settings_response_200_deploy_ui import GetSettingsResponse200DeployUi
12
15
  from ..models.get_settings_response_200_ducklake import GetSettingsResponse200Ducklake
@@ -34,6 +37,8 @@ class GetSettingsResponse200:
34
37
  auto_invite_domain (Union[Unset, str]):
35
38
  auto_invite_operator (Union[Unset, bool]):
36
39
  auto_add (Union[Unset, bool]):
40
+ auto_add_instance_groups (Union[Unset, List[str]]):
41
+ auto_add_instance_groups_roles (Union[Unset, GetSettingsResponse200AutoAddInstanceGroupsRoles]):
37
42
  plan (Union[Unset, str]):
38
43
  customer_id (Union[Unset, str]):
39
44
  webhook (Union[Unset, str]):
@@ -64,6 +69,8 @@ class GetSettingsResponse200:
64
69
  auto_invite_domain: Union[Unset, str] = UNSET
65
70
  auto_invite_operator: Union[Unset, bool] = UNSET
66
71
  auto_add: Union[Unset, bool] = UNSET
72
+ auto_add_instance_groups: Union[Unset, List[str]] = UNSET
73
+ auto_add_instance_groups_roles: Union[Unset, "GetSettingsResponse200AutoAddInstanceGroupsRoles"] = UNSET
67
74
  plan: Union[Unset, str] = UNSET
68
75
  customer_id: Union[Unset, str] = UNSET
69
76
  webhook: Union[Unset, str] = UNSET
@@ -94,6 +101,14 @@ class GetSettingsResponse200:
94
101
  auto_invite_domain = self.auto_invite_domain
95
102
  auto_invite_operator = self.auto_invite_operator
96
103
  auto_add = self.auto_add
104
+ auto_add_instance_groups: Union[Unset, List[str]] = UNSET
105
+ if not isinstance(self.auto_add_instance_groups, Unset):
106
+ auto_add_instance_groups = self.auto_add_instance_groups
107
+
108
+ auto_add_instance_groups_roles: Union[Unset, Dict[str, Any]] = UNSET
109
+ if not isinstance(self.auto_add_instance_groups_roles, Unset):
110
+ auto_add_instance_groups_roles = self.auto_add_instance_groups_roles.to_dict()
111
+
97
112
  plan = self.plan
98
113
  customer_id = self.customer_id
99
114
  webhook = self.webhook
@@ -161,6 +176,10 @@ class GetSettingsResponse200:
161
176
  field_dict["auto_invite_operator"] = auto_invite_operator
162
177
  if auto_add is not UNSET:
163
178
  field_dict["auto_add"] = auto_add
179
+ if auto_add_instance_groups is not UNSET:
180
+ field_dict["auto_add_instance_groups"] = auto_add_instance_groups
181
+ if auto_add_instance_groups_roles is not UNSET:
182
+ field_dict["auto_add_instance_groups_roles"] = auto_add_instance_groups_roles
164
183
  if plan is not UNSET:
165
184
  field_dict["plan"] = plan
166
185
  if customer_id is not UNSET:
@@ -199,6 +218,9 @@ class GetSettingsResponse200:
199
218
  @classmethod
200
219
  def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
201
220
  from ..models.get_settings_response_200_ai_config import GetSettingsResponse200AiConfig
221
+ from ..models.get_settings_response_200_auto_add_instance_groups_roles import (
222
+ GetSettingsResponse200AutoAddInstanceGroupsRoles,
223
+ )
202
224
  from ..models.get_settings_response_200_default_scripts import GetSettingsResponse200DefaultScripts
203
225
  from ..models.get_settings_response_200_deploy_ui import GetSettingsResponse200DeployUi
204
226
  from ..models.get_settings_response_200_ducklake import GetSettingsResponse200Ducklake
@@ -232,6 +254,17 @@ class GetSettingsResponse200:
232
254
 
233
255
  auto_add = d.pop("auto_add", UNSET)
234
256
 
257
+ auto_add_instance_groups = cast(List[str], d.pop("auto_add_instance_groups", UNSET))
258
+
259
+ _auto_add_instance_groups_roles = d.pop("auto_add_instance_groups_roles", UNSET)
260
+ auto_add_instance_groups_roles: Union[Unset, GetSettingsResponse200AutoAddInstanceGroupsRoles]
261
+ if isinstance(_auto_add_instance_groups_roles, Unset):
262
+ auto_add_instance_groups_roles = UNSET
263
+ else:
264
+ auto_add_instance_groups_roles = GetSettingsResponse200AutoAddInstanceGroupsRoles.from_dict(
265
+ _auto_add_instance_groups_roles
266
+ )
267
+
235
268
  plan = d.pop("plan", UNSET)
236
269
 
237
270
  customer_id = d.pop("customer_id", UNSET)
@@ -318,6 +351,8 @@ class GetSettingsResponse200:
318
351
  auto_invite_domain=auto_invite_domain,
319
352
  auto_invite_operator=auto_invite_operator,
320
353
  auto_add=auto_add,
354
+ auto_add_instance_groups=auto_add_instance_groups,
355
+ auto_add_instance_groups_roles=auto_add_instance_groups_roles,
321
356
  plan=plan,
322
357
  customer_id=customer_id,
323
358
  webhook=webhook,
@@ -0,0 +1,44 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="GetSettingsResponse200AutoAddInstanceGroupsRoles")
7
+
8
+
9
+ @_attrs_define
10
+ class GetSettingsResponse200AutoAddInstanceGroupsRoles:
11
+ """ """
12
+
13
+ additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> Dict[str, Any]:
16
+ field_dict: Dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+ field_dict.update({})
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
24
+ d = src_dict.copy()
25
+ get_settings_response_200_auto_add_instance_groups_roles = cls()
26
+
27
+ get_settings_response_200_auto_add_instance_groups_roles.additional_properties = d
28
+ return get_settings_response_200_auto_add_instance_groups_roles
29
+
30
+ @property
31
+ def additional_keys(self) -> List[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> str:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: str) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -1,5 +1,5 @@
1
1
  import datetime
2
- from typing import Any, Dict, List, Type, TypeVar, Union, cast
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
3
3
 
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
@@ -7,6 +7,10 @@ from dateutil.parser import isoparse
7
7
 
8
8
  from ..types import UNSET, Unset
9
9
 
10
+ if TYPE_CHECKING:
11
+ from ..models.get_user_response_200_added_via import GetUserResponse200AddedVia
12
+
13
+
10
14
  T = TypeVar("T", bound="GetUserResponse200")
11
15
 
12
16
 
@@ -25,6 +29,7 @@ class GetUserResponse200:
25
29
  folders_owners (List[str]):
26
30
  name (Union[Unset, str]):
27
31
  groups (Union[Unset, List[str]]):
32
+ added_via (Union[Unset, None, GetUserResponse200AddedVia]):
28
33
  """
29
34
 
30
35
  email: str
@@ -38,6 +43,7 @@ class GetUserResponse200:
38
43
  folders_owners: List[str]
39
44
  name: Union[Unset, str] = UNSET
40
45
  groups: Union[Unset, List[str]] = UNSET
46
+ added_via: Union[Unset, None, "GetUserResponse200AddedVia"] = UNSET
41
47
  additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
42
48
 
43
49
  def to_dict(self) -> Dict[str, Any]:
@@ -58,6 +64,10 @@ class GetUserResponse200:
58
64
  if not isinstance(self.groups, Unset):
59
65
  groups = self.groups
60
66
 
67
+ added_via: Union[Unset, None, Dict[str, Any]] = UNSET
68
+ if not isinstance(self.added_via, Unset):
69
+ added_via = self.added_via.to_dict() if self.added_via else None
70
+
61
71
  field_dict: Dict[str, Any] = {}
62
72
  field_dict.update(self.additional_properties)
63
73
  field_dict.update(
@@ -77,11 +87,15 @@ class GetUserResponse200:
77
87
  field_dict["name"] = name
78
88
  if groups is not UNSET:
79
89
  field_dict["groups"] = groups
90
+ if added_via is not UNSET:
91
+ field_dict["added_via"] = added_via
80
92
 
81
93
  return field_dict
82
94
 
83
95
  @classmethod
84
96
  def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
97
+ from ..models.get_user_response_200_added_via import GetUserResponse200AddedVia
98
+
85
99
  d = src_dict.copy()
86
100
  email = d.pop("email")
87
101
 
@@ -105,6 +119,15 @@ class GetUserResponse200:
105
119
 
106
120
  groups = cast(List[str], d.pop("groups", UNSET))
107
121
 
122
+ _added_via = d.pop("added_via", UNSET)
123
+ added_via: Union[Unset, None, GetUserResponse200AddedVia]
124
+ if _added_via is None:
125
+ added_via = None
126
+ elif isinstance(_added_via, Unset):
127
+ added_via = UNSET
128
+ else:
129
+ added_via = GetUserResponse200AddedVia.from_dict(_added_via)
130
+
108
131
  get_user_response_200 = cls(
109
132
  email=email,
110
133
  username=username,
@@ -117,6 +140,7 @@ class GetUserResponse200:
117
140
  folders_owners=folders_owners,
118
141
  name=name,
119
142
  groups=groups,
143
+ added_via=added_via,
120
144
  )
121
145
 
122
146
  get_user_response_200.additional_properties = d
@@ -0,0 +1,78 @@
1
+ from typing import Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.get_user_response_200_added_via_source import GetUserResponse200AddedViaSource
7
+ from ..types import UNSET, Unset
8
+
9
+ T = TypeVar("T", bound="GetUserResponse200AddedVia")
10
+
11
+
12
+ @_attrs_define
13
+ class GetUserResponse200AddedVia:
14
+ """
15
+ Attributes:
16
+ source (GetUserResponse200AddedViaSource): How the user was added to the workspace
17
+ domain (Union[Unset, str]): The domain used for auto-invite (when source is 'domain')
18
+ group (Union[Unset, str]): The instance group name (when source is 'instance_group')
19
+ """
20
+
21
+ source: GetUserResponse200AddedViaSource
22
+ domain: Union[Unset, str] = UNSET
23
+ group: Union[Unset, str] = UNSET
24
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> Dict[str, Any]:
27
+ source = self.source.value
28
+
29
+ domain = self.domain
30
+ group = self.group
31
+
32
+ field_dict: Dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "source": source,
37
+ }
38
+ )
39
+ if domain is not UNSET:
40
+ field_dict["domain"] = domain
41
+ if group is not UNSET:
42
+ field_dict["group"] = group
43
+
44
+ return field_dict
45
+
46
+ @classmethod
47
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
48
+ d = src_dict.copy()
49
+ source = GetUserResponse200AddedViaSource(d.pop("source"))
50
+
51
+ domain = d.pop("domain", UNSET)
52
+
53
+ group = d.pop("group", UNSET)
54
+
55
+ get_user_response_200_added_via = cls(
56
+ source=source,
57
+ domain=domain,
58
+ group=group,
59
+ )
60
+
61
+ get_user_response_200_added_via.additional_properties = d
62
+ return get_user_response_200_added_via
63
+
64
+ @property
65
+ def additional_keys(self) -> List[str]:
66
+ return list(self.additional_properties.keys())
67
+
68
+ def __getitem__(self, key: str) -> Any:
69
+ return self.additional_properties[key]
70
+
71
+ def __setitem__(self, key: str, value: Any) -> None:
72
+ self.additional_properties[key] = value
73
+
74
+ def __delitem__(self, key: str) -> None:
75
+ del self.additional_properties[key]
76
+
77
+ def __contains__(self, key: str) -> bool:
78
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class GetUserResponse200AddedViaSource(str, Enum):
5
+ DOMAIN = "domain"
6
+ INSTANCE_GROUP = "instance_group"
7
+ MANUAL = "manual"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)