prdb-sdk 0.1.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.
- prdb_sdk-0.1.0/.gitignore +28 -0
- prdb_sdk-0.1.0/LICENSE +21 -0
- prdb_sdk-0.1.0/PKG-INFO +109 -0
- prdb_sdk-0.1.0/README.md +83 -0
- prdb_sdk-0.1.0/pyproject.toml +54 -0
- prdb_sdk-0.1.0/src/prdb_sdk/__init__.py +31 -0
- prdb_sdk-0.1.0/src/prdb_sdk/client.py +178 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/actors/actors_request_builder.py +163 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/actors/batch/batch_request_builder.py +90 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/actors/changes/changes_request_builder.py +112 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/actors/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/actors/item/actors_item_request_builder.py +82 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/downloaded_from_indexers/downloaded_from_indexers_request_builder.py +108 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/downloaded_from_indexers/item/filenames/filenames_request_builder.py +108 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/downloaded_from_indexers/item/filenames/item/with_filename_item_request_builder.py +129 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/downloaded_from_indexers/item/with_downloaded_from_indexer_item_request_builder.py +139 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_actors/changes/changes_request_builder.py +112 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_actors/favorite_actors_request_builder.py +145 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_actors/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_actors/item/with_actor_item_request_builder.py +116 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_sites/changes/changes_request_builder.py +112 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_sites/favorite_sites_request_builder.py +145 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_sites/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/favorite_sites/item/with_site_item_request_builder.py +116 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/health/health_request_builder.py +75 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/changes/changes_request_builder.py +121 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/changes/get_indexer_source_query_parameter_type.py +7 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/indexer_filehashes_request_builder.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/latest/get_indexer_source_query_parameter_type.py +7 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/latest/get_sort_by_query_parameter_type.py +8 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/latest/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/latest/latest_request_builder.py +146 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/indexer_filehashes/lookup/lookup_request_builder.py +90 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/kiota-lock.json +35 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/active_subscription_dto.py +60 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_alias_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_bio_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_change_actor_dto.py +205 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_change_alias_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_change_bio_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_change_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_change_image_dto.py +60 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_change_link_dto.py +55 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_detail_dto.py +197 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_image_detail_dto.py +60 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_link_dto.py +55 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/actor_summary_dto.py +85 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/add_downloaded_from_indexer_filename_request.py +59 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/add_downloaded_from_indexer_request.py +79 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/add_wanted_videos_batch_request.py +48 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/add_wanted_videos_batch_response.py +55 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/downloaded_from_indexer_filename_dto.py +77 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/downloaded_from_indexer_response.py +92 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_actor_change_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_actor_change_favorite_actor_dto.py +85 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_actor_changes_cursor_dto.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_actor_summary_dto.py +73 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_site_change_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_site_change_favorite_site_dto.py +81 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_site_changes_cursor_dto.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/favorite_site_summary_dto.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_actor_changes_response.py +72 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_actors_by_ids_request.py +48 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_favorite_actor_changes_response.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_favorite_site_changes_response.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_health_response.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_indexer_filehash_changes_response.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_rate_limit_response.py +62 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_video_filehash_changes_response.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_video_filehashes_by_video_ids_request.py +48 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_video_filehashes_by_video_ids_response.py +59 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_video_user_image_changes_response.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_videos_by_ids_request.py +48 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/get_wanted_video_changes_response.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/indexer_filehash_change_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/indexer_filehash_change_filehash_dto.py +97 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/indexer_filehash_changes_cursor_dto.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/indexer_filehash_dto.py +89 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/indexer_filehash_lookup_key_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/indexer_filehash_lookup_key_dto_indexer_source.py +7 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/latest_indexer_filehashes_response.py +74 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/latest_pre_db_item_dto.py +68 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/latest_pre_db_response.py +66 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/latest_pre_db_site_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/latest_pre_db_video_dto.py +68 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/latest_video_filehashes_response.py +74 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_actors_response.py +78 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_favorite_actors_response.py +78 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_favorite_sites_response.py +78 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_pre_db_response.py +74 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_sites_response.py +74 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_videos_response.py +74 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/list_wanted_videos_response.py +78 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/lookup_indexer_filehashes_request.py +75 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/lookup_indexer_filehashes_response.py +54 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/lookup_video_filehashes_request.py +68 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/lookup_video_filehashes_response.py +54 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/pre_db_item_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/pre_db_summary_dto.py +69 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/pre_db_video_group_dto.py +71 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/problem_details.py +70 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/rate_limit_window_status.py +59 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/report_video_user_image_request.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/report_video_user_image_request_reason.py +11 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/report_video_user_image_response.py +60 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/search_pre_db_by_video_response.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/site_summary_dto.py +64 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/submit_video_user_image_response.py +60 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/unlinked_video_filehashes_response.py +74 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/update_downloaded_from_indexer_filename_request.py +59 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/update_downloaded_from_indexer_request.py +63 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/update_wanted_video_request.py +64 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/update_wanted_video_response.py +77 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/user_identity_response.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_actor_dto.py +76 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_actor_image_dto.py +56 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_dto.py +97 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_image_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_network_dto.py +56 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_pre_name_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_detail_site_dto.py +67 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_filehash_change_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_filehash_change_filehash_dto.py +93 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_filehash_changes_cursor_dto.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_filehash_dto.py +85 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_filehashes_by_video_id_dto.py +59 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_summary_actor_dto.py +52 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_summary_dto.py +80 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_user_image_change_item_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_user_image_changes_cursor_dto.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/video_user_image_dto.py +137 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/wanted_video_change_dto.py +58 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/wanted_video_change_wanted_video_dto.py +105 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/wanted_video_changes_cursor_dto.py +53 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/models/wanted_video_summary_dto.py +97 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/prdb_client.py +173 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/predb/get_category_query_parameter_type.py +7 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/predb/get_sort_by_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/predb/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/predb/latest/latest_request_builder.py +120 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/predb/predb_request_builder.py +154 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/predb/search_by_video/search_by_video_request_builder.py +107 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/rate_limit/rate_limit_request_builder.py +81 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/sites/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/sites/sites_request_builder.py +118 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/user_identity/user_identity_request_builder.py +81 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/video_user_images/by_os_hash/by_os_hash_request_builder.py +38 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/video_user_images/by_os_hash/item/with_based_on_file_with_os_hash_item_request_builder.py +82 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/video_user_images/changes/changes_request_builder.py +112 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/video_user_images/item/item_request_builder.py +92 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/video_user_images/item/report/report_request_builder.py +93 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/video_user_images/video_user_images_request_builder.py +129 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/batch/batch_request_builder.py +90 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/batch/batch_request_builder.py +90 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/changes/changes_request_builder.py +120 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/filehashes_request_builder.py +73 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/latest/get_sort_by_query_parameter_type.py +8 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/latest/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/latest/latest_request_builder.py +146 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/lookup/lookup_request_builder.py +90 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/unlinked/get_sort_by_query_parameter_type.py +8 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/unlinked/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/filehashes/unlinked/unlinked_request_builder.py +116 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/get_sort_by_query_parameter_type.py +7 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/item/filehashes/filehashes_request_builder.py +82 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/item/item_request_builder.py +102 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/item/user_images/user_images_request_builder.py +82 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/videos/videos_request_builder.py +173 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/wanted_videos/batch/batch_request_builder.py +90 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/wanted_videos/changes/changes_request_builder.py +112 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/wanted_videos/get_sort_direction_query_parameter_type.py +6 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/wanted_videos/item/with_video_item_request_builder.py +165 -0
- prdb_sdk-0.1.0/src/prdb_sdk/generated/wanted_videos/wanted_videos_request_builder.py +171 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Local, machine-specific agent instructions — never committed
|
|
2
|
+
CLAUDE.local.md
|
|
3
|
+
|
|
4
|
+
# Kiota writes a generation log next to the output; it is noise, not source.
|
|
5
|
+
.kiota.log
|
|
6
|
+
|
|
7
|
+
# Python
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
build/
|
|
11
|
+
dist/
|
|
12
|
+
*.egg-info/
|
|
13
|
+
.venv/
|
|
14
|
+
|
|
15
|
+
# TypeScript
|
|
16
|
+
node_modules/
|
|
17
|
+
typescript/dist/
|
|
18
|
+
typescript/.test-dist/
|
|
19
|
+
*.tsbuildinfo
|
|
20
|
+
|
|
21
|
+
# .NET
|
|
22
|
+
bin/
|
|
23
|
+
obj/
|
|
24
|
+
|
|
25
|
+
# Editors / OS
|
|
26
|
+
.DS_Store
|
|
27
|
+
.idea/
|
|
28
|
+
.vscode/
|
prdb_sdk-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 prdb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
prdb_sdk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prdb-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for the prdb Public API
|
|
5
|
+
Project-URL: Homepage, https://github.com/prdb-net/prdb-sdk
|
|
6
|
+
Project-URL: Repository, https://github.com/prdb-net/prdb-sdk
|
|
7
|
+
Project-URL: Issues, https://github.com/prdb-net/prdb-sdk/issues
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: api,client,prdb,sdk
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: microsoft-kiota-bundle<2.0.0,>=1.11.7
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# prdb-sdk (Python)
|
|
28
|
+
|
|
29
|
+
Python client for the [prdb Public API](https://apidocs.prdb.net/).
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install prdb-sdk
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Requires Python 3.10 or newer. The client is async and uses `httpx` under the
|
|
38
|
+
hood, by way of the Kiota bundle.
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import asyncio
|
|
44
|
+
from uuid import UUID
|
|
45
|
+
|
|
46
|
+
from prdb_sdk import create_client
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
async def main() -> None:
|
|
50
|
+
client = create_client(api_key="...")
|
|
51
|
+
|
|
52
|
+
# GET /videos
|
|
53
|
+
page = await client.videos.get()
|
|
54
|
+
for video in page.items or []:
|
|
55
|
+
print(video.title)
|
|
56
|
+
|
|
57
|
+
# GET /videos/{id}
|
|
58
|
+
video = await client.videos.by_id(UUID("...")).get()
|
|
59
|
+
|
|
60
|
+
# Query parameters are typed, including the closed-set ones.
|
|
61
|
+
from prdb_sdk.generated.videos.videos_request_builder import VideosRequestBuilder
|
|
62
|
+
|
|
63
|
+
config = VideosRequestBuilder.VideosRequestBuilderGetRequestConfiguration(
|
|
64
|
+
query_parameters=VideosRequestBuilder.VideosRequestBuilderGetQueryParameters(
|
|
65
|
+
page=2,
|
|
66
|
+
page_size=50,
|
|
67
|
+
search="...",
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
page_two = await client.videos.get(request_configuration=config)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
asyncio.run(main())
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The request builders mirror the API's URL structure, so `GET /videos/{id}/filehashes`
|
|
77
|
+
is `client.videos.by_id(video_id).filehashes.get()`.
|
|
78
|
+
|
|
79
|
+
## Authentication
|
|
80
|
+
|
|
81
|
+
`create_client` sends the key in the `X-Api-Key` header, and keeps it on the API
|
|
82
|
+
host: a redirect to a different origin raises `CrossOriginRedirectError` rather
|
|
83
|
+
than handing your credential to whoever answers there. Redirects that stay on
|
|
84
|
+
the same origin are followed normally.
|
|
85
|
+
|
|
86
|
+
`base_url` must use `https`, so the key is never sent in cleartext.
|
|
87
|
+
|
|
88
|
+
`GET /health` is the only endpoint that works without a key; use
|
|
89
|
+
`create_anonymous_client()` for health probes. That one has no credential to
|
|
90
|
+
protect, so it accepts a plain `http` base URL.
|
|
91
|
+
|
|
92
|
+
## Options
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
client = create_client(
|
|
96
|
+
api_key="...",
|
|
97
|
+
base_url="https://api.prdb.net", # override for a staging deployment
|
|
98
|
+
http_client=my_httpx_async_client, # control timeouts, proxies, connection limits
|
|
99
|
+
)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The client you pass in is configured with the SDK's middleware in place, so it
|
|
103
|
+
behaves like the one built for you — same redirect rule, same retry handling.
|
|
104
|
+
|
|
105
|
+
## Generated code
|
|
106
|
+
|
|
107
|
+
Everything under `prdb_sdk/generated/` is produced by Kiota from
|
|
108
|
+
`spec/openapi.json` in the repository root and is overwritten on every
|
|
109
|
+
regeneration. Do not edit it — see the [root README](../README.md#regenerating).
|
prdb_sdk-0.1.0/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# prdb-sdk (Python)
|
|
2
|
+
|
|
3
|
+
Python client for the [prdb Public API](https://apidocs.prdb.net/).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install prdb-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Python 3.10 or newer. The client is async and uses `httpx` under the
|
|
12
|
+
hood, by way of the Kiota bundle.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
import asyncio
|
|
18
|
+
from uuid import UUID
|
|
19
|
+
|
|
20
|
+
from prdb_sdk import create_client
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
async def main() -> None:
|
|
24
|
+
client = create_client(api_key="...")
|
|
25
|
+
|
|
26
|
+
# GET /videos
|
|
27
|
+
page = await client.videos.get()
|
|
28
|
+
for video in page.items or []:
|
|
29
|
+
print(video.title)
|
|
30
|
+
|
|
31
|
+
# GET /videos/{id}
|
|
32
|
+
video = await client.videos.by_id(UUID("...")).get()
|
|
33
|
+
|
|
34
|
+
# Query parameters are typed, including the closed-set ones.
|
|
35
|
+
from prdb_sdk.generated.videos.videos_request_builder import VideosRequestBuilder
|
|
36
|
+
|
|
37
|
+
config = VideosRequestBuilder.VideosRequestBuilderGetRequestConfiguration(
|
|
38
|
+
query_parameters=VideosRequestBuilder.VideosRequestBuilderGetQueryParameters(
|
|
39
|
+
page=2,
|
|
40
|
+
page_size=50,
|
|
41
|
+
search="...",
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
page_two = await client.videos.get(request_configuration=config)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
asyncio.run(main())
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The request builders mirror the API's URL structure, so `GET /videos/{id}/filehashes`
|
|
51
|
+
is `client.videos.by_id(video_id).filehashes.get()`.
|
|
52
|
+
|
|
53
|
+
## Authentication
|
|
54
|
+
|
|
55
|
+
`create_client` sends the key in the `X-Api-Key` header, and keeps it on the API
|
|
56
|
+
host: a redirect to a different origin raises `CrossOriginRedirectError` rather
|
|
57
|
+
than handing your credential to whoever answers there. Redirects that stay on
|
|
58
|
+
the same origin are followed normally.
|
|
59
|
+
|
|
60
|
+
`base_url` must use `https`, so the key is never sent in cleartext.
|
|
61
|
+
|
|
62
|
+
`GET /health` is the only endpoint that works without a key; use
|
|
63
|
+
`create_anonymous_client()` for health probes. That one has no credential to
|
|
64
|
+
protect, so it accepts a plain `http` base URL.
|
|
65
|
+
|
|
66
|
+
## Options
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
client = create_client(
|
|
70
|
+
api_key="...",
|
|
71
|
+
base_url="https://api.prdb.net", # override for a staging deployment
|
|
72
|
+
http_client=my_httpx_async_client, # control timeouts, proxies, connection limits
|
|
73
|
+
)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The client you pass in is configured with the SDK's middleware in place, so it
|
|
77
|
+
behaves like the one built for you — same redirect rule, same retry handling.
|
|
78
|
+
|
|
79
|
+
## Generated code
|
|
80
|
+
|
|
81
|
+
Everything under `prdb_sdk/generated/` is produced by Kiota from
|
|
82
|
+
`spec/openapi.json` in the repository root and is overwritten on every
|
|
83
|
+
regeneration. Do not edit it — see the [root README](../README.md#regenerating).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "prdb-sdk"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Python SDK for the prdb Public API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
keywords = ["prdb", "sdk", "api", "client"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
dependencies = [
|
|
25
|
+
# Pulls in kiota abstractions, HTTP and the four serializers the generated
|
|
26
|
+
# code imports (json, text, form, multipart).
|
|
27
|
+
"microsoft-kiota-bundle>=1.11.7,<2.0.0",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
dev = [
|
|
32
|
+
"pytest>=8.0",
|
|
33
|
+
"pytest-asyncio>=0.24",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Homepage = "https://github.com/prdb-net/prdb-sdk"
|
|
38
|
+
Repository = "https://github.com/prdb-net/prdb-sdk"
|
|
39
|
+
Issues = "https://github.com/prdb-net/prdb-sdk/issues"
|
|
40
|
+
|
|
41
|
+
[tool.hatch.build.targets.wheel]
|
|
42
|
+
# Packaged as a whole directory: the generated tree uses PEP 420 implicit
|
|
43
|
+
# namespace packages and carries no __init__.py files.
|
|
44
|
+
packages = ["src/prdb_sdk"]
|
|
45
|
+
|
|
46
|
+
[tool.hatch.build.targets.sdist]
|
|
47
|
+
# LICENSE is a copy of the repository's, so the published artifact carries its
|
|
48
|
+
# own licence rather than pointing at a file the consumer does not have.
|
|
49
|
+
include = ["src/prdb_sdk", "README.md", "LICENSE"]
|
|
50
|
+
|
|
51
|
+
[tool.pytest.ini_options]
|
|
52
|
+
testpaths = ["tests"]
|
|
53
|
+
# Every wrapper test drives an async client, so async tests need no marker.
|
|
54
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Python SDK for the prdb Public API.
|
|
2
|
+
|
|
3
|
+
The request builders under the returned client mirror the API's URL structure::
|
|
4
|
+
|
|
5
|
+
from prdb_sdk import create_client
|
|
6
|
+
|
|
7
|
+
client = create_client(api_key="...")
|
|
8
|
+
page = await client.videos.get()
|
|
9
|
+
video = await client.videos.by_id(video_id).get()
|
|
10
|
+
|
|
11
|
+
Everything under ``prdb_sdk.generated`` is produced by Kiota from
|
|
12
|
+
``spec/openapi.json`` and is overwritten on every regeneration. Do not edit it.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from .client import (
|
|
16
|
+
API_KEY_HEADER,
|
|
17
|
+
DEFAULT_BASE_URL,
|
|
18
|
+
CrossOriginRedirectError,
|
|
19
|
+
PrdbClient,
|
|
20
|
+
create_anonymous_client,
|
|
21
|
+
create_client,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"API_KEY_HEADER",
|
|
26
|
+
"DEFAULT_BASE_URL",
|
|
27
|
+
"CrossOriginRedirectError",
|
|
28
|
+
"PrdbClient",
|
|
29
|
+
"create_anonymous_client",
|
|
30
|
+
"create_client",
|
|
31
|
+
]
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"""Client construction for the prdb Public API."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from urllib.parse import urlparse
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
from kiota_abstractions.authentication.anonymous_authentication_provider import (
|
|
10
|
+
AnonymousAuthenticationProvider,
|
|
11
|
+
)
|
|
12
|
+
from kiota_abstractions.authentication.authentication_provider import (
|
|
13
|
+
AuthenticationProvider,
|
|
14
|
+
)
|
|
15
|
+
from kiota_abstractions.authentication.api_key_authentication_provider import (
|
|
16
|
+
ApiKeyAuthenticationProvider,
|
|
17
|
+
KeyLocation,
|
|
18
|
+
)
|
|
19
|
+
from kiota_bundle.default_request_adapter import DefaultRequestAdapter
|
|
20
|
+
from kiota_http.kiota_client_factory import KiotaClientFactory
|
|
21
|
+
from kiota_http.middleware.options import RedirectHandlerOption
|
|
22
|
+
|
|
23
|
+
from .generated.prdb_client import PrdbClient
|
|
24
|
+
|
|
25
|
+
#: Header the API expects the key in.
|
|
26
|
+
API_KEY_HEADER = "X-Api-Key"
|
|
27
|
+
|
|
28
|
+
#: Production base URL, also the default baked into the generated client.
|
|
29
|
+
DEFAULT_BASE_URL = "https://api.prdb.net"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class CrossOriginRedirectError(RuntimeError):
|
|
33
|
+
"""Raised when the API redirects to a different origin.
|
|
34
|
+
|
|
35
|
+
Following such a redirect would hand the API key to whoever answers at the
|
|
36
|
+
new location, so the SDK refuses it. Redirects that stay on the same origin
|
|
37
|
+
are followed normally.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def create_client(
|
|
42
|
+
api_key: str,
|
|
43
|
+
*,
|
|
44
|
+
base_url: str = DEFAULT_BASE_URL,
|
|
45
|
+
http_client: Optional[httpx.AsyncClient] = None,
|
|
46
|
+
) -> PrdbClient:
|
|
47
|
+
"""Create a client authenticated with an API key.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
api_key: The API key, sent in the ``X-Api-Key`` header on every request.
|
|
51
|
+
base_url: Override the API root. Useful for a staging deployment. Must
|
|
52
|
+
use ``https``, so the key never travels in cleartext.
|
|
53
|
+
http_client: Supply your own ``httpx.AsyncClient`` to control timeouts,
|
|
54
|
+
proxies or connection limits. One is created for you when omitted.
|
|
55
|
+
Either way the SDK's middleware is installed on it, which modifies
|
|
56
|
+
the client you pass in place.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
A client whose request builders mirror the API's URL structure, so
|
|
60
|
+
``GET /videos/{id}`` is ``client.videos.by_id(video_id).get()``.
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
ValueError: If ``api_key`` is empty, or ``base_url`` is not an absolute
|
|
64
|
+
``https`` URL.
|
|
65
|
+
"""
|
|
66
|
+
if not api_key:
|
|
67
|
+
raise ValueError("api_key must not be empty")
|
|
68
|
+
|
|
69
|
+
host = _resolve_host(base_url, require_https=True)
|
|
70
|
+
|
|
71
|
+
auth_provider = ApiKeyAuthenticationProvider(
|
|
72
|
+
key_location=KeyLocation.Header,
|
|
73
|
+
api_key=api_key,
|
|
74
|
+
parameter_name=API_KEY_HEADER,
|
|
75
|
+
allowed_hosts=[host],
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return _build_client(auth_provider, base_url, http_client)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def create_anonymous_client(
|
|
82
|
+
*,
|
|
83
|
+
base_url: str = DEFAULT_BASE_URL,
|
|
84
|
+
http_client: Optional[httpx.AsyncClient] = None,
|
|
85
|
+
) -> PrdbClient:
|
|
86
|
+
"""Create a client without credentials.
|
|
87
|
+
|
|
88
|
+
Only ``GET /health`` is reachable this way; every other endpoint answers
|
|
89
|
+
401. Provided so health probes do not need an API key.
|
|
90
|
+
|
|
91
|
+
With no key to protect, ``base_url`` may use plain ``http``.
|
|
92
|
+
|
|
93
|
+
Raises:
|
|
94
|
+
ValueError: If ``base_url`` is not an absolute URL.
|
|
95
|
+
"""
|
|
96
|
+
_resolve_host(base_url, require_https=False)
|
|
97
|
+
|
|
98
|
+
return _build_client(AnonymousAuthenticationProvider(), base_url, http_client)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _build_client(
|
|
102
|
+
auth_provider: AuthenticationProvider,
|
|
103
|
+
base_url: str,
|
|
104
|
+
http_client: Optional[httpx.AsyncClient],
|
|
105
|
+
) -> PrdbClient:
|
|
106
|
+
request_adapter = DefaultRequestAdapter(
|
|
107
|
+
authentication_provider=auth_provider,
|
|
108
|
+
http_client=_build_http_client(http_client),
|
|
109
|
+
)
|
|
110
|
+
request_adapter.base_url = base_url
|
|
111
|
+
|
|
112
|
+
return PrdbClient(request_adapter)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def _build_http_client(http_client: Optional[httpx.AsyncClient]) -> httpx.AsyncClient:
|
|
116
|
+
"""Load the SDK's middleware pipeline onto a client, creating one if needed.
|
|
117
|
+
|
|
118
|
+
A client handed straight to the request adapter carries no middleware at
|
|
119
|
+
all, which loses redirect handling, retries and Kiota's parameter name
|
|
120
|
+
decoding. Routing both paths through this function keeps a caller-supplied
|
|
121
|
+
client behaving like the one we build ourselves.
|
|
122
|
+
"""
|
|
123
|
+
redirect_options = RedirectHandlerOption(
|
|
124
|
+
scrub_sensitive_headers=_refuse_cross_origin_redirect,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return KiotaClientFactory.create_with_default_middleware(
|
|
128
|
+
client=http_client,
|
|
129
|
+
options={RedirectHandlerOption.get_key(): redirect_options},
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _refuse_cross_origin_redirect(
|
|
134
|
+
new_request: httpx.Request,
|
|
135
|
+
original_url: httpx.URL,
|
|
136
|
+
) -> None:
|
|
137
|
+
"""Refuse a redirect that leaves the origin the request started on.
|
|
138
|
+
|
|
139
|
+
This runs in place of Kiota's default header scrubbing, which drops only
|
|
140
|
+
``Authorization`` and ``Cookie``. The prdb API key travels in a custom
|
|
141
|
+
header, and no layer below strips it: neither Kiota's redirect handler nor
|
|
142
|
+
httpx's own touch anything but ``Authorization``. A redirect off the API
|
|
143
|
+
host would therefore hand the credential to whoever answered.
|
|
144
|
+
|
|
145
|
+
The header is removed before raising as well, so the key is gone even if a
|
|
146
|
+
caller catches the error and reuses the request.
|
|
147
|
+
"""
|
|
148
|
+
new_url = new_request.url
|
|
149
|
+
same_origin = (
|
|
150
|
+
original_url.scheme == new_url.scheme
|
|
151
|
+
and original_url.host == new_url.host
|
|
152
|
+
and original_url.port == new_url.port
|
|
153
|
+
)
|
|
154
|
+
if same_origin:
|
|
155
|
+
return
|
|
156
|
+
|
|
157
|
+
new_request.headers.pop(API_KEY_HEADER, None)
|
|
158
|
+
new_request.headers.pop("Authorization", None)
|
|
159
|
+
new_request.headers.pop("Cookie", None)
|
|
160
|
+
|
|
161
|
+
raise CrossOriginRedirectError(
|
|
162
|
+
f"refusing to follow a redirect from {original_url.host} to "
|
|
163
|
+
f"{new_url.host}; the api key is bound to the first host"
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def _resolve_host(base_url: str, *, require_https: bool) -> str:
|
|
168
|
+
parsed = urlparse(base_url)
|
|
169
|
+
if parsed.scheme not in ("http", "https") or not parsed.hostname:
|
|
170
|
+
raise ValueError(f"base_url must be an absolute URL, got {base_url!r}")
|
|
171
|
+
|
|
172
|
+
if require_https and parsed.scheme != "https":
|
|
173
|
+
raise ValueError(
|
|
174
|
+
f"base_url must use https so the api key is not sent in cleartext, "
|
|
175
|
+
f"got {base_url!r}"
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
return parsed.hostname
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import datetime
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from kiota_abstractions.base_request_builder import BaseRequestBuilder
|
|
6
|
+
from kiota_abstractions.base_request_configuration import RequestConfiguration
|
|
7
|
+
from kiota_abstractions.default_query_parameters import QueryParameters
|
|
8
|
+
from kiota_abstractions.get_path_parameters import get_path_parameters
|
|
9
|
+
from kiota_abstractions.method import Method
|
|
10
|
+
from kiota_abstractions.request_adapter import RequestAdapter
|
|
11
|
+
from kiota_abstractions.request_information import RequestInformation
|
|
12
|
+
from kiota_abstractions.request_option import RequestOption
|
|
13
|
+
from kiota_abstractions.serialization import Parsable, ParsableFactory
|
|
14
|
+
from typing import Any, Optional, TYPE_CHECKING, Union
|
|
15
|
+
from uuid import UUID
|
|
16
|
+
from warnings import warn
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from ..models.list_actors_response import ListActorsResponse
|
|
20
|
+
from ..models.problem_details import ProblemDetails
|
|
21
|
+
from .batch.batch_request_builder import BatchRequestBuilder
|
|
22
|
+
from .changes.changes_request_builder import ChangesRequestBuilder
|
|
23
|
+
from .get_sort_direction_query_parameter_type import GetSortDirectionQueryParameterType
|
|
24
|
+
from .item.actors_item_request_builder import ActorsItemRequestBuilder
|
|
25
|
+
|
|
26
|
+
class ActorsRequestBuilder(BaseRequestBuilder):
|
|
27
|
+
"""
|
|
28
|
+
Builds and executes requests for operations under /actors
|
|
29
|
+
"""
|
|
30
|
+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
|
|
31
|
+
"""
|
|
32
|
+
Instantiates a new ActorsRequestBuilder and sets the default values.
|
|
33
|
+
param path_parameters: The raw url or the url-template parameters for the request.
|
|
34
|
+
param request_adapter: The request adapter to use to execute the requests.
|
|
35
|
+
Returns: None
|
|
36
|
+
"""
|
|
37
|
+
super().__init__(request_adapter, "{+baseurl}/actors{?CreatedAfter*,CreatedBefore*,Page*,PageSize*,Search*,SortBy*,SortDirection*}", path_parameters)
|
|
38
|
+
|
|
39
|
+
def by_id(self,id: UUID) -> ActorsItemRequestBuilder:
|
|
40
|
+
"""
|
|
41
|
+
Gets an item from the prdb_sdk.generated.actors.item collection
|
|
42
|
+
param id: Unique identifier of the item
|
|
43
|
+
Returns: ActorsItemRequestBuilder
|
|
44
|
+
"""
|
|
45
|
+
if id is None:
|
|
46
|
+
raise TypeError("id cannot be null.")
|
|
47
|
+
from .item.actors_item_request_builder import ActorsItemRequestBuilder
|
|
48
|
+
|
|
49
|
+
url_tpl_params = get_path_parameters(self.path_parameters)
|
|
50
|
+
url_tpl_params["id"] = id
|
|
51
|
+
return ActorsItemRequestBuilder(self.request_adapter, url_tpl_params)
|
|
52
|
+
|
|
53
|
+
async def get(self,request_configuration: Optional[RequestConfiguration[ActorsRequestBuilderGetQueryParameters]] = None) -> Optional[ListActorsResponse]:
|
|
54
|
+
"""
|
|
55
|
+
Returns a paged list of actors. Supports free-text search by name or alias, and sorting by name or creation date. Default page size is 100, maximum is 500. Requires API key authentication.
|
|
56
|
+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
|
|
57
|
+
Returns: Optional[ListActorsResponse]
|
|
58
|
+
"""
|
|
59
|
+
request_info = self.to_get_request_information(
|
|
60
|
+
request_configuration
|
|
61
|
+
)
|
|
62
|
+
from ..models.problem_details import ProblemDetails
|
|
63
|
+
|
|
64
|
+
error_mapping: dict[str, type[ParsableFactory]] = {
|
|
65
|
+
"401": ProblemDetails,
|
|
66
|
+
}
|
|
67
|
+
if not self.request_adapter:
|
|
68
|
+
raise Exception("Http core is null")
|
|
69
|
+
from ..models.list_actors_response import ListActorsResponse
|
|
70
|
+
|
|
71
|
+
return await self.request_adapter.send_async(request_info, ListActorsResponse, error_mapping)
|
|
72
|
+
|
|
73
|
+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ActorsRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
|
|
74
|
+
"""
|
|
75
|
+
Returns a paged list of actors. Supports free-text search by name or alias, and sorting by name or creation date. Default page size is 100, maximum is 500. Requires API key authentication.
|
|
76
|
+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
|
|
77
|
+
Returns: RequestInformation
|
|
78
|
+
"""
|
|
79
|
+
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
|
|
80
|
+
request_info.configure(request_configuration)
|
|
81
|
+
request_info.headers.try_add("Accept", "application/json")
|
|
82
|
+
return request_info
|
|
83
|
+
|
|
84
|
+
def with_url(self,raw_url: str) -> ActorsRequestBuilder:
|
|
85
|
+
"""
|
|
86
|
+
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
|
87
|
+
param raw_url: The raw URL to use for the request builder.
|
|
88
|
+
Returns: ActorsRequestBuilder
|
|
89
|
+
"""
|
|
90
|
+
if raw_url is None:
|
|
91
|
+
raise TypeError("raw_url cannot be null.")
|
|
92
|
+
return ActorsRequestBuilder(self.request_adapter, raw_url)
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def batch(self) -> BatchRequestBuilder:
|
|
96
|
+
"""
|
|
97
|
+
The batch property
|
|
98
|
+
"""
|
|
99
|
+
from .batch.batch_request_builder import BatchRequestBuilder
|
|
100
|
+
|
|
101
|
+
return BatchRequestBuilder(self.request_adapter, self.path_parameters)
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def changes(self) -> ChangesRequestBuilder:
|
|
105
|
+
"""
|
|
106
|
+
The changes property
|
|
107
|
+
"""
|
|
108
|
+
from .changes.changes_request_builder import ChangesRequestBuilder
|
|
109
|
+
|
|
110
|
+
return ChangesRequestBuilder(self.request_adapter, self.path_parameters)
|
|
111
|
+
|
|
112
|
+
@dataclass
|
|
113
|
+
class ActorsRequestBuilderGetQueryParameters():
|
|
114
|
+
"""
|
|
115
|
+
Returns a paged list of actors. Supports free-text search by name or alias, and sorting by name or creation date. Default page size is 100, maximum is 500. Requires API key authentication.
|
|
116
|
+
"""
|
|
117
|
+
def get_query_parameter(self,original_name: str) -> str:
|
|
118
|
+
"""
|
|
119
|
+
Maps the query parameters names to their encoded names for the URI template parsing.
|
|
120
|
+
param original_name: The original query parameter name in the class.
|
|
121
|
+
Returns: str
|
|
122
|
+
"""
|
|
123
|
+
if original_name is None:
|
|
124
|
+
raise TypeError("original_name cannot be null.")
|
|
125
|
+
if original_name == "created_after":
|
|
126
|
+
return "CreatedAfter"
|
|
127
|
+
if original_name == "created_before":
|
|
128
|
+
return "CreatedBefore"
|
|
129
|
+
if original_name == "page":
|
|
130
|
+
return "Page"
|
|
131
|
+
if original_name == "page_size":
|
|
132
|
+
return "PageSize"
|
|
133
|
+
if original_name == "search":
|
|
134
|
+
return "Search"
|
|
135
|
+
if original_name == "sort_by":
|
|
136
|
+
return "SortBy"
|
|
137
|
+
if original_name == "sort_direction":
|
|
138
|
+
return "SortDirection"
|
|
139
|
+
return original_name
|
|
140
|
+
|
|
141
|
+
created_after: Optional[datetime.datetime] = None
|
|
142
|
+
|
|
143
|
+
created_before: Optional[datetime.datetime] = None
|
|
144
|
+
|
|
145
|
+
page: Optional[int] = None
|
|
146
|
+
|
|
147
|
+
page_size: Optional[int] = None
|
|
148
|
+
|
|
149
|
+
search: Optional[str] = None
|
|
150
|
+
|
|
151
|
+
sort_by: Optional[str] = None
|
|
152
|
+
|
|
153
|
+
sort_direction: Optional[GetSortDirectionQueryParameterType] = None
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@dataclass
|
|
157
|
+
class ActorsRequestBuilderGetRequestConfiguration(RequestConfiguration[ActorsRequestBuilderGetQueryParameters]):
|
|
158
|
+
"""
|
|
159
|
+
Configuration for the request such as headers, query parameters, and middleware options.
|
|
160
|
+
"""
|
|
161
|
+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
|
|
162
|
+
|
|
163
|
+
|