waldur-api-client 8.0.9.dev320__py3-none-any.whl → 8.0.9.dev321__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.
- waldur_api_client/api/admin/admin_matrix_appservice_setup.py +170 -0
- waldur_api_client/api/admin/admin_matrix_appservice_status_retrieve.py +131 -0
- waldur_api_client/api/admin/admin_matrix_diagnostics_retrieve.py +137 -0
- waldur_api_client/api/admin/admin_matrix_reprovision.py +137 -0
- waldur_api_client/api/matrix/__init__.py +1 -0
- waldur_api_client/api/matrix/matrix_credentials_retrieve.py +131 -0
- waldur_api_client/api/matrix/matrix_exports_count.py +233 -0
- waldur_api_client/api/matrix/matrix_exports_download_retrieve.py +159 -0
- waldur_api_client/api/matrix/matrix_exports_list.py +391 -0
- waldur_api_client/api/matrix/matrix_exports_retrieve.py +144 -0
- waldur_api_client/api/matrix/matrix_rooms_count.py +228 -0
- waldur_api_client/api/matrix/matrix_rooms_create.py +154 -0
- waldur_api_client/api/matrix/matrix_rooms_destroy.py +91 -0
- waldur_api_client/api/matrix/matrix_rooms_disable.py +168 -0
- waldur_api_client/api/matrix/matrix_rooms_eligible_projects_count.py +251 -0
- waldur_api_client/api/matrix/matrix_rooms_eligible_projects_list.py +421 -0
- waldur_api_client/api/matrix/matrix_rooms_export_history.py +148 -0
- waldur_api_client/api/matrix/matrix_rooms_join.py +158 -0
- waldur_api_client/api/matrix/matrix_rooms_leave.py +154 -0
- waldur_api_client/api/matrix/matrix_rooms_list.py +384 -0
- waldur_api_client/api/matrix/matrix_rooms_members_list.py +409 -0
- waldur_api_client/api/matrix/matrix_rooms_reactivate.py +146 -0
- waldur_api_client/api/matrix/matrix_rooms_retrieve.py +142 -0
- waldur_api_client/api/matrix/matrix_rooms_retry.py +146 -0
- waldur_api_client/api/matrix/matrix_rooms_sync_members.py +93 -0
- waldur_api_client/api/tagmatrix/__init__.py +1 -0
- waldur_api_client/api/tagmatrix/field_matrix_app_v1_transactions_update.py +98 -0
- waldur_api_client/api-map.md +33 -0
- waldur_api_client/llms-full.txt +176 -1
- waldur_api_client/llms.txt +4 -2
- waldur_api_client/models/__init__.py +38 -0
- waldur_api_client/models/constance_settings.py +108 -0
- waldur_api_client/models/constance_settings_request.py +108 -0
- waldur_api_client/models/constance_settings_request_form.py +108 -0
- waldur_api_client/models/constance_settings_request_multipart.py +167 -0
- waldur_api_client/models/eligible_project.py +83 -0
- waldur_api_client/models/export_type_enum.py +10 -0
- waldur_api_client/models/matrix_appservice_setup_request.py +98 -0
- waldur_api_client/models/matrix_appservice_setup_response.py +99 -0
- waldur_api_client/models/matrix_appservice_status.py +123 -0
- waldur_api_client/models/matrix_credentials.py +122 -0
- waldur_api_client/models/matrix_diagnostic_check.py +83 -0
- waldur_api_client/models/matrix_diagnostics_response.py +81 -0
- waldur_api_client/models/matrix_exports_download_retrieve_kind.py +9 -0
- waldur_api_client/models/matrix_history_export.py +215 -0
- waldur_api_client/models/matrix_history_export_state_enum.py +11 -0
- waldur_api_client/models/matrix_reprovision_response.py +67 -0
- waldur_api_client/models/matrix_room.py +244 -0
- waldur_api_client/models/matrix_room_create_request.py +60 -0
- waldur_api_client/models/matrix_room_disable_request.py +59 -0
- waldur_api_client/models/matrix_room_member.py +120 -0
- waldur_api_client/models/matrix_room_member_summary.py +75 -0
- waldur_api_client/models/matrix_room_state_enum.py +12 -0
- waldur_api_client/models/membership_state_enum.py +11 -0
- {waldur_api_client-8.0.9.dev320.dist-info → waldur_api_client-8.0.9.dev321.dist-info}/METADATA +1 -1
- {waldur_api_client-8.0.9.dev320.dist-info → waldur_api_client-8.0.9.dev321.dist-info}/RECORD +58 -12
- {waldur_api_client-8.0.9.dev320.dist-info → waldur_api_client-8.0.9.dev321.dist-info}/WHEEL +0 -0
- {waldur_api_client-8.0.9.dev320.dist-info → waldur_api_client-8.0.9.dev321.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.matrix_appservice_setup_request import MatrixAppserviceSetupRequest
|
|
9
|
+
from ...models.matrix_appservice_setup_response import MatrixAppserviceSetupResponse
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: MatrixAppserviceSetupRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/api/admin/matrix-appservice/setup/",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_kwargs["json"] = body.to_dict()
|
|
25
|
+
|
|
26
|
+
headers["Content-Type"] = "application/json"
|
|
27
|
+
|
|
28
|
+
_kwargs["headers"] = headers
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(
|
|
33
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
34
|
+
) -> MatrixAppserviceSetupResponse:
|
|
35
|
+
if response.status_code == 404:
|
|
36
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = MatrixAppserviceSetupResponse.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
41
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(
|
|
45
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
46
|
+
) -> Response[MatrixAppserviceSetupResponse]:
|
|
47
|
+
return Response(
|
|
48
|
+
status_code=HTTPStatus(response.status_code),
|
|
49
|
+
content=response.content,
|
|
50
|
+
headers=response.headers,
|
|
51
|
+
parsed=_parse_response(client=client, response=response),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sync_detailed(
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient,
|
|
58
|
+
body: MatrixAppserviceSetupRequest,
|
|
59
|
+
) -> Response[MatrixAppserviceSetupResponse]:
|
|
60
|
+
"""Setup Matrix appservice registration
|
|
61
|
+
|
|
62
|
+
Generates fresh appservice tokens (rotating any existing ones), enables the appservice, and returns
|
|
63
|
+
registration YAML.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
body (MatrixAppserviceSetupRequest):
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
70
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Response[MatrixAppserviceSetupResponse]
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
kwargs = _get_kwargs(
|
|
77
|
+
body=body,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
response = client.get_httpx_client().request(
|
|
81
|
+
**kwargs,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return _build_response(client=client, response=response)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def sync(
|
|
88
|
+
*,
|
|
89
|
+
client: AuthenticatedClient,
|
|
90
|
+
body: MatrixAppserviceSetupRequest,
|
|
91
|
+
) -> MatrixAppserviceSetupResponse:
|
|
92
|
+
"""Setup Matrix appservice registration
|
|
93
|
+
|
|
94
|
+
Generates fresh appservice tokens (rotating any existing ones), enables the appservice, and returns
|
|
95
|
+
registration YAML.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
body (MatrixAppserviceSetupRequest):
|
|
99
|
+
|
|
100
|
+
Raises:
|
|
101
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
102
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
MatrixAppserviceSetupResponse
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
return sync_detailed(
|
|
109
|
+
client=client,
|
|
110
|
+
body=body,
|
|
111
|
+
).parsed
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async def asyncio_detailed(
|
|
115
|
+
*,
|
|
116
|
+
client: AuthenticatedClient,
|
|
117
|
+
body: MatrixAppserviceSetupRequest,
|
|
118
|
+
) -> Response[MatrixAppserviceSetupResponse]:
|
|
119
|
+
"""Setup Matrix appservice registration
|
|
120
|
+
|
|
121
|
+
Generates fresh appservice tokens (rotating any existing ones), enables the appservice, and returns
|
|
122
|
+
registration YAML.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
body (MatrixAppserviceSetupRequest):
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
129
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
Response[MatrixAppserviceSetupResponse]
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
kwargs = _get_kwargs(
|
|
136
|
+
body=body,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
140
|
+
|
|
141
|
+
return _build_response(client=client, response=response)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
async def asyncio(
|
|
145
|
+
*,
|
|
146
|
+
client: AuthenticatedClient,
|
|
147
|
+
body: MatrixAppserviceSetupRequest,
|
|
148
|
+
) -> MatrixAppserviceSetupResponse:
|
|
149
|
+
"""Setup Matrix appservice registration
|
|
150
|
+
|
|
151
|
+
Generates fresh appservice tokens (rotating any existing ones), enables the appservice, and returns
|
|
152
|
+
registration YAML.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
body (MatrixAppserviceSetupRequest):
|
|
156
|
+
|
|
157
|
+
Raises:
|
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
MatrixAppserviceSetupResponse
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
await asyncio_detailed(
|
|
167
|
+
client=client,
|
|
168
|
+
body=body,
|
|
169
|
+
)
|
|
170
|
+
).parsed
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.matrix_appservice_status import MatrixAppserviceStatus
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "get",
|
|
15
|
+
"url": "/api/admin/matrix-appservice/status/",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return _kwargs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> MatrixAppserviceStatus:
|
|
22
|
+
if response.status_code == 404:
|
|
23
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
24
|
+
if response.status_code == 200:
|
|
25
|
+
response_200 = MatrixAppserviceStatus.from_dict(response.json())
|
|
26
|
+
|
|
27
|
+
return response_200
|
|
28
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _build_response(
|
|
32
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
33
|
+
) -> Response[MatrixAppserviceStatus]:
|
|
34
|
+
return Response(
|
|
35
|
+
status_code=HTTPStatus(response.status_code),
|
|
36
|
+
content=response.content,
|
|
37
|
+
headers=response.headers,
|
|
38
|
+
parsed=_parse_response(client=client, response=response),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def sync_detailed(
|
|
43
|
+
*,
|
|
44
|
+
client: AuthenticatedClient,
|
|
45
|
+
) -> Response[MatrixAppserviceStatus]:
|
|
46
|
+
"""Get Matrix appservice status
|
|
47
|
+
|
|
48
|
+
Returns the current appservice configuration state.
|
|
49
|
+
|
|
50
|
+
Raises:
|
|
51
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
52
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Response[MatrixAppserviceStatus]
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
kwargs = _get_kwargs()
|
|
59
|
+
|
|
60
|
+
response = client.get_httpx_client().request(
|
|
61
|
+
**kwargs,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return _build_response(client=client, response=response)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync(
|
|
68
|
+
*,
|
|
69
|
+
client: AuthenticatedClient,
|
|
70
|
+
) -> MatrixAppserviceStatus:
|
|
71
|
+
"""Get Matrix appservice status
|
|
72
|
+
|
|
73
|
+
Returns the current appservice configuration state.
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
MatrixAppserviceStatus
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
return sync_detailed(
|
|
84
|
+
client=client,
|
|
85
|
+
).parsed
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
async def asyncio_detailed(
|
|
89
|
+
*,
|
|
90
|
+
client: AuthenticatedClient,
|
|
91
|
+
) -> Response[MatrixAppserviceStatus]:
|
|
92
|
+
"""Get Matrix appservice status
|
|
93
|
+
|
|
94
|
+
Returns the current appservice configuration state.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Response[MatrixAppserviceStatus]
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
kwargs = _get_kwargs()
|
|
105
|
+
|
|
106
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
107
|
+
|
|
108
|
+
return _build_response(client=client, response=response)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def asyncio(
|
|
112
|
+
*,
|
|
113
|
+
client: AuthenticatedClient,
|
|
114
|
+
) -> MatrixAppserviceStatus:
|
|
115
|
+
"""Get Matrix appservice status
|
|
116
|
+
|
|
117
|
+
Returns the current appservice configuration state.
|
|
118
|
+
|
|
119
|
+
Raises:
|
|
120
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
121
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
MatrixAppserviceStatus
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
await asyncio_detailed(
|
|
129
|
+
client=client,
|
|
130
|
+
)
|
|
131
|
+
).parsed
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.matrix_diagnostics_response import MatrixDiagnosticsResponse
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "get",
|
|
15
|
+
"url": "/api/admin/matrix/diagnostics/",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return _kwargs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _parse_response(
|
|
22
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
23
|
+
) -> MatrixDiagnosticsResponse:
|
|
24
|
+
if response.status_code == 404:
|
|
25
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
26
|
+
if response.status_code == 200:
|
|
27
|
+
response_200 = MatrixDiagnosticsResponse.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_200
|
|
30
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _build_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Response[MatrixDiagnosticsResponse]:
|
|
36
|
+
return Response(
|
|
37
|
+
status_code=HTTPStatus(response.status_code),
|
|
38
|
+
content=response.content,
|
|
39
|
+
headers=response.headers,
|
|
40
|
+
parsed=_parse_response(client=client, response=response),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def sync_detailed(
|
|
45
|
+
*,
|
|
46
|
+
client: AuthenticatedClient,
|
|
47
|
+
) -> Response[MatrixDiagnosticsResponse]:
|
|
48
|
+
"""Run Matrix connectivity diagnostics
|
|
49
|
+
|
|
50
|
+
Performs live connectivity checks against the configured Matrix homeserver and returns results for
|
|
51
|
+
each check.
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
55
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Response[MatrixDiagnosticsResponse]
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
kwargs = _get_kwargs()
|
|
62
|
+
|
|
63
|
+
response = client.get_httpx_client().request(
|
|
64
|
+
**kwargs,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return _build_response(client=client, response=response)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync(
|
|
71
|
+
*,
|
|
72
|
+
client: AuthenticatedClient,
|
|
73
|
+
) -> MatrixDiagnosticsResponse:
|
|
74
|
+
"""Run Matrix connectivity diagnostics
|
|
75
|
+
|
|
76
|
+
Performs live connectivity checks against the configured Matrix homeserver and returns results for
|
|
77
|
+
each check.
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
MatrixDiagnosticsResponse
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
return sync_detailed(
|
|
88
|
+
client=client,
|
|
89
|
+
).parsed
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
async def asyncio_detailed(
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient,
|
|
95
|
+
) -> Response[MatrixDiagnosticsResponse]:
|
|
96
|
+
"""Run Matrix connectivity diagnostics
|
|
97
|
+
|
|
98
|
+
Performs live connectivity checks against the configured Matrix homeserver and returns results for
|
|
99
|
+
each check.
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Response[MatrixDiagnosticsResponse]
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
kwargs = _get_kwargs()
|
|
110
|
+
|
|
111
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
112
|
+
|
|
113
|
+
return _build_response(client=client, response=response)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def asyncio(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
) -> MatrixDiagnosticsResponse:
|
|
120
|
+
"""Run Matrix connectivity diagnostics
|
|
121
|
+
|
|
122
|
+
Performs live connectivity checks against the configured Matrix homeserver and returns results for
|
|
123
|
+
each check.
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
MatrixDiagnosticsResponse
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
await asyncio_detailed(
|
|
135
|
+
client=client,
|
|
136
|
+
)
|
|
137
|
+
).parsed
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.matrix_reprovision_response import MatrixReprovisionResponse
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "post",
|
|
15
|
+
"url": "/api/admin/matrix/reprovision/",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return _kwargs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _parse_response(
|
|
22
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
23
|
+
) -> MatrixReprovisionResponse:
|
|
24
|
+
if response.status_code == 404:
|
|
25
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
26
|
+
if response.status_code == 202:
|
|
27
|
+
response_202 = MatrixReprovisionResponse.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_202
|
|
30
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _build_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Response[MatrixReprovisionResponse]:
|
|
36
|
+
return Response(
|
|
37
|
+
status_code=HTTPStatus(response.status_code),
|
|
38
|
+
content=response.content,
|
|
39
|
+
headers=response.headers,
|
|
40
|
+
parsed=_parse_response(client=client, response=response),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def sync_detailed(
|
|
45
|
+
*,
|
|
46
|
+
client: AuthenticatedClient,
|
|
47
|
+
) -> Response[MatrixReprovisionResponse]:
|
|
48
|
+
"""Reprovision all active Matrix rooms on a new homeserver
|
|
49
|
+
|
|
50
|
+
Resets all active rooms to 'creating' state and re-queues them for provisioning. Also resets all
|
|
51
|
+
user profiles. Staff only.
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
55
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Response[MatrixReprovisionResponse]
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
kwargs = _get_kwargs()
|
|
62
|
+
|
|
63
|
+
response = client.get_httpx_client().request(
|
|
64
|
+
**kwargs,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return _build_response(client=client, response=response)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync(
|
|
71
|
+
*,
|
|
72
|
+
client: AuthenticatedClient,
|
|
73
|
+
) -> MatrixReprovisionResponse:
|
|
74
|
+
"""Reprovision all active Matrix rooms on a new homeserver
|
|
75
|
+
|
|
76
|
+
Resets all active rooms to 'creating' state and re-queues them for provisioning. Also resets all
|
|
77
|
+
user profiles. Staff only.
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
MatrixReprovisionResponse
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
return sync_detailed(
|
|
88
|
+
client=client,
|
|
89
|
+
).parsed
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
async def asyncio_detailed(
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient,
|
|
95
|
+
) -> Response[MatrixReprovisionResponse]:
|
|
96
|
+
"""Reprovision all active Matrix rooms on a new homeserver
|
|
97
|
+
|
|
98
|
+
Resets all active rooms to 'creating' state and re-queues them for provisioning. Also resets all
|
|
99
|
+
user profiles. Staff only.
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Response[MatrixReprovisionResponse]
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
kwargs = _get_kwargs()
|
|
110
|
+
|
|
111
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
112
|
+
|
|
113
|
+
return _build_response(client=client, response=response)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def asyncio(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
) -> MatrixReprovisionResponse:
|
|
120
|
+
"""Reprovision all active Matrix rooms on a new homeserver
|
|
121
|
+
|
|
122
|
+
Resets all active rooms to 'creating' state and re-queues them for provisioning. Also resets all
|
|
123
|
+
user profiles. Staff only.
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
MatrixReprovisionResponse
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
await asyncio_detailed(
|
|
135
|
+
client=client,
|
|
136
|
+
)
|
|
137
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.matrix_credentials import MatrixCredentials
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "get",
|
|
15
|
+
"url": "/api/matrix/credentials/",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return _kwargs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> MatrixCredentials:
|
|
22
|
+
if response.status_code == 404:
|
|
23
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
24
|
+
if response.status_code == 200:
|
|
25
|
+
response_200 = MatrixCredentials.from_dict(response.json())
|
|
26
|
+
|
|
27
|
+
return response_200
|
|
28
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _build_response(
|
|
32
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
33
|
+
) -> Response[MatrixCredentials]:
|
|
34
|
+
return Response(
|
|
35
|
+
status_code=HTTPStatus(response.status_code),
|
|
36
|
+
content=response.content,
|
|
37
|
+
headers=response.headers,
|
|
38
|
+
parsed=_parse_response(client=client, response=response),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def sync_detailed(
|
|
43
|
+
*,
|
|
44
|
+
client: AuthenticatedClient,
|
|
45
|
+
) -> Response[MatrixCredentials]:
|
|
46
|
+
"""Get Matrix login credentials
|
|
47
|
+
|
|
48
|
+
Returns Matrix login credentials for the authenticated user based on the configured login method.
|
|
49
|
+
|
|
50
|
+
Raises:
|
|
51
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
52
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Response[MatrixCredentials]
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
kwargs = _get_kwargs()
|
|
59
|
+
|
|
60
|
+
response = client.get_httpx_client().request(
|
|
61
|
+
**kwargs,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return _build_response(client=client, response=response)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync(
|
|
68
|
+
*,
|
|
69
|
+
client: AuthenticatedClient,
|
|
70
|
+
) -> MatrixCredentials:
|
|
71
|
+
"""Get Matrix login credentials
|
|
72
|
+
|
|
73
|
+
Returns Matrix login credentials for the authenticated user based on the configured login method.
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
MatrixCredentials
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
return sync_detailed(
|
|
84
|
+
client=client,
|
|
85
|
+
).parsed
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
async def asyncio_detailed(
|
|
89
|
+
*,
|
|
90
|
+
client: AuthenticatedClient,
|
|
91
|
+
) -> Response[MatrixCredentials]:
|
|
92
|
+
"""Get Matrix login credentials
|
|
93
|
+
|
|
94
|
+
Returns Matrix login credentials for the authenticated user based on the configured login method.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Response[MatrixCredentials]
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
kwargs = _get_kwargs()
|
|
105
|
+
|
|
106
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
107
|
+
|
|
108
|
+
return _build_response(client=client, response=response)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def asyncio(
|
|
112
|
+
*,
|
|
113
|
+
client: AuthenticatedClient,
|
|
114
|
+
) -> MatrixCredentials:
|
|
115
|
+
"""Get Matrix login credentials
|
|
116
|
+
|
|
117
|
+
Returns Matrix login credentials for the authenticated user based on the configured login method.
|
|
118
|
+
|
|
119
|
+
Raises:
|
|
120
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
121
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
MatrixCredentials
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
await asyncio_detailed(
|
|
129
|
+
client=client,
|
|
130
|
+
)
|
|
131
|
+
).parsed
|