skillforge-client 0.3.0__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.
- skillforge_client/__init__.py +8 -0
- skillforge_client/api/__init__.py +1 -0
- skillforge_client/api/auth/__init__.py +1 -0
- skillforge_client/api/auth/create_application_client_endpoint_api_v1_auth_clients_post.py +166 -0
- skillforge_client/api/auth/create_application_client_secret_endpoint_api_v1_auth_clients_client_id_secrets_post.py +182 -0
- skillforge_client/api/auth/create_token_api_v1_auth_token_post.py +165 -0
- skillforge_client/api/auth/grant_application_client_scopes_endpoint_api_v1_auth_clients_client_id_scopes_post.py +182 -0
- skillforge_client/api/auth/read_application_client_api_v1_auth_clients_client_id_get.py +161 -0
- skillforge_client/api/auth/read_application_clients_api_v1_auth_clients_get.py +133 -0
- skillforge_client/api/auth/revoke_application_client_scope_endpoint_api_v1_auth_clients_client_id_scopes_scope_key_delete.py +173 -0
- skillforge_client/api/auth/revoke_application_client_secret_endpoint_api_v1_auth_clients_client_id_secrets_secret_id_delete.py +174 -0
- skillforge_client/api/auth/update_application_client_endpoint_api_v1_auth_clients_client_id_patch.py +182 -0
- skillforge_client/api/bot/__init__.py +1 -0
- skillforge_client/api/bot/add_user_to_group_endpoint_api_v1_bot_users_discord_id_groups_group_key_put.py +199 -0
- skillforge_client/api/bot/cancel_operation_endpoint_api_v1_bot_operations_operation_id_cancel_post.py +203 -0
- skillforge_client/api/bot/check_authorization_endpoint_api_v1_bot_authz_check_post.py +206 -0
- skillforge_client/api/bot/claim_jobs_endpoint_api_v1_bot_jobs_claim_post.py +210 -0
- skillforge_client/api/bot/commit_student_activation_endpoint_api_v1_bot_students_activations_operation_id_commit_post.py +204 -0
- skillforge_client/api/bot/commit_student_deactivation_endpoint_api_v1_bot_students_guild_id_student_discord_id_deactivate_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/commit_student_pop_endpoint_api_v1_bot_students_guild_id_student_discord_id_pop_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/commit_student_stash_endpoint_api_v1_bot_students_guild_id_student_discord_id_stash_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/commit_tutor_activation_endpoint_api_v1_bot_tutors_activations_operation_id_commit_post.py +204 -0
- skillforge_client/api/bot/commit_tutor_deactivation_endpoint_api_v1_bot_tutors_guild_id_tutor_discord_id_deactivate_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/complete_job_endpoint_api_v1_bot_jobs_job_id_complete_post.py +183 -0
- skillforge_client/api/bot/deactivate_discord_account_endpoint_api_v1_bot_users_discord_id_account_delete.py +197 -0
- skillforge_client/api/bot/delete_command_env_endpoint_api_v1_bot_command_envs_guild_id_channel_id_kind_delete.py +204 -0
- skillforge_client/api/bot/fail_job_endpoint_api_v1_bot_jobs_job_id_fail_post.py +228 -0
- skillforge_client/api/bot/job_queue_summary_endpoint_api_v1_bot_jobs_summary_get.py +202 -0
- skillforge_client/api/bot/link_discord_account_endpoint_api_v1_bot_users_discord_id_account_put.py +227 -0
- skillforge_client/api/bot/list_jobs_endpoint_api_v1_bot_jobs_get.py +243 -0
- skillforge_client/api/bot/list_operations_endpoint_api_v1_bot_operations_get.py +302 -0
- skillforge_client/api/bot/prepare_student_activation_endpoint_api_v1_bot_students_activations_prepare_post.py +181 -0
- skillforge_client/api/bot/prepare_student_deactivation_endpoint_api_v1_bot_students_guild_id_student_discord_id_deactivate_prepare_post.py +190 -0
- skillforge_client/api/bot/prepare_student_pop_endpoint_api_v1_bot_students_guild_id_student_discord_id_pop_prepare_post.py +190 -0
- skillforge_client/api/bot/prepare_student_stash_endpoint_api_v1_bot_students_guild_id_student_discord_id_stash_prepare_post.py +190 -0
- skillforge_client/api/bot/prepare_tutor_activation_endpoint_api_v1_bot_tutors_activations_prepare_post.py +181 -0
- skillforge_client/api/bot/prepare_tutor_deactivation_endpoint_api_v1_bot_tutors_guild_id_tutor_discord_id_deactivate_prepare_post.py +190 -0
- skillforge_client/api/bot/read_job_api_v1_bot_jobs_job_id_get.py +186 -0
- skillforge_client/api/bot/read_operation_api_v1_bot_operations_operation_id_get.py +186 -0
- skillforge_client/api/bot/read_principal_api_v1_bot_runtime_principals_discord_id_get.py +177 -0
- skillforge_client/api/bot/read_principals_batch_api_v1_bot_runtime_principals_batch_post.py +189 -0
- skillforge_client/api/bot/read_student_context_api_v1_bot_runtime_students_guild_id_discord_id_get.py +191 -0
- skillforge_client/api/bot/read_student_contexts_batch_api_v1_bot_runtime_students_guild_id_batch_post.py +205 -0
- skillforge_client/api/bot/read_tutor_context_api_v1_bot_runtime_tutors_guild_id_discord_id_get.py +191 -0
- skillforge_client/api/bot/read_tutor_contexts_batch_api_v1_bot_runtime_tutors_guild_id_batch_post.py +205 -0
- skillforge_client/api/bot/remove_user_from_group_endpoint_api_v1_bot_users_discord_id_groups_group_key_delete.py +197 -0
- skillforge_client/api/bot/resolve_command_env_endpoint_api_v1_bot_runtime_command_envs_resolve_get.py +234 -0
- skillforge_client/api/bot/upsert_command_env_endpoint_api_v1_bot_command_envs_put.py +181 -0
- skillforge_client/api/bot/upsert_discord_user_endpoint_api_v1_bot_users_discord_id_put.py +213 -0
- skillforge_client/api/default/__init__.py +1 -0
- skillforge_client/api/default/root_get.py +81 -0
- skillforge_client/api/system/__init__.py +1 -0
- skillforge_client/api/system/dependencies_health_check_health_dependencies_get.py +136 -0
- skillforge_client/api/system/dependency_health_check_health_dependencies_dependency_name_get.py +170 -0
- skillforge_client/api/system/liveness_check_health_live_get.py +132 -0
- skillforge_client/api/system/system_health_check_health_get.py +136 -0
- skillforge_client/api/system/worker_health_check_health_workers_worker_name_get.py +170 -0
- skillforge_client/api/system/workers_health_check_health_workers_get.py +136 -0
- skillforge_client/client.py +268 -0
- skillforge_client/errors.py +16 -0
- skillforge_client/models/__init__.py +167 -0
- skillforge_client/models/access_token_response.py +85 -0
- skillforge_client/models/application_client_create_request.py +91 -0
- skillforge_client/models/application_client_response.py +149 -0
- skillforge_client/models/application_client_scope_grant_request.py +61 -0
- skillforge_client/models/application_client_secret_create_request.py +104 -0
- skillforge_client/models/application_client_secret_response.py +160 -0
- skillforge_client/models/application_client_status.py +9 -0
- skillforge_client/models/application_client_update_request.py +124 -0
- skillforge_client/models/authorization_check_request.py +78 -0
- skillforge_client/models/authorization_check_response.py +61 -0
- skillforge_client/models/body_create_token_api_v1_auth_token_post.py +123 -0
- skillforge_client/models/bot_job.py +119 -0
- skillforge_client/models/bot_job_payload.py +47 -0
- skillforge_client/models/bot_principal.py +148 -0
- skillforge_client/models/command_env_channel_response.py +100 -0
- skillforge_client/models/command_env_kind.py +9 -0
- skillforge_client/models/command_env_upsert_request.py +100 -0
- skillforge_client/models/contact_info_profile.py +92 -0
- skillforge_client/models/contact_info_type.py +9 -0
- skillforge_client/models/created_client_secret_response.py +75 -0
- skillforge_client/models/dependencies_health_check_response.py +77 -0
- skillforge_client/models/dependencies_health_check_response_checks.py +56 -0
- skillforge_client/models/dependency_health_check_response.py +72 -0
- skillforge_client/models/dependency_name.py +8 -0
- skillforge_client/models/discord_account_link_request.py +82 -0
- skillforge_client/models/discord_account_link_response.py +86 -0
- skillforge_client/models/discord_account_profile.py +77 -0
- skillforge_client/models/discord_id_batch_request.py +62 -0
- skillforge_client/models/discord_user_response.py +87 -0
- skillforge_client/models/discord_user_upsert_request.py +81 -0
- skillforge_client/models/error_response.py +61 -0
- skillforge_client/models/external_accounts_profile.py +124 -0
- skillforge_client/models/group_membership_response.py +69 -0
- skillforge_client/models/health_check_response.py +63 -0
- skillforge_client/models/health_status.py +10 -0
- skillforge_client/models/http_validation_error.py +79 -0
- skillforge_client/models/job_claim_request.py +113 -0
- skillforge_client/models/job_detail.py +239 -0
- skillforge_client/models/job_detail_payload.py +47 -0
- skillforge_client/models/job_fail_request.py +82 -0
- skillforge_client/models/job_kind_counts.py +92 -0
- skillforge_client/models/job_list_item.py +225 -0
- skillforge_client/models/job_page.py +100 -0
- skillforge_client/models/job_queue_summary.py +106 -0
- skillforge_client/models/job_response.py +187 -0
- skillforge_client/models/job_status.py +11 -0
- skillforge_client/models/job_status_counts.py +86 -0
- skillforge_client/models/member_role.py +10 -0
- skillforge_client/models/microsoft_account_profile.py +61 -0
- skillforge_client/models/operation_cancel_response.py +108 -0
- skillforge_client/models/operation_kind.py +13 -0
- skillforge_client/models/operation_page.py +100 -0
- skillforge_client/models/operation_response.py +257 -0
- skillforge_client/models/operation_response_plan.py +47 -0
- skillforge_client/models/operation_status.py +12 -0
- skillforge_client/models/operation_summary.py +243 -0
- skillforge_client/models/operational_profile.py +178 -0
- skillforge_client/models/party_relation_type.py +10 -0
- skillforge_client/models/person_profile.py +69 -0
- skillforge_client/models/principal_batch.py +84 -0
- skillforge_client/models/relation_profile.py +81 -0
- skillforge_client/models/relation_profile_direction.py +9 -0
- skillforge_client/models/student_activation_commit_request.py +61 -0
- skillforge_client/models/student_activation_prepare_request.py +77 -0
- skillforge_client/models/student_channel_state.py +9 -0
- skillforge_client/models/student_context.py +140 -0
- skillforge_client/models/student_context_batch.py +83 -0
- skillforge_client/models/system_health_check_response.py +87 -0
- skillforge_client/models/transition_commit_response.py +108 -0
- skillforge_client/models/transition_prepare_response.py +95 -0
- skillforge_client/models/transition_prepare_response_plan.py +47 -0
- skillforge_client/models/tutor_activation_commit_request.py +69 -0
- skillforge_client/models/tutor_activation_prepare_request.py +69 -0
- skillforge_client/models/tutor_context.py +99 -0
- skillforge_client/models/tutor_context_batch.py +83 -0
- skillforge_client/models/validation_error.py +123 -0
- skillforge_client/models/validation_error_context.py +47 -0
- skillforge_client/models/worker_health_check_response.py +72 -0
- skillforge_client/models/worker_name.py +8 -0
- skillforge_client/models/workers_health_check_response.py +77 -0
- skillforge_client/models/workers_health_check_response_checks.py +56 -0
- skillforge_client/py.typed +1 -0
- skillforge_client/types.py +54 -0
- skillforge_client-0.3.0.dist-info/METADATA +83 -0
- skillforge_client-0.3.0.dist-info/RECORD +147 -0
- skillforge_client-0.3.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.application_client_response import ApplicationClientResponse
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
client_id: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/api/v1/auth/clients/{client_id}".format(
|
|
21
|
+
client_id=quote(str(client_id), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> ApplicationClientResponse | HTTPValidationError | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = ApplicationClientResponse.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 422:
|
|
37
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_422
|
|
40
|
+
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
49
|
+
) -> Response[ApplicationClientResponse | HTTPValidationError]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
client_id: str,
|
|
60
|
+
*,
|
|
61
|
+
client: AuthenticatedClient,
|
|
62
|
+
) -> Response[ApplicationClientResponse | HTTPValidationError]:
|
|
63
|
+
"""Read Application Client
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
client_id (str):
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
70
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Response[ApplicationClientResponse | HTTPValidationError]
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
kwargs = _get_kwargs(
|
|
77
|
+
client_id=client_id,
|
|
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
|
+
client_id: str,
|
|
89
|
+
*,
|
|
90
|
+
client: AuthenticatedClient,
|
|
91
|
+
) -> ApplicationClientResponse | HTTPValidationError | None:
|
|
92
|
+
"""Read Application Client
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
client_id (str):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
ApplicationClientResponse | HTTPValidationError
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
return sync_detailed(
|
|
106
|
+
client_id=client_id,
|
|
107
|
+
client=client,
|
|
108
|
+
).parsed
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def asyncio_detailed(
|
|
112
|
+
client_id: str,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
) -> Response[ApplicationClientResponse | HTTPValidationError]:
|
|
116
|
+
"""Read Application Client
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
client_id (str):
|
|
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
|
+
Response[ApplicationClientResponse | HTTPValidationError]
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
kwargs = _get_kwargs(
|
|
130
|
+
client_id=client_id,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
134
|
+
|
|
135
|
+
return _build_response(client=client, response=response)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
async def asyncio(
|
|
139
|
+
client_id: str,
|
|
140
|
+
*,
|
|
141
|
+
client: AuthenticatedClient,
|
|
142
|
+
) -> ApplicationClientResponse | HTTPValidationError | None:
|
|
143
|
+
"""Read Application Client
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
client_id (str):
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
150
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
ApplicationClientResponse | HTTPValidationError
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
await asyncio_detailed(
|
|
158
|
+
client_id=client_id,
|
|
159
|
+
client=client,
|
|
160
|
+
)
|
|
161
|
+
).parsed
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.application_client_response import ApplicationClientResponse
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
13
|
+
|
|
14
|
+
_kwargs: dict[str, Any] = {
|
|
15
|
+
"method": "get",
|
|
16
|
+
"url": "/api/v1/auth/clients",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _kwargs
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _parse_response(
|
|
23
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
24
|
+
) -> list[ApplicationClientResponse] | None:
|
|
25
|
+
if response.status_code == 200:
|
|
26
|
+
response_200 = []
|
|
27
|
+
_response_200 = response.json()
|
|
28
|
+
for response_200_item_data in _response_200:
|
|
29
|
+
response_200_item = ApplicationClientResponse.from_dict(response_200_item_data)
|
|
30
|
+
|
|
31
|
+
response_200.append(response_200_item)
|
|
32
|
+
|
|
33
|
+
return response_200
|
|
34
|
+
|
|
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: AuthenticatedClient | Client, response: httpx.Response
|
|
43
|
+
) -> Response[list[ApplicationClientResponse]]:
|
|
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: AuthenticatedClient,
|
|
55
|
+
) -> Response[list[ApplicationClientResponse]]:
|
|
56
|
+
"""Read Application Clients
|
|
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[ApplicationClientResponse]]
|
|
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: AuthenticatedClient,
|
|
78
|
+
) -> list[ApplicationClientResponse] | None:
|
|
79
|
+
"""Read Application Clients
|
|
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[ApplicationClientResponse]
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
return sync_detailed(
|
|
90
|
+
client=client,
|
|
91
|
+
).parsed
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
async def asyncio_detailed(
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient,
|
|
97
|
+
) -> Response[list[ApplicationClientResponse]]:
|
|
98
|
+
"""Read Application Clients
|
|
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[ApplicationClientResponse]]
|
|
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: AuthenticatedClient,
|
|
118
|
+
) -> list[ApplicationClientResponse] | None:
|
|
119
|
+
"""Read Application Clients
|
|
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[ApplicationClientResponse]
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
await asyncio_detailed(
|
|
131
|
+
client=client,
|
|
132
|
+
)
|
|
133
|
+
).parsed
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
client_id: str,
|
|
15
|
+
scope_key: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "delete",
|
|
20
|
+
"url": "/api/v1/auth/clients/{client_id}/scopes/{scope_key}".format(
|
|
21
|
+
client_id=quote(str(client_id), safe=""),
|
|
22
|
+
scope_key=quote(str(scope_key), safe=""),
|
|
23
|
+
),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _kwargs
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _parse_response(
|
|
30
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
31
|
+
) -> Any | HTTPValidationError | None:
|
|
32
|
+
if response.status_code == 204:
|
|
33
|
+
response_204 = cast(Any, None)
|
|
34
|
+
return response_204
|
|
35
|
+
|
|
36
|
+
if response.status_code == 422:
|
|
37
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_422
|
|
40
|
+
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
49
|
+
) -> Response[Any | HTTPValidationError]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
client_id: str,
|
|
60
|
+
scope_key: str,
|
|
61
|
+
*,
|
|
62
|
+
client: AuthenticatedClient,
|
|
63
|
+
) -> Response[Any | HTTPValidationError]:
|
|
64
|
+
"""Revoke Application Client Scope Endpoint
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
client_id (str):
|
|
68
|
+
scope_key (str):
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
72
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Response[Any | HTTPValidationError]
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
kwargs = _get_kwargs(
|
|
79
|
+
client_id=client_id,
|
|
80
|
+
scope_key=scope_key,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
response = client.get_httpx_client().request(
|
|
84
|
+
**kwargs,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return _build_response(client=client, response=response)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def sync(
|
|
91
|
+
client_id: str,
|
|
92
|
+
scope_key: str,
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient,
|
|
95
|
+
) -> Any | HTTPValidationError | None:
|
|
96
|
+
"""Revoke Application Client Scope Endpoint
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
client_id (str):
|
|
100
|
+
scope_key (str):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Any | HTTPValidationError
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
client_id=client_id,
|
|
112
|
+
scope_key=scope_key,
|
|
113
|
+
client=client,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
client_id: str,
|
|
119
|
+
scope_key: str,
|
|
120
|
+
*,
|
|
121
|
+
client: AuthenticatedClient,
|
|
122
|
+
) -> Response[Any | HTTPValidationError]:
|
|
123
|
+
"""Revoke Application Client Scope Endpoint
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
client_id (str):
|
|
127
|
+
scope_key (str):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Response[Any | HTTPValidationError]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
kwargs = _get_kwargs(
|
|
138
|
+
client_id=client_id,
|
|
139
|
+
scope_key=scope_key,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
143
|
+
|
|
144
|
+
return _build_response(client=client, response=response)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
async def asyncio(
|
|
148
|
+
client_id: str,
|
|
149
|
+
scope_key: str,
|
|
150
|
+
*,
|
|
151
|
+
client: AuthenticatedClient,
|
|
152
|
+
) -> Any | HTTPValidationError | None:
|
|
153
|
+
"""Revoke Application Client Scope Endpoint
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
client_id (str):
|
|
157
|
+
scope_key (str):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Any | HTTPValidationError
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
await asyncio_detailed(
|
|
169
|
+
client_id=client_id,
|
|
170
|
+
scope_key=scope_key,
|
|
171
|
+
client=client,
|
|
172
|
+
)
|
|
173
|
+
).parsed
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
from ... import errors
|
|
9
|
+
from ...client import AuthenticatedClient, Client
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
client_id: str,
|
|
16
|
+
secret_id: UUID,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "delete",
|
|
21
|
+
"url": "/api/v1/auth/clients/{client_id}/secrets/{secret_id}".format(
|
|
22
|
+
client_id=quote(str(client_id), safe=""),
|
|
23
|
+
secret_id=quote(str(secret_id), safe=""),
|
|
24
|
+
),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _kwargs
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(
|
|
31
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
32
|
+
) -> Any | HTTPValidationError | None:
|
|
33
|
+
if response.status_code == 204:
|
|
34
|
+
response_204 = cast(Any, None)
|
|
35
|
+
return response_204
|
|
36
|
+
|
|
37
|
+
if response.status_code == 422:
|
|
38
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_422
|
|
41
|
+
|
|
42
|
+
if client.raise_on_unexpected_status:
|
|
43
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
44
|
+
else:
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _build_response(
|
|
49
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
50
|
+
) -> Response[Any | HTTPValidationError]:
|
|
51
|
+
return Response(
|
|
52
|
+
status_code=HTTPStatus(response.status_code),
|
|
53
|
+
content=response.content,
|
|
54
|
+
headers=response.headers,
|
|
55
|
+
parsed=_parse_response(client=client, response=response),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def sync_detailed(
|
|
60
|
+
client_id: str,
|
|
61
|
+
secret_id: UUID,
|
|
62
|
+
*,
|
|
63
|
+
client: AuthenticatedClient,
|
|
64
|
+
) -> Response[Any | HTTPValidationError]:
|
|
65
|
+
"""Revoke Application Client Secret Endpoint
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
client_id (str):
|
|
69
|
+
secret_id (UUID):
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Response[Any | HTTPValidationError]
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
kwargs = _get_kwargs(
|
|
80
|
+
client_id=client_id,
|
|
81
|
+
secret_id=secret_id,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
response = client.get_httpx_client().request(
|
|
85
|
+
**kwargs,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
return _build_response(client=client, response=response)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync(
|
|
92
|
+
client_id: str,
|
|
93
|
+
secret_id: UUID,
|
|
94
|
+
*,
|
|
95
|
+
client: AuthenticatedClient,
|
|
96
|
+
) -> Any | HTTPValidationError | None:
|
|
97
|
+
"""Revoke Application Client Secret Endpoint
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
client_id (str):
|
|
101
|
+
secret_id (UUID):
|
|
102
|
+
|
|
103
|
+
Raises:
|
|
104
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
105
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
Any | HTTPValidationError
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
return sync_detailed(
|
|
112
|
+
client_id=client_id,
|
|
113
|
+
secret_id=secret_id,
|
|
114
|
+
client=client,
|
|
115
|
+
).parsed
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
async def asyncio_detailed(
|
|
119
|
+
client_id: str,
|
|
120
|
+
secret_id: UUID,
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient,
|
|
123
|
+
) -> Response[Any | HTTPValidationError]:
|
|
124
|
+
"""Revoke Application Client Secret Endpoint
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
client_id (str):
|
|
128
|
+
secret_id (UUID):
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
132
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
Response[Any | HTTPValidationError]
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
kwargs = _get_kwargs(
|
|
139
|
+
client_id=client_id,
|
|
140
|
+
secret_id=secret_id,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
144
|
+
|
|
145
|
+
return _build_response(client=client, response=response)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
async def asyncio(
|
|
149
|
+
client_id: str,
|
|
150
|
+
secret_id: UUID,
|
|
151
|
+
*,
|
|
152
|
+
client: AuthenticatedClient,
|
|
153
|
+
) -> Any | HTTPValidationError | None:
|
|
154
|
+
"""Revoke Application Client Secret Endpoint
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
client_id (str):
|
|
158
|
+
secret_id (UUID):
|
|
159
|
+
|
|
160
|
+
Raises:
|
|
161
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
162
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Any | HTTPValidationError
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
await asyncio_detailed(
|
|
170
|
+
client_id=client_id,
|
|
171
|
+
secret_id=secret_id,
|
|
172
|
+
client=client,
|
|
173
|
+
)
|
|
174
|
+
).parsed
|