skillforge-client 0.3.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.
- skillforge_client-0.3.0/PKG-INFO +83 -0
- skillforge_client-0.3.0/README.md +63 -0
- skillforge_client-0.3.0/pyproject.toml +50 -0
- skillforge_client-0.3.0/pyproject.toml.orig +38 -0
- skillforge_client-0.3.0/skillforge_client/__init__.py +8 -0
- skillforge_client-0.3.0/skillforge_client/api/__init__.py +1 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/__init__.py +1 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/create_application_client_endpoint_api_v1_auth_clients_post.py +166 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/create_application_client_secret_endpoint_api_v1_auth_clients_client_id_secrets_post.py +182 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/create_token_api_v1_auth_token_post.py +165 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/grant_application_client_scopes_endpoint_api_v1_auth_clients_client_id_scopes_post.py +182 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/read_application_client_api_v1_auth_clients_client_id_get.py +161 -0
- skillforge_client-0.3.0/skillforge_client/api/auth/read_application_clients_api_v1_auth_clients_get.py +133 -0
- skillforge_client-0.3.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-0.3.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-0.3.0/skillforge_client/api/auth/update_application_client_endpoint_api_v1_auth_clients_client_id_patch.py +182 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/__init__.py +1 -0
- skillforge_client-0.3.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-0.3.0/skillforge_client/api/bot/cancel_operation_endpoint_api_v1_bot_operations_operation_id_cancel_post.py +203 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/check_authorization_endpoint_api_v1_bot_authz_check_post.py +206 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/claim_jobs_endpoint_api_v1_bot_jobs_claim_post.py +210 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/commit_student_activation_endpoint_api_v1_bot_students_activations_operation_id_commit_post.py +204 -0
- skillforge_client-0.3.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-0.3.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-0.3.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-0.3.0/skillforge_client/api/bot/commit_tutor_activation_endpoint_api_v1_bot_tutors_activations_operation_id_commit_post.py +204 -0
- skillforge_client-0.3.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-0.3.0/skillforge_client/api/bot/complete_job_endpoint_api_v1_bot_jobs_job_id_complete_post.py +183 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/deactivate_discord_account_endpoint_api_v1_bot_users_discord_id_account_delete.py +197 -0
- skillforge_client-0.3.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-0.3.0/skillforge_client/api/bot/fail_job_endpoint_api_v1_bot_jobs_job_id_fail_post.py +228 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/job_queue_summary_endpoint_api_v1_bot_jobs_summary_get.py +202 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/link_discord_account_endpoint_api_v1_bot_users_discord_id_account_put.py +227 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/list_jobs_endpoint_api_v1_bot_jobs_get.py +243 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/list_operations_endpoint_api_v1_bot_operations_get.py +302 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/prepare_student_activation_endpoint_api_v1_bot_students_activations_prepare_post.py +181 -0
- skillforge_client-0.3.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-0.3.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-0.3.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-0.3.0/skillforge_client/api/bot/prepare_tutor_activation_endpoint_api_v1_bot_tutors_activations_prepare_post.py +181 -0
- skillforge_client-0.3.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-0.3.0/skillforge_client/api/bot/read_job_api_v1_bot_jobs_job_id_get.py +186 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_operation_api_v1_bot_operations_operation_id_get.py +186 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_principal_api_v1_bot_runtime_principals_discord_id_get.py +177 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_principals_batch_api_v1_bot_runtime_principals_batch_post.py +189 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_student_context_api_v1_bot_runtime_students_guild_id_discord_id_get.py +191 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_student_contexts_batch_api_v1_bot_runtime_students_guild_id_batch_post.py +205 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_tutor_context_api_v1_bot_runtime_tutors_guild_id_discord_id_get.py +191 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/read_tutor_contexts_batch_api_v1_bot_runtime_tutors_guild_id_batch_post.py +205 -0
- skillforge_client-0.3.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-0.3.0/skillforge_client/api/bot/resolve_command_env_endpoint_api_v1_bot_runtime_command_envs_resolve_get.py +234 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/upsert_command_env_endpoint_api_v1_bot_command_envs_put.py +181 -0
- skillforge_client-0.3.0/skillforge_client/api/bot/upsert_discord_user_endpoint_api_v1_bot_users_discord_id_put.py +213 -0
- skillforge_client-0.3.0/skillforge_client/api/default/__init__.py +1 -0
- skillforge_client-0.3.0/skillforge_client/api/default/root_get.py +81 -0
- skillforge_client-0.3.0/skillforge_client/api/system/__init__.py +1 -0
- skillforge_client-0.3.0/skillforge_client/api/system/dependencies_health_check_health_dependencies_get.py +136 -0
- skillforge_client-0.3.0/skillforge_client/api/system/dependency_health_check_health_dependencies_dependency_name_get.py +170 -0
- skillforge_client-0.3.0/skillforge_client/api/system/liveness_check_health_live_get.py +132 -0
- skillforge_client-0.3.0/skillforge_client/api/system/system_health_check_health_get.py +136 -0
- skillforge_client-0.3.0/skillforge_client/api/system/worker_health_check_health_workers_worker_name_get.py +170 -0
- skillforge_client-0.3.0/skillforge_client/api/system/workers_health_check_health_workers_get.py +136 -0
- skillforge_client-0.3.0/skillforge_client/client.py +268 -0
- skillforge_client-0.3.0/skillforge_client/errors.py +16 -0
- skillforge_client-0.3.0/skillforge_client/models/__init__.py +167 -0
- skillforge_client-0.3.0/skillforge_client/models/access_token_response.py +85 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_create_request.py +91 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_response.py +149 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_scope_grant_request.py +61 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_secret_create_request.py +104 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_secret_response.py +160 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_status.py +9 -0
- skillforge_client-0.3.0/skillforge_client/models/application_client_update_request.py +124 -0
- skillforge_client-0.3.0/skillforge_client/models/authorization_check_request.py +78 -0
- skillforge_client-0.3.0/skillforge_client/models/authorization_check_response.py +61 -0
- skillforge_client-0.3.0/skillforge_client/models/body_create_token_api_v1_auth_token_post.py +123 -0
- skillforge_client-0.3.0/skillforge_client/models/bot_job.py +119 -0
- skillforge_client-0.3.0/skillforge_client/models/bot_job_payload.py +47 -0
- skillforge_client-0.3.0/skillforge_client/models/bot_principal.py +148 -0
- skillforge_client-0.3.0/skillforge_client/models/command_env_channel_response.py +100 -0
- skillforge_client-0.3.0/skillforge_client/models/command_env_kind.py +9 -0
- skillforge_client-0.3.0/skillforge_client/models/command_env_upsert_request.py +100 -0
- skillforge_client-0.3.0/skillforge_client/models/contact_info_profile.py +92 -0
- skillforge_client-0.3.0/skillforge_client/models/contact_info_type.py +9 -0
- skillforge_client-0.3.0/skillforge_client/models/created_client_secret_response.py +75 -0
- skillforge_client-0.3.0/skillforge_client/models/dependencies_health_check_response.py +77 -0
- skillforge_client-0.3.0/skillforge_client/models/dependencies_health_check_response_checks.py +56 -0
- skillforge_client-0.3.0/skillforge_client/models/dependency_health_check_response.py +72 -0
- skillforge_client-0.3.0/skillforge_client/models/dependency_name.py +8 -0
- skillforge_client-0.3.0/skillforge_client/models/discord_account_link_request.py +82 -0
- skillforge_client-0.3.0/skillforge_client/models/discord_account_link_response.py +86 -0
- skillforge_client-0.3.0/skillforge_client/models/discord_account_profile.py +77 -0
- skillforge_client-0.3.0/skillforge_client/models/discord_id_batch_request.py +62 -0
- skillforge_client-0.3.0/skillforge_client/models/discord_user_response.py +87 -0
- skillforge_client-0.3.0/skillforge_client/models/discord_user_upsert_request.py +81 -0
- skillforge_client-0.3.0/skillforge_client/models/error_response.py +61 -0
- skillforge_client-0.3.0/skillforge_client/models/external_accounts_profile.py +124 -0
- skillforge_client-0.3.0/skillforge_client/models/group_membership_response.py +69 -0
- skillforge_client-0.3.0/skillforge_client/models/health_check_response.py +63 -0
- skillforge_client-0.3.0/skillforge_client/models/health_status.py +10 -0
- skillforge_client-0.3.0/skillforge_client/models/http_validation_error.py +79 -0
- skillforge_client-0.3.0/skillforge_client/models/job_claim_request.py +113 -0
- skillforge_client-0.3.0/skillforge_client/models/job_detail.py +239 -0
- skillforge_client-0.3.0/skillforge_client/models/job_detail_payload.py +47 -0
- skillforge_client-0.3.0/skillforge_client/models/job_fail_request.py +82 -0
- skillforge_client-0.3.0/skillforge_client/models/job_kind_counts.py +92 -0
- skillforge_client-0.3.0/skillforge_client/models/job_list_item.py +225 -0
- skillforge_client-0.3.0/skillforge_client/models/job_page.py +100 -0
- skillforge_client-0.3.0/skillforge_client/models/job_queue_summary.py +106 -0
- skillforge_client-0.3.0/skillforge_client/models/job_response.py +187 -0
- skillforge_client-0.3.0/skillforge_client/models/job_status.py +11 -0
- skillforge_client-0.3.0/skillforge_client/models/job_status_counts.py +86 -0
- skillforge_client-0.3.0/skillforge_client/models/member_role.py +10 -0
- skillforge_client-0.3.0/skillforge_client/models/microsoft_account_profile.py +61 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_cancel_response.py +108 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_kind.py +13 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_page.py +100 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_response.py +257 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_response_plan.py +47 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_status.py +12 -0
- skillforge_client-0.3.0/skillforge_client/models/operation_summary.py +243 -0
- skillforge_client-0.3.0/skillforge_client/models/operational_profile.py +178 -0
- skillforge_client-0.3.0/skillforge_client/models/party_relation_type.py +10 -0
- skillforge_client-0.3.0/skillforge_client/models/person_profile.py +69 -0
- skillforge_client-0.3.0/skillforge_client/models/principal_batch.py +84 -0
- skillforge_client-0.3.0/skillforge_client/models/relation_profile.py +81 -0
- skillforge_client-0.3.0/skillforge_client/models/relation_profile_direction.py +9 -0
- skillforge_client-0.3.0/skillforge_client/models/student_activation_commit_request.py +61 -0
- skillforge_client-0.3.0/skillforge_client/models/student_activation_prepare_request.py +77 -0
- skillforge_client-0.3.0/skillforge_client/models/student_channel_state.py +9 -0
- skillforge_client-0.3.0/skillforge_client/models/student_context.py +140 -0
- skillforge_client-0.3.0/skillforge_client/models/student_context_batch.py +83 -0
- skillforge_client-0.3.0/skillforge_client/models/system_health_check_response.py +87 -0
- skillforge_client-0.3.0/skillforge_client/models/transition_commit_response.py +108 -0
- skillforge_client-0.3.0/skillforge_client/models/transition_prepare_response.py +95 -0
- skillforge_client-0.3.0/skillforge_client/models/transition_prepare_response_plan.py +47 -0
- skillforge_client-0.3.0/skillforge_client/models/tutor_activation_commit_request.py +69 -0
- skillforge_client-0.3.0/skillforge_client/models/tutor_activation_prepare_request.py +69 -0
- skillforge_client-0.3.0/skillforge_client/models/tutor_context.py +99 -0
- skillforge_client-0.3.0/skillforge_client/models/tutor_context_batch.py +83 -0
- skillforge_client-0.3.0/skillforge_client/models/validation_error.py +123 -0
- skillforge_client-0.3.0/skillforge_client/models/validation_error_context.py +47 -0
- skillforge_client-0.3.0/skillforge_client/models/worker_health_check_response.py +72 -0
- skillforge_client-0.3.0/skillforge_client/models/worker_name.py +8 -0
- skillforge_client-0.3.0/skillforge_client/models/workers_health_check_response.py +77 -0
- skillforge_client-0.3.0/skillforge_client/models/workers_health_check_response_checks.py +56 -0
- skillforge_client-0.3.0/skillforge_client/py.typed +1 -0
- skillforge_client-0.3.0/skillforge_client/types.py +54 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: skillforge-client
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Official Python client for the Skillforge API.
|
|
5
|
+
Keywords: skillforge,api,client,openapi
|
|
6
|
+
Author: Leon Weimann
|
|
7
|
+
Author-email: Leon Weimann <coding@leonweimann.de>
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Dist: httpx>=0.23.1,<0.29.0
|
|
14
|
+
Requires-Dist: attrs>=22.2.0
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Project-URL: Repository, https://github.com/Nachhilfe-Leon-Weimann/skillforge
|
|
17
|
+
Project-URL: Issues, https://github.com/Nachhilfe-Leon-Weimann/skillforge/issues
|
|
18
|
+
Project-URL: OpenAPI contract, https://github.com/Nachhilfe-Leon-Weimann/skillforge/blob/v0.3.0/openapi.json
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# Skillforge Python Client
|
|
22
|
+
|
|
23
|
+
Official, typed Python client for the Skillforge HTTP API. The package is generated from Skillforge's versioned OpenAPI contract and released with the matching Skillforge version.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
With [uv](https://docs.astral.sh/uv/):
|
|
28
|
+
|
|
29
|
+
```console
|
|
30
|
+
uv add skillforge-client
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or with pip:
|
|
34
|
+
|
|
35
|
+
```console
|
|
36
|
+
python -m pip install skillforge-client
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
Use `AuthenticatedClient` for endpoints protected by a Skillforge bearer token:
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import os
|
|
45
|
+
|
|
46
|
+
from skillforge_client import AuthenticatedClient
|
|
47
|
+
|
|
48
|
+
client = AuthenticatedClient(
|
|
49
|
+
base_url=os.environ["SKILLFORGE_URL"],
|
|
50
|
+
token=os.environ["SKILLFORGE_TOKEN"],
|
|
51
|
+
)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Endpoint functions are grouped by their OpenAPI tag. For example, the liveness endpoint can be called synchronously:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import os
|
|
58
|
+
|
|
59
|
+
from skillforge_client import Client
|
|
60
|
+
from skillforge_client.api.system import liveness_check_health_live_get
|
|
61
|
+
|
|
62
|
+
with Client(base_url=os.environ["SKILLFORGE_URL"]) as client:
|
|
63
|
+
health = liveness_check_health_live_get.sync(client=client)
|
|
64
|
+
|
|
65
|
+
if health is not None:
|
|
66
|
+
print(health.status.value)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Every generated endpoint module provides four variants:
|
|
70
|
+
|
|
71
|
+
- `sync`: blocking call returning the parsed response or `None`
|
|
72
|
+
- `sync_detailed`: blocking call returning status, headers, content, and the parsed response
|
|
73
|
+
- `asyncio`: asynchronous call returning the parsed response or `None`
|
|
74
|
+
- `asyncio_detailed`: asynchronous call returning the detailed response
|
|
75
|
+
|
|
76
|
+
Generated request and response models are available from `skillforge_client.models`.
|
|
77
|
+
|
|
78
|
+
## Versioning and source
|
|
79
|
+
|
|
80
|
+
Client versions follow Skillforge releases. This package was generated from the [`openapi.json`](https://github.com/Nachhilfe-Leon-Weimann/skillforge/blob/v0.3.0/openapi.json) contract for Skillforge v0.3.0; generated source is not maintained by hand.
|
|
81
|
+
|
|
82
|
+
- [Skillforge repository](https://github.com/Nachhilfe-Leon-Weimann/skillforge)
|
|
83
|
+
- [Issue tracker](https://github.com/Nachhilfe-Leon-Weimann/skillforge/issues)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Skillforge Python Client
|
|
2
|
+
|
|
3
|
+
Official, typed Python client for the Skillforge HTTP API. The package is generated from Skillforge's versioned OpenAPI contract and released with the matching Skillforge version.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
With [uv](https://docs.astral.sh/uv/):
|
|
8
|
+
|
|
9
|
+
```console
|
|
10
|
+
uv add skillforge-client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or with pip:
|
|
14
|
+
|
|
15
|
+
```console
|
|
16
|
+
python -m pip install skillforge-client
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
Use `AuthenticatedClient` for endpoints protected by a Skillforge bearer token:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import os
|
|
25
|
+
|
|
26
|
+
from skillforge_client import AuthenticatedClient
|
|
27
|
+
|
|
28
|
+
client = AuthenticatedClient(
|
|
29
|
+
base_url=os.environ["SKILLFORGE_URL"],
|
|
30
|
+
token=os.environ["SKILLFORGE_TOKEN"],
|
|
31
|
+
)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Endpoint functions are grouped by their OpenAPI tag. For example, the liveness endpoint can be called synchronously:
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
import os
|
|
38
|
+
|
|
39
|
+
from skillforge_client import Client
|
|
40
|
+
from skillforge_client.api.system import liveness_check_health_live_get
|
|
41
|
+
|
|
42
|
+
with Client(base_url=os.environ["SKILLFORGE_URL"]) as client:
|
|
43
|
+
health = liveness_check_health_live_get.sync(client=client)
|
|
44
|
+
|
|
45
|
+
if health is not None:
|
|
46
|
+
print(health.status.value)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Every generated endpoint module provides four variants:
|
|
50
|
+
|
|
51
|
+
- `sync`: blocking call returning the parsed response or `None`
|
|
52
|
+
- `sync_detailed`: blocking call returning status, headers, content, and the parsed response
|
|
53
|
+
- `asyncio`: asynchronous call returning the parsed response or `None`
|
|
54
|
+
- `asyncio_detailed`: asynchronous call returning the detailed response
|
|
55
|
+
|
|
56
|
+
Generated request and response models are available from `skillforge_client.models`.
|
|
57
|
+
|
|
58
|
+
## Versioning and source
|
|
59
|
+
|
|
60
|
+
Client versions follow Skillforge releases. This package was generated from the [`openapi.json`](https://github.com/Nachhilfe-Leon-Weimann/skillforge/blob/v0.3.0/openapi.json) contract for Skillforge v0.3.0; generated source is not maintained by hand.
|
|
61
|
+
|
|
62
|
+
- [Skillforge repository](https://github.com/Nachhilfe-Leon-Weimann/skillforge)
|
|
63
|
+
- [Issue tracker](https://github.com/Nachhilfe-Leon-Weimann/skillforge/issues)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "skillforge-client"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "Official Python client for the Skillforge API."
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
keywords = [
|
|
8
|
+
"skillforge",
|
|
9
|
+
"api",
|
|
10
|
+
"client",
|
|
11
|
+
"openapi",
|
|
12
|
+
]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
+
"Typing :: Typed",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"httpx>=0.23.1,<0.29.0",
|
|
22
|
+
"attrs>=22.2.0",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[[project.authors]]
|
|
26
|
+
name = "Leon Weimann"
|
|
27
|
+
email = "coding@leonweimann.de"
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Repository = "https://github.com/Nachhilfe-Leon-Weimann/skillforge"
|
|
31
|
+
Issues = "https://github.com/Nachhilfe-Leon-Weimann/skillforge/issues"
|
|
32
|
+
"OpenAPI contract" = "https://github.com/Nachhilfe-Leon-Weimann/skillforge/blob/v0.3.0/openapi.json"
|
|
33
|
+
|
|
34
|
+
[tool.uv.build-backend]
|
|
35
|
+
module-name = "skillforge_client"
|
|
36
|
+
module-root = ""
|
|
37
|
+
|
|
38
|
+
[tool.ruff]
|
|
39
|
+
line-length = 120
|
|
40
|
+
|
|
41
|
+
[tool.ruff.lint]
|
|
42
|
+
select = [
|
|
43
|
+
"F",
|
|
44
|
+
"I",
|
|
45
|
+
"UP",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[build-system]
|
|
49
|
+
requires = ["uv_build>=0.12.0,<0.13"]
|
|
50
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "skillforge-client"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "Official Python client for the Skillforge API."
|
|
5
|
+
authors = [{ name = "Leon Weimann", email = "coding@leonweimann.de" }]
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = ["skillforge", "api", "client", "openapi"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 3 - Alpha",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"Programming Language :: Python :: 3",
|
|
13
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
14
|
+
"Typing :: Typed",
|
|
15
|
+
]
|
|
16
|
+
dependencies = [
|
|
17
|
+
"httpx>=0.23.1,<0.29.0",
|
|
18
|
+
"attrs>=22.2.0",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Repository = "https://github.com/Nachhilfe-Leon-Weimann/skillforge"
|
|
23
|
+
Issues = "https://github.com/Nachhilfe-Leon-Weimann/skillforge/issues"
|
|
24
|
+
"OpenAPI contract" = "https://github.com/Nachhilfe-Leon-Weimann/skillforge/blob/v0.3.0/openapi.json"
|
|
25
|
+
|
|
26
|
+
[tool.uv.build-backend]
|
|
27
|
+
module-name = "skillforge_client"
|
|
28
|
+
module-root = ""
|
|
29
|
+
|
|
30
|
+
[build-system]
|
|
31
|
+
requires = ["uv_build>=0.12.0,<0.13"]
|
|
32
|
+
build-backend = "uv_build"
|
|
33
|
+
|
|
34
|
+
[tool.ruff]
|
|
35
|
+
line-length = 120
|
|
36
|
+
|
|
37
|
+
[tool.ruff.lint]
|
|
38
|
+
select = ["F", "I", "UP"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,166 @@
|
|
|
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_create_request import ApplicationClientCreateRequest
|
|
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
|
+
*,
|
|
16
|
+
body: ApplicationClientCreateRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/api/v1/auth/clients",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
35
|
+
) -> ApplicationClientResponse | HTTPValidationError | None:
|
|
36
|
+
if response.status_code == 201:
|
|
37
|
+
response_201 = ApplicationClientResponse.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_201
|
|
40
|
+
|
|
41
|
+
if response.status_code == 422:
|
|
42
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_422
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[ApplicationClientResponse | HTTPValidationError]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
*,
|
|
65
|
+
client: AuthenticatedClient,
|
|
66
|
+
body: ApplicationClientCreateRequest,
|
|
67
|
+
) -> Response[ApplicationClientResponse | HTTPValidationError]:
|
|
68
|
+
"""Create Application Client Endpoint
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
body (ApplicationClientCreateRequest):
|
|
72
|
+
|
|
73
|
+
Raises:
|
|
74
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
75
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Response[ApplicationClientResponse | HTTPValidationError]
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
kwargs = _get_kwargs(
|
|
82
|
+
body=body,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
response = client.get_httpx_client().request(
|
|
86
|
+
**kwargs,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
return _build_response(client=client, response=response)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def sync(
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient,
|
|
95
|
+
body: ApplicationClientCreateRequest,
|
|
96
|
+
) -> ApplicationClientResponse | HTTPValidationError | None:
|
|
97
|
+
"""Create Application Client Endpoint
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
body (ApplicationClientCreateRequest):
|
|
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
|
+
ApplicationClientResponse | HTTPValidationError
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
client=client,
|
|
112
|
+
body=body,
|
|
113
|
+
).parsed
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def asyncio_detailed(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
body: ApplicationClientCreateRequest,
|
|
120
|
+
) -> Response[ApplicationClientResponse | HTTPValidationError]:
|
|
121
|
+
"""Create Application Client Endpoint
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
body (ApplicationClientCreateRequest):
|
|
125
|
+
|
|
126
|
+
Raises:
|
|
127
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
128
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Response[ApplicationClientResponse | HTTPValidationError]
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
kwargs = _get_kwargs(
|
|
135
|
+
body=body,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
139
|
+
|
|
140
|
+
return _build_response(client=client, response=response)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
async def asyncio(
|
|
144
|
+
*,
|
|
145
|
+
client: AuthenticatedClient,
|
|
146
|
+
body: ApplicationClientCreateRequest,
|
|
147
|
+
) -> ApplicationClientResponse | HTTPValidationError | None:
|
|
148
|
+
"""Create Application Client Endpoint
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
body (ApplicationClientCreateRequest):
|
|
152
|
+
|
|
153
|
+
Raises:
|
|
154
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
155
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
ApplicationClientResponse | HTTPValidationError
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
await asyncio_detailed(
|
|
163
|
+
client=client,
|
|
164
|
+
body=body,
|
|
165
|
+
)
|
|
166
|
+
).parsed
|
|
@@ -0,0 +1,182 @@
|
|
|
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_secret_create_request import ApplicationClientSecretCreateRequest
|
|
10
|
+
from ...models.created_client_secret_response import CreatedClientSecretResponse
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from ...types import Response
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
client_id: str,
|
|
17
|
+
*,
|
|
18
|
+
body: ApplicationClientSecretCreateRequest,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "post",
|
|
24
|
+
"url": "/api/v1/auth/clients/{client_id}/secrets".format(
|
|
25
|
+
client_id=quote(str(client_id), safe=""),
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_kwargs["json"] = body.to_dict()
|
|
30
|
+
|
|
31
|
+
headers["Content-Type"] = "application/json"
|
|
32
|
+
|
|
33
|
+
_kwargs["headers"] = headers
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(
|
|
38
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
39
|
+
) -> CreatedClientSecretResponse | HTTPValidationError | None:
|
|
40
|
+
if response.status_code == 201:
|
|
41
|
+
response_201 = CreatedClientSecretResponse.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_201
|
|
44
|
+
|
|
45
|
+
if response.status_code == 422:
|
|
46
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_422
|
|
49
|
+
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
58
|
+
) -> Response[CreatedClientSecretResponse | HTTPValidationError]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
client_id: str,
|
|
69
|
+
*,
|
|
70
|
+
client: AuthenticatedClient,
|
|
71
|
+
body: ApplicationClientSecretCreateRequest,
|
|
72
|
+
) -> Response[CreatedClientSecretResponse | HTTPValidationError]:
|
|
73
|
+
"""Create Application Client Secret Endpoint
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
client_id (str):
|
|
77
|
+
body (ApplicationClientSecretCreateRequest):
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Response[CreatedClientSecretResponse | HTTPValidationError]
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs(
|
|
88
|
+
client_id=client_id,
|
|
89
|
+
body=body,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
response = client.get_httpx_client().request(
|
|
93
|
+
**kwargs,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
return _build_response(client=client, response=response)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync(
|
|
100
|
+
client_id: str,
|
|
101
|
+
*,
|
|
102
|
+
client: AuthenticatedClient,
|
|
103
|
+
body: ApplicationClientSecretCreateRequest,
|
|
104
|
+
) -> CreatedClientSecretResponse | HTTPValidationError | None:
|
|
105
|
+
"""Create Application Client Secret Endpoint
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
client_id (str):
|
|
109
|
+
body (ApplicationClientSecretCreateRequest):
|
|
110
|
+
|
|
111
|
+
Raises:
|
|
112
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
113
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
CreatedClientSecretResponse | HTTPValidationError
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
client_id=client_id,
|
|
121
|
+
client=client,
|
|
122
|
+
body=body,
|
|
123
|
+
).parsed
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
async def asyncio_detailed(
|
|
127
|
+
client_id: str,
|
|
128
|
+
*,
|
|
129
|
+
client: AuthenticatedClient,
|
|
130
|
+
body: ApplicationClientSecretCreateRequest,
|
|
131
|
+
) -> Response[CreatedClientSecretResponse | HTTPValidationError]:
|
|
132
|
+
"""Create Application Client Secret Endpoint
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
client_id (str):
|
|
136
|
+
body (ApplicationClientSecretCreateRequest):
|
|
137
|
+
|
|
138
|
+
Raises:
|
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
Response[CreatedClientSecretResponse | HTTPValidationError]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
kwargs = _get_kwargs(
|
|
147
|
+
client_id=client_id,
|
|
148
|
+
body=body,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
152
|
+
|
|
153
|
+
return _build_response(client=client, response=response)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
async def asyncio(
|
|
157
|
+
client_id: str,
|
|
158
|
+
*,
|
|
159
|
+
client: AuthenticatedClient,
|
|
160
|
+
body: ApplicationClientSecretCreateRequest,
|
|
161
|
+
) -> CreatedClientSecretResponse | HTTPValidationError | None:
|
|
162
|
+
"""Create Application Client Secret Endpoint
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
client_id (str):
|
|
166
|
+
body (ApplicationClientSecretCreateRequest):
|
|
167
|
+
|
|
168
|
+
Raises:
|
|
169
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
170
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
CreatedClientSecretResponse | HTTPValidationError
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
await asyncio_detailed(
|
|
178
|
+
client_id=client_id,
|
|
179
|
+
client=client,
|
|
180
|
+
body=body,
|
|
181
|
+
)
|
|
182
|
+
).parsed
|